Created
October 13, 2011 20:58
-
-
Save cs278/1285505 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: includes/functions_display.php | |
=================================================================== | |
--- includes/functions_display.php (revision 10325) | |
+++ includes/functions_display.php (working copy) | |
@@ -222,9 +222,24 @@ | |
$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']) | |
+ // Only grab this data if we actually display subforums | |
+ if ($forum_rows[$parent_id]['display_subforum_list']) | |
{ | |
- $subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id; | |
+ if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index']) | |
+ { | |
+ $subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id; | |
+ } | |
+ else if (!$row['display_on_index'] && !empty($row['forum_parents'])) | |
+ { | |
+ // Handle nested sub forums | |
+ foreach (unserialize($row['forum_parents']) as $sub_forum_parent_id => $void) | |
+ { | |
+ if (isset($subforums[$parent_id][$sub_forum_parent_id])) | |
+ { | |
+ $subforums[$parent_id][$sub_forum_parent_id]['children'][] = $forum_id; | |
+ } | |
+ } | |
+ } | |
} | |
if (!$forum_rows[$parent_id]['forum_id_unapproved_topics'] && $row['forum_id_unapproved_topics']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment