king_cobra
Sep 21st 2005, 3:38 am
Hi all,
I was working with phppb for some two days now. and as u can see from my previous posts i was constantly bugging people for tips. anyway, as necessity is the mother of invention, i found a way out of the biggest draw back (for me, atleast) of phpbb. that is not showing the last post topic title in the forum index page. So let me share the mod with all those who want the last post topic title to be shown in forum index.
Find in forum_root_folder/index.php
default:
$sql = "SELECT f.*, t.topic_id, t.topic_title, 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
default:
$sql = "SELECT f.*, t.topic_id, t.topic_title, 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 )
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'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $forum_data[$j]['topic_title'] . '">' .$forum_data[$j]['topic_title']. '</a>' . '<br /> by ';
$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 />'. $last_post_time;
}
there is no need to edit the template file.
Hope you enjoy it. You are free to use this, share this, but if you prefer to give someone a link to the mod, please give the link to this thread.
Thankyou.
Any doubt, just post here.
I was working with phppb for some two days now. and as u can see from my previous posts i was constantly bugging people for tips. anyway, as necessity is the mother of invention, i found a way out of the biggest draw back (for me, atleast) of phpbb. that is not showing the last post topic title in the forum index page. So let me share the mod with all those who want the last post topic title to be shown in forum index.
Find in forum_root_folder/index.php
default:
$sql = "SELECT f.*, t.topic_id, t.topic_title, 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
default:
$sql = "SELECT f.*, t.topic_id, t.topic_title, 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 )
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'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $forum_data[$j]['topic_title'] . '">' .$forum_data[$j]['topic_title']. '</a>' . '<br /> by ';
$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 />'. $last_post_time;
}
there is no need to edit the template file.
Hope you enjoy it. You are free to use this, share this, but if you prefer to give someone a link to the mod, please give the link to this thread.
Thankyou.
Any doubt, just post here.