diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-05-31 11:08:00 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-05-31 11:08:00 +0200 |
commit | 2e20bae6952f13d34027924ac6fbf42586ca2725 (patch) | |
tree | 554e96ea55c6c41db3dfa42cac5b713d1c684125 /phpBB/includes | |
parent | 049f584111b5d7ce307d57d36b3be8a34d06194b (diff) | |
download | forums-2e20bae6952f13d34027924ac6fbf42586ca2725.tar forums-2e20bae6952f13d34027924ac6fbf42586ca2725.tar.gz forums-2e20bae6952f13d34027924ac6fbf42586ca2725.tar.bz2 forums-2e20bae6952f13d34027924ac6fbf42586ca2725.tar.xz forums-2e20bae6952f13d34027924ac6fbf42586ca2725.zip |
[ticket/9563] Do not show empty categories on index
PHPBB3-9563
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_display.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5888a6160d..70bf0be3a3 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -150,7 +150,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); - $forum_tracking_info = array(); + $forum_tracking_info = $valid_categories = array(); $branch_root_id = $root_data['forum_id']; $phpbb_content_visibility = $phpbb_container->get('content.visibility'); @@ -250,6 +250,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } } + // Fill list of categories with forums + if (isset($forum_rows[$row['parent_id']])) + { + $valid_categories[$row['parent_id']] = true; + } + // if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id) { @@ -404,6 +410,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Category if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT) { + // Do not display categories without any forums to display + if (!isset($valid_categories[$row['forum_id']])) + { + continue; + } + $cat_row = array( 'S_IS_CAT' => true, 'FORUM_ID' => $row['forum_id'], |