Жду ваших пожеланий и критики, если таковая предвидится. Если вы просто установили мод и у вас все прекрасно работает - пишите и об этом, иначе мод просто не выйдет из [rc], потому что я буду в нем не уверен :wink: .
Код: Выделить всё
##############################################################
## MOD Title: Last Forum Topic On Index
## MOD Author: Xpert < xpert@phpbbguru.net > http://www.phpbbguru.net
## MOD Description: This mod replaces last forum poster info with
## last forum topic info.
## MOD Version: 1.0.1 [phpBB 2.0.x]
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit (1): index.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD.
##############################################################
## MOD History:
##
## 2004-05-16 - Version 1.0.1
## - Cutting special chars, as " and so on fixed
## Thanks to R@ < meos@mail.ru > for report.
##
## 2004-05-16 - Version 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
index.php
#
#-----[ FIND ]-----------------------------------------
#
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]-----------------------------------------
#
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
#
#-----[ FIND ]-----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
ORDER BY f.cat_id, f.forum_order";
break;
#
#-----[ REPLACE WITH ]----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_id
FROM ((( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_id = p.topic_id )
ORDER BY f.cat_id, f.forum_order";
break;
#
#-----[ FIND ]-----------------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = $last_post_time . '<br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
}
#
#-----[ REPLACE WITH ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$forum_data[$j]['topic_title'] = unprepare_message($forum_data[$j]['topic_title']);
$forum_data[$j]['topic_title'] = (strlen($forum_data[$j]['topic_title']) > 30) ? substr($forum_data[$j]['topic_title'], 0, 30) . '…' : $forum_data[$j]['topic_title'];
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = $last_post_time . ' ';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] : $lang['Guest']) : $forum_data[$j]['username'];
$last_post .= '<br /><a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id']) . '">' . $forum_data[$j]['topic_title'] . '</a>';
$last_post .= ' <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
}
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------
#
# EoM