aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2007-06-18 13:08:48 +0000
committerDavid M <davidmj@users.sourceforge.net>2007-06-18 13:08:48 +0000
commit5f62e8feda7a3b406ff8f3b7d82171491f34ce5a (patch)
treeccf7d2cd8ac56d0fa0dc496a80ed73b70c11ae15 /phpBB/includes/functions_admin.php
parent2599387b28db8ae42993c6272750cbd5e6b56d9c (diff)
downloadforums-5f62e8feda7a3b406ff8f3b7d82171491f34ce5a.tar
forums-5f62e8feda7a3b406ff8f3b7d82171491f34ce5a.tar.gz
forums-5f62e8feda7a3b406ff8f3b7d82171491f34ce5a.tar.bz2
forums-5f62e8feda7a3b406ff8f3b7d82171491f34ce5a.tar.xz
forums-5f62e8feda7a3b406ff8f3b7d82171491f34ce5a.zip
#11313
git-svn-id: file:///svn/phpbb/trunk@7775 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 185b0d35d2..f522670e5d 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -257,11 +257,31 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only =
$result = $db->sql_query($sql, $expire_time);
$forum_rows = array();
+
+ $right = $padding = 0;
+ $padding_store = array('0' => 0);
+
while ($row = $db->sql_fetchrow($result))
{
+ if ($row['left_id'] < $right)
+ {
+ $padding++;
+ $padding_store[$row['parent_id']] = $padding;
+ }
+ else if ($row['left_id'] > $right + 1)
+ {
+ // Ok, if the $padding_store for this parent is empty there is something wrong. For now we will skip over it.
+ // @todo digging deep to find out "how" this can happen.
+ $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : $padding;
+ }
+
+ $right = $row['right_id'];
+ $row['padding'] = $padding;
+
$forum_rows[] = $row;
}
$db->sql_freeresult($result);
+ unset($padding_store);
}
$rowset = array();