With this hack tags will be automatically added. When forming the tag data is taken from a short news or news headlines.
Installation:
1) 1. Open the engine / modules / addnews.php and immediately after the first occurrence:
Find:
if( $found )
Above, insert one of the following:
/*------------- formation Tag Title ----------------*/
$nNumTags = 10;
$szContent = strip_tags($title);
$arr_tags = explode(' ', $szContent);
shuffle($arr_tags);
$nNumOfTags = 0;
$str_tag = '';
foreach ( $arr_tags as $tvalue ) {
$tvalue = trim($tvalue);
preg_match('/[a-zA-Zа-яА-Я]{4,}/', $tvalue, $t_v);
if ($t_v[0]) {
$str_tag .= $t_v[0].', ';
$nNumOfTags ++;
}
if ($nNumOfTags > $nNumTags)
break;
};
$_POST['tags'] = substr($str_tag, 0, strlen($str_tag)-1);
/*------------- formation Tag Title ----------------*/
Or:
/*------------- forming tags for brief news----------------*/
$nNumTags = 10;
$szContent = strip_tags($short_story);
$arr_tags = explode(' ', $szContent);
shuffle($arr_tags);
$nNumOfTags = 0;
$str_tag = '';
foreach ( $arr_tags as $tvalue ) {
$tvalue = trim($tvalue);
preg_match('/[a-zA-Zа-яА-Я]{4,}/', $tvalue, $t_v);
if ($t_v[0]) {
$str_tag .= $t_v[0].', ';
$nNumOfTags ++;
}
if ($nNumOfTags > $nNumTags)
break;
};
$_POST['tags'] = substr($str_tag, 0, strlen($str_tag)-1);
/*------------- forming tags for brief news ----------------*/
2. Open the file engine / inc / addnews.php and find:
if( trim( $_POST['vote_title']
Above, insert one of the following:
*------------- formation Tag Title ----------------*/
$nNumTags = 10;
$szContent = strip_tags($title);
$arr_tags = explode(' ', $szContent);
shuffle($arr_tags);
$nNumOfTags = 0;
$str_tag = '';
foreach ( $arr_tags as $tvalue ) {
$tvalue = trim($tvalue);
preg_match('/[a-zA-Zа-яА-Я]{4,}/', $tvalue, $t_v);
if ($t_v[0]) {
$str_tag .= $t_v[0].', ';
$nNumOfTags ++;
}
if ($nNumOfTags > $nNumTags)
break;
};
$_POST['tags'] = substr($str_tag, 0, strlen($str_tag)-1);
/*------------- formation Tag Title ----------------*/
Or:
/*------------- forming tags for brief news ----------------*/
$nNumTags = 10;
$szContent = strip_tags($short_story);
$arr_tags = explode(' ', $szContent);
shuffle($arr_tags);
$nNumOfTags = 0;
$str_tag = '';
foreach ( $arr_tags as $tvalue ) {
$tvalue = trim($tvalue);
preg_match('/[a-zA-Zа-яА-Я]{4,}/', $tvalue, $t_v);
if ($t_v[0]) {
$str_tag .= $t_v[0].', ';
$nNumOfTags ++;
}
if ($nNumOfTags > $nNumTags)
break;
};
$_POST['tags'] = substr($str_tag, 0, strlen($str_tag)-1);
/*------------- forming tags for brief news ----------------*/