diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8b0498f188..38a2316b2b 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -120,6 +120,7 @@
  • [Fix] Pass S_SEARCH_ACTION through append_sid() in search.php. (Bug #21585)
  • [Fix] Correctly delete message attachments. (Bug #23755)
  • [Fix] Support (and retain) tabs in code blocks. (Bug #25445)
  • +
  • [Fix] Correctly handle unread status of subforums (that are not shown on the index) of forums that are shown on the index. (Bug #14589)
  • [Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
  • [Change] Display warning in ACP if config.php file is left writable.
  • diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 937af3e95e..271fe02115 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -205,6 +205,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index']) ? true : false; $subforums[$parent_id][$forum_id]['name'] = $row['forum_name']; $subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time']; + $subforums[$parent_id][$forum_id]['children'] = array(); + + if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index']) + { + $subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id; + } $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics']; @@ -304,6 +310,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { $subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false; + if (!$subforum_unread && !empty($subforum_row['children'])) + { + foreach ($subforum_row['children'] as $child_id) + { + $subforum_unread = (isset($forum_tracking_info[$child_id]) && $subforums[$forum_id][$child_id]['orig_forum_last_post_time'] > $forum_tracking_info[$child_id]) ? true : false; + } + } + if ($subforum_row['display'] && $subforum_row['name']) { $subforums_list[] = array(