phpBB

Code Changes

File: phpbb/tree/nestedset.php

  Unmodified   Added   Modified   Removed
Line 533Line 533
			$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);


			$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);


			$diff = ' + ' . ($row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1);

			$diff = ' + ' . ((int) $row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1);

		}

$sql = 'UPDATE ' . $this->table_name . '

		}

$sql = 'UPDATE ' . $this->table_name . '

Line 706Line 706
	{
$acquired_new_lock = $this->acquire_lock();


	{
$acquired_new_lock = $this->acquire_lock();


		$diff = sizeof($subset_items) * 2;

		$diff = count($subset_items) * 2;

		$sql_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items);
$sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);


		$sql_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items);
$sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);


Line 746Line 746
	*/
protected function prepare_adding_subset(array $subset_items, array $new_parent)
{

	*/
protected function prepare_adding_subset(array $subset_items, array $new_parent)
{

		$diff = sizeof($subset_items) * 2;

		$diff = count($subset_items) * 2;

		$sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);

$set_left_id = $this->db->sql_case($this->column_left_id . ' > ' . (int) $new_parent[$this->column_right_id], $this->column_left_id . ' + ' . $diff, $this->column_left_id);

		$sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);

$set_left_id = $this->db->sql_case($this->column_left_id . ' > ' . (int) $new_parent[$this->column_right_id], $this->column_left_id . ' + ' . $diff, $this->column_left_id);