diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-29 17:46:17 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-29 17:46:17 +0000 |
commit | c6cf57a138e968568e2aded01cdf5303f83d850c (patch) | |
tree | f9333169a4b75fa727f99c7fdf5f43e056931a36 /phpBB/includes/functions_admin.php | |
parent | 5b253228d76c41b4f231fb5650c50960e001b9ae (diff) | |
download | forums-c6cf57a138e968568e2aded01cdf5303f83d850c.tar forums-c6cf57a138e968568e2aded01cdf5303f83d850c.tar.gz forums-c6cf57a138e968568e2aded01cdf5303f83d850c.tar.bz2 forums-c6cf57a138e968568e2aded01cdf5303f83d850c.tar.xz forums-c6cf57a138e968568e2aded01cdf5303f83d850c.zip |
#1382
git-svn-id: file:///svn/phpbb/trunk@5756 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 240336583f..8ac13e25c1 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -25,7 +25,7 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') return; } - $sql_where = ($module_class) ? " WHERE module_class = '" . $db->sql_escape($module_class) . "'" : ' WHERE 1 '; + $sql_where = ($module_class) ? " WHERE module_class = '" . $db->sql_escape($module_class) . "'" : ''; // Reset to minimum possible left and right id $sql = "SELECT MIN(left_id) as min_left_id, MIN(right_id) as min_right_id @@ -57,8 +57,8 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') { $sql = "SELECT left_id, right_id FROM $sql_table - $sql_where - AND $sql_id = {$item_data['parent_id']}"; + $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . " + $sql_id = {$item_data['parent_id']}"; $result = $db->sql_query($sql); if (!$row = $db->sql_fetchrow($result)) @@ -70,14 +70,14 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') $sql = "UPDATE $sql_table SET left_id = left_id + 2, right_id = right_id + 2 - $sql_where - AND left_id > {$row['right_id']}"; + $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . " + left_id > {$row['right_id']}"; $db->sql_query($sql); $sql = "UPDATE $sql_table SET right_id = right_id + 2 - $sql_where - AND {$row['left_id']} BETWEEN left_id AND right_id"; + $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . " + {$row['left_id']} BETWEEN left_id AND right_id"; $db->sql_query($sql); $item_data['left_id'] = $row['right_id']; @@ -102,7 +102,6 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') WHERE $sql_id = " . $item_data[$sql_id]; $db->sql_query($sql); } - $db->sql_freeresult($f_result); } |