[Customisation Database Commits] r1026 - /trunk/titania/includes/objects/category.php
Tom Catullo
tom at phpbb.com
Wed Apr 7 22:55:54 BST 2010
Author: Tom
Date: Wed Apr 7 22:55:54 2010
New Revision: 1026
Log:
Looks like array_map() was not needed after all.
Modified:
trunk/titania/includes/objects/category.php
Modified: trunk/titania/includes/objects/category.php
==============================================================================
*** trunk/titania/includes/objects/category.php (original)
--- trunk/titania/includes/objects/category.php Wed Apr 7 22:55:54 2010
***************
*** 235,248 ****
$sql = 'UPDATE ' . $this->sql_table . "
SET right_id = right_id + $diff
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
! AND ' . phpbb::$db->sql_in_set('category_id', array_map('intval', $moved_ids), true);
phpbb::$db->sql_query($sql);
// Resync the righthand side of the tree
$sql = 'UPDATE ' . $this->sql_table . "
SET left_id = left_id + $diff, right_id = right_id + $diff
WHERE left_id > " . $to_data['right_id'] . '
! AND ' . phpbb::$db->sql_in_set('category_id', array_map('intval', $moved_ids), true);
phpbb::$db->sql_query($sql);
// Resync moved branch
--- 235,248 ----
$sql = 'UPDATE ' . $this->sql_table . "
SET right_id = right_id + $diff
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
! AND ' . phpbb::$db->sql_in_set('category_id', $moved_ids, true);
phpbb::$db->sql_query($sql);
// Resync the righthand side of the tree
$sql = 'UPDATE ' . $this->sql_table . "
SET left_id = left_id + $diff, right_id = right_id + $diff
WHERE left_id > " . $to_data['right_id'] . '
! AND ' . phpbb::$db->sql_in_set('category_id', $moved_ids, true);
phpbb::$db->sql_query($sql);
// Resync moved branch
***************
*** 261,267 ****
{
$sql = 'SELECT MAX(right_id) AS right_id
FROM ' . $this->sql_table . '
! WHERE ' . phpbb::$db->sql_in_set('category_id', array_map('intval', $moved_ids), true);
$result = phpbb::$db->sql_query($sql);
$row = phpbb::$db->sql_fetchrow($result);
phpbb::$db->sql_freeresult($result);
--- 261,267 ----
{
$sql = 'SELECT MAX(right_id) AS right_id
FROM ' . $this->sql_table . '
! WHERE ' . phpbb::$db->sql_in_set('category_id', $moved_ids, true);
$result = phpbb::$db->sql_query($sql);
$row = phpbb::$db->sql_fetchrow($result);
phpbb::$db->sql_freeresult($result);
***************
*** 271,277 ****
$sql = 'UPDATE ' . $this->sql_table . "
SET left_id = left_id $diff, right_id = right_id $diff
! WHERE " . phpbb::$db->sql_in_set('category_id', array_map('intval', $moved_ids));
phpbb::$db->sql_query($sql);
if ($sync)
--- 271,277 ----
$sql = 'UPDATE ' . $this->sql_table . "
SET left_id = left_id $diff, right_id = right_id $diff
! WHERE " . phpbb::$db->sql_in_set('category_id', $moved_ids);
phpbb::$db->sql_query($sql);
if ($sync)
***************
*** 417,423 ****
$diff = sizeof($category_ids) * 2;
$sql = 'DELETE FROM ' . $this->sql_table . '
! WHERE ' . phpbb::$db->sql_in_set('category_id', array_map('intval', $category_ids));
phpbb::$db->sql_query($sql);
}
else if ($action_subcats == 'move')
--- 417,423 ----
$diff = sizeof($category_ids) * 2;
$sql = 'DELETE FROM ' . $this->sql_table . '
! WHERE ' . phpbb::$db->sql_in_set('category_id', $category_ids);
phpbb::$db->sql_query($sql);
}
else if ($action_subcats == 'move')
More information about the customisationdb-commits
mailing list