In board.php replace this:
Code:
if (count($userprivateforums)==0)
$result = mysql_query("SELECT topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics ORDER BY topic_lastpost_time DESC LIMIT $shownumlastposts");
else
{
$where = 'WHERE forum_id<>'.implode(' AND forum_id<>', $userprivateforums);
$result = mysql_query("SELECT topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics $where ORDER BY topic_lastpost_time DESC LIMIT $shownumlastposts");
}
with this
Code:
if (count($userprivateforums)==0)
$result = mysql_query("SELECT forum_id, topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics ORDER BY topic_lastpost_time DESC LIMIT $shownumlastposts");
else
{
$where = 'WHERE forum_id<>'.implode(' AND forum_id<>', $userprivateforums);
$result = mysql_query("SELECT forum_id, topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics $where ORDER BY topic_lastpost_time DESC LIMIT $shownumlastposts");
}
Next replace this code
Code:
list($id, $title, $author, $author_id, $lastposter, $lastposter_id, $createdtime, $lastposttime, $num_replies, $num_views, $sticky, $locked, $moved) = $row;
with this code
Code:
list($f_id, $id, $title, $author, $author_id, $lastposter, $lastposter_id, $createdtime, $lastposttime, $num_replies, $num_views, $sticky, $locked, $moved) = $row;
Finally below this line
Code:
$topic_link = get_topic_link($id, $title, $num_replies+1, 'topiclink');
add this line
Code:
$forum_link = get_forum_link($f_id, $f_rows[$f_lookup_by_id[$f_id]][3]);
$forum_link now has a link to the forum where the topic was placed.
Last step is, you buy me a beer.
|