В файле engine/modules/show.full.php Перед if( $config[\'related_news\'] ) { Добавить // Back link $backlink = $db->super_query( \"SELECT id, title, category, alt_name, flag FROM \" . PREFIX . \"_post WHERE id > \" . $row[\'id\'] . \" AND category = \" . $row[\'category\'] . \" AND approve = 1 ORDER BY date ASC LIMIT 1\" ); if( $backlink ) { if( strlen( $backlink[\'title\'] ) > 75 ) $backlink[\'title\'] = substr( $backlink[\'title\'], 0, 75 ) . \" ...\"; if( $config[\'allow_alt_url\'] == \"yes\" ) { if( $backlink[\'flag\'] and $config[\'seo_type\'] ) { if( $backlink[\'category\'] and $config[\'seo_type\'] == 2 ) { $back_link = $config[\'http_home_url\'] . get_url( $backlink[\'category\'] ) . \"/\" . $backlink[\'id\'] . \"-\" . $backlink[\'alt_name\'] . \".html\"; } else { $back_link = $config[\'http_home_url\'] . $backlink[\'id\'] . \"-\" . $backlink[\'alt_name\'] . \".html\"; } } else { $back_link = $config[\'http_home_url\'] . date( \'Y/m/d/\', $backlink[\'date\'] ) . $backlink[\'alt_name\'] . \".html\"; } } else { $back_link = $config[\'http_home_url\'] . \"index.php?newsid=\" . $backlink[\'id\']; } } else { $back_link = \"\"; } // Next Link $nextlink = $db->super_query( \"SELECT id, title, category, alt_name, flag FROM \" . PREFIX . \"_post WHERE id < \" . $row[\'id\'] . \" AND category = \" . $row[\'category\'] . \" AND approve = 1 ORDER BY date DESC LIMIT 1\" ); if ( $nextlink ) { if( strlen( $nextlink[\'title\'] ) > 75 ) $nextlink[\'title\'] = substr( $nextlink[\'title\'], 0, 75 ) . \" ...\"; if( $config[\'allow_alt_url\'] == \"yes\" ) { if( $nextlink[\'flag\'] and $config[\'seo_type\'] ) { if( $nextlink[\'category\'] and $config[\'seo_type\'] == 2 ) { $next_link = $config[\'http_home_url\'] . get_url( $nextlink[\'category\'] ) . \"/\" . $nextlink[\'id\'] . \"-\" . $nextlink[\'alt_name\'] . \".html\"; } else { $next_link = $config[\'http_home_url\'] . $nextlink[\'id\'] . \"-\" . $nextlink[\'alt_name\'] . \".html\"; } } else { $next_link = $config[\'http_home_url\'] . date( \'Y/m/d/\', $nextlink[\'date\'] ) . $nextlink[\'alt_name\'] . \".html\"; } } else { $next_link = $config[\'http_home_url\'] . \"index.php?newsid=\" . $nextlink[\'id\']; } } else { $next_link = \"\"; } // Back and Next Link Template $back_link = \"<a href=\"\" . $back_link . \"\">\" . stripslashes( $backlink[\'title\'] ) . \"</a>\"; $next_link = \"<a href=\"\" . $next_link . \"\">\" . stripslashes( $nextlink[\'title\'] ) . \"</a>\"; $tpl->set( \'{back-link}\', $back_link ); $tpl->set( \'{next-link}\', $next_link ); В скине fullstory.tpl в месте, где надо показывать ссылки вставить: {back-link} - предыдущая новость {next-link} - следующая новость Вот и все!
|