1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-08 16:45:19 +02:00

Fixed error in handling sub-forum data when displaying "categories"

git-svn-id: file:///svn/phpbb/trunk@3955 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-04-26 16:24:58 +00:00
parent 8df413cafc
commit 09a9719982

View File

@ -107,6 +107,20 @@ function display_forums($root_data = '', $display_moderators = TRUE)
{ {
$branch_root_id = $forum_id; $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']) elseif ($row['forum_postable'])
{ {
@ -132,21 +146,6 @@ function display_forums($root_data = '', $display_moderators = TRUE)
{ {
$forum_unread[$parent_id] = 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(); $db->sql_freeresult();
@ -176,12 +175,14 @@ function display_forums($root_data = '', $display_moderators = TRUE)
} }
*/ */
// Grab moderators ... if necessary
if ($display_moderators) if ($display_moderators)
{ {
get_moderators($forum_moderators, $forum_ids); get_moderators($forum_moderators, $forum_ids);
} }
// Loop through the forums
$root_id = $root_data['forum_id']; $root_id = $root_data['forum_id'];
foreach ($forum_rows as $row) foreach ($forum_rows as $row)
{ {