mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/9563] Do not show empty categories on index
PHPBB3-9563
This commit is contained in:
parent
049f584111
commit
2e20bae695
1 changed files with 13 additions and 1 deletions
|
@ -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'],
|
||||
|
|
Loading…
Add table
Reference in a new issue