Опытный - Репутация: 45
- Webmoney BL:
? | Подскажите, как в титл вставить еще пару слов, файл "show.short.php" - отвечает за вывод новостей. Конкретно например, Товар - $title купить, что бы он генерировал титл с уже вставленными двумя словами - товар и купить. В создаваемой новости не вариант самому прописывать, очень муторно! Предположительно нужно отредактировать этот отрывок из кода:
Открыть PHP код: // Обработка дополнительных полей
if( isset($view_template) AND $view_template == "rss" ) {
$tpl->set( '{rsslink}', $full_link );
$tpl->set( '{rssauthor}', $row['autor'] );
$tpl->set( '{rssdate}', date( "r", $row['date'] ) );
$tpl->set( '{title}', htmlspecialchars( strip_tags( stripslashes( $row['title'] ) ) ) );
if( $config['rss_format'] != 1 ) {
$row['short_story'] = preg_replace( "#<!--TBegin-->(.+?)<!--TEnd-->#is", "", $row['short_story'] );
$row['short_story'] = trim (htmlspecialchars( strip_tags( stripslashes( str_replace( "<br />", " ", $row['short_story'] ) ) ) ) );
} else {
$row['short_story'] = stripslashes( $row['short_story'] );
}
$tpl->set( '{short-story}', $row['short_story'] );
if( $config['rss_format'] == 2 ) {
$row['full_story'] = preg_replace( "#<!--TBegin-->(.+?)<!--TEnd-->#is", "", $row['full_story'] );
$row['full_story'] = trim (htmlspecialchars( strip_tags( stripslashes( str_replace( "<br />", " ", $row['full_story'] ) ), '<a>' ), ENT_QUOTES ) );
if( $row['full_story'] == "" ) $row['full_story'] = $row['short_story'];
$tpl->set( '{full-story}', $row['full_story'] );
}
} else {
if ($smartphone_detected) {
if (!$config['allow_smart_format']) {
$row['short_story'] = strip_tags( $row['short_story'], '<p><br><a>' );
} else {
if ( !$config['allow_smart_images'] ) {
$row['short_story'] = preg_replace( "#<!--TBegin-->(.+?)<!--TEnd-->#is", "", $row['short_story'] );
$row['short_story'] = preg_replace( "#<img(.+?)>#is", "", $row['short_story'] );
}
if ( !$config['allow_smart_video'] ) {
$row['short_story'] = preg_replace( "#<!--dle_video_begin(.+?)<!--dle_video_end-->#is", "", $row['short_story'] );
$row['short_story'] = preg_replace( "#<!--dle_audio_begin(.+?)<!--dle_audio_end-->#is", "", $row['short_story'] );
}
}
}
$tpl->set( '{title}', stripslashes( $row['title'] ) );
$tpl->set( '{short-story}', stripslashes( "<div id=\"news-id-" . $row['id'] . "\" style=\"display:inline;\">" . $row['short_story'] . "</div>" ) );
}
$tpl->compile( 'content' );
if( $user_group[$member_id['user_group']]['allow_hide'] ) $tpl->result['content'] = str_ireplace( "[hide]", "", str_ireplace( "[/hide]", "", $tpl->result['content']) );
else $tpl->result['content'] = preg_replace ( "#\[hide\](.+?)\[/hide\]#ims", "<div class=\"quote\">" . $lang['news_regus'] . "</div>", $tpl->result['content'] );
}
$tpl->clear();
$db->free( $sql_result );
if( $do == "" ) $do = $subaction;
if( $do == "" and $year ) $do = "date";
$ban_short = array ();
unset( $ban_short );
if( ! $news_found and $allow_userinfo and $member_id['name'] == $user and $user_group[$member_id['user_group']]['allow_adds'] ) {
$tpl->load_template( 'info.tpl' );
$tpl->set( '{error}', $lang['mod_list_f'] );
$tpl->set( '{title}', $lang['all_info'] );
$tpl->compile( 'content' );
$tpl->clear();
} elseif( !$news_found and $do == 'newposts' and $view_template != 'rss') {
msgbox( $lang['all_info'], $lang['newpost_notfound'] );
} elseif( ! $news_found and ! $allow_userinfo and $do != '' and $do != 'favorites' and $view_template != 'rss' ) {
if ( $newsmodule ) @header( "HTTP/1.0 404 Not Found" );
msgbox( $lang['all_err_1'], $lang['news_err_27'] );
} elseif( ! $news_found and $catalog != "" ) {
if ( $newsmodule ) @header( "HTTP/1.0 404 Not Found" );
msgbox( $lang['all_err_1'], $lang['news_err_27'] );
} elseif( ! $news_found and $do == 'favorites' ) {
if ( $member_id['favorites'] AND !$count_all ) $db->query( "UPDATE " . USERPREFIX . "_users SET favorites='' WHERE user_id = '{$member_id['user_id']}'" );
if (!$count_all) msgbox( $lang['all_info'], $lang['fav_notfound'] ); else msgbox( $lang['all_info'], $lang['fav_notfound_1'] );
}
[свернуть] |