From 09a97199821f9bcfaeca5f1ea00ae79fc41eca3c Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 26 Apr 2003 16:24:58 +0000 Subject: Fixed error in handling sub-forum data when displaying "categories" git-svn-id: file:///svn/phpbb/trunk@3955 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 563728f7b6..d3ff8e6b30 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -107,6 +107,20 @@ function display_forums($root_data = '', $display_moderators = TRUE) { $branch_root_id = $forum_id; } + + // Show most recent last post info on parent if we're a subforum + if (isset($forum_rows[$parent_id]) && $row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) + { + $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; + $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; + $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; + $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; + $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id']; + } + else + { + $forum_rows[$forum_id]['forum_id_last_post'] = $row['forum_id']; + } } elseif ($row['forum_postable']) { @@ -132,21 +146,6 @@ function display_forums($root_data = '', $display_moderators = TRUE) { $forum_unread[$parent_id] = true; } - - - // Show most recent last post info on parent if we're a subforum - if (isset($forum_rows[$parent_id]) && $row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) - { - $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; - $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; - $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; - $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; - $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id']; - } - else - { - $forum_rows[$forum_id]['forum_id_last_post'] = $row['forum_id']; - } } $db->sql_freeresult(); @@ -176,12 +175,14 @@ function display_forums($root_data = '', $display_moderators = TRUE) } */ + // Grab moderators ... if necessary if ($display_moderators) { get_moderators($forum_moderators, $forum_ids); } + // Loop through the forums $root_id = $root_data['forum_id']; foreach ($forum_rows as $row) { -- cgit v1.2.1