phpBB

Code Changes

File: includes/acp/acp_forums.php

  Unmodified   Added   Modified   Removed
Line 90Line 90

$errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);



$errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);


					if (sizeof($errors))

					if (count($errors))

					{
break;
}

					{
break;
}

Line 198Line 198

$errors = $this->update_forum_data($forum_data);



$errors = $this->update_forum_data($forum_data);


					if (!sizeof($errors))

					if (!count($errors))

					{
$forum_perm_from = $request->variable('forum_perm_from', 0);
$cache->destroy('sql', FORUMS_TABLE);

					{
$forum_perm_from = $request->variable('forum_perm_from', 0);
$cache->destroy('sql', FORUMS_TABLE);

Line 622Line 622

$template_data = array(
'S_EDIT_FORUM' => true,


$template_data = array(
'S_EDIT_FORUM' => true,

					'S_ERROR'			=> (sizeof($errors)) ? true : false,

					'S_ERROR'			=> (count($errors)) ? true : false,

					'S_PARENT_ID'		=> $this->parent_id,
'S_FORUM_PARENT_ID' => $forum_data['parent_id'],
'S_ADD_ACTION' => ($action == 'add') ? true : false,

					'S_PARENT_ID'		=> $this->parent_id,
'S_FORUM_PARENT_ID' => $forum_data['parent_id'],
'S_ADD_ACTION' => ($action == 'add') ? true : false,

Line 632Line 632

'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'],
'L_TITLE' => $user->lang[$this->page_title],


'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'],
'L_TITLE' => $user->lang[$this->page_title],

					'ERROR_MSG'						=> (sizeof($errors)) ? implode('<br />', $errors) : '',

					'ERROR_MSG'						=> (count($errors)) ? implode('<br />', $errors) : '',


'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],


'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],

Line 772Line 772
					'S_FORUM_LINK'			=> ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
'S_FORUMS_LIST' => $forums_list,

					'S_FORUM_LINK'			=> ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
'S_FORUMS_LIST' => $forums_list,

					'S_ERROR'				=> (sizeof($errors)) ? true : false,
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '')

					'S_ERROR'				=> (count($errors)) ? true : false,
'ERROR_MSG' => (count($errors)) ? implode('<br />', $errors) : '')

				);

return;

				);

return;

Line 924Line 924
		unset($rowset);

$template->assign_vars(array(

		unset($rowset);

$template->assign_vars(array(

			'ERROR_MSG'		=> (sizeof($errors)) ? implode('<br />', $errors) : '',

			'ERROR_MSG'		=> (count($errors)) ? implode('<br />', $errors) : '',

			'NAVIGATION'	=> $navigation,
'FORUM_BOX' => $forum_box,
'U_SEL_ACTION' => $this->u_action,

			'NAVIGATION'	=> $navigation,
'FORUM_BOX' => $forum_box,
'U_SEL_ACTION' => $this->u_action,

Line 1053Line 1053
		// What are we going to do tonight Brain? The same thing we do everynight,
// try to take over the world ... or decide whether to continue update
// and if so, whether it's a new forum/cat/link or an existing one

		// What are we going to do tonight Brain? The same thing we do everynight,
// try to take over the world ... or decide whether to continue update
// and if so, whether it's a new forum/cat/link or an existing one

		if (sizeof($errors))

		if (count($errors))

		{
return $errors;
}

		{
return $errors;
}

Line 1217Line 1217
							$errors = array_merge($errors, $this->delete_forum_content($_row['forum_id']));
}


							$errors = array_merge($errors, $this->delete_forum_content($_row['forum_id']));
}


						if (sizeof($errors))

						if (count($errors))

						{
return $errors;
}


						{
return $errors;
}


						if (sizeof($forum_ids))

						if (count($forum_ids))

						{
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);

						{
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);

Line 1252Line 1252
								$allowed_forums = array_diff($allowed_forums, $forum_ids);

$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "

								$allowed_forums = array_diff($allowed_forums, $forum_ids);

$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "

									SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'

									SET allowed_forums = '" . ((count($allowed_forums)) ? serialize($allowed_forums) : '') . "'

									WHERE group_id = {$_row['group_id']}";
$db->sql_query($sql);
}

									WHERE group_id = {$_row['group_id']}";
$db->sql_query($sql);
}

Line 1321Line 1321
				$forum_data_sql['forum_last_poster_colour'] = '';
}


				$forum_data_sql['forum_last_poster_colour'] = '';
}


			if (sizeof($errors))

			if (count($errors))

			{
return $errors;
}

			{
return $errors;
}

Line 1338Line 1338
				}
}


				}
}


			if (sizeof($errors))

			if (count($errors))

			{
return $errors;
}

			{
return $errors;
}

Line 1433Line 1433

$moved_forums = get_forum_branch($from_id, 'children', 'descending');
$from_data = $moved_forums[0];


$moved_forums = get_forum_branch($from_id, 'children', 'descending');
$from_data = $moved_forums[0];

		$diff = sizeof($moved_forums) * 2;

		$diff = count($moved_forums) * 2;


$moved_ids = array();


$moved_ids = array();

		for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i)

		for ($i = 0, $size = count($moved_forums); $i < $size; ++$i)

		{
$moved_ids[] = $moved_forums[$i]['forum_id'];
}

		{
$moved_ids[] = $moved_forums[$i]['forum_id'];
}

Line 1612Line 1612
			}
}


			}
}


		if (sizeof($errors))

		if (count($errors))

		{
return $errors;
}

		{
return $errors;
}

Line 1628Line 1628
				$errors = array_merge($errors, $this->delete_forum_content($row['forum_id']));
}


				$errors = array_merge($errors, $this->delete_forum_content($row['forum_id']));
}


			if (sizeof($errors))

			if (count($errors))

			{
return $errors;
}


			{
return $errors;
}


			$diff = sizeof($forum_ids) * 2;

			$diff = count($forum_ids) * 2;


$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);


$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);

Line 1706Line 1706
				}
}


				}
}


			if (sizeof($errors))

			if (count($errors))

			{
return $errors;
}

			{
return $errors;
}

Line 1754Line 1754
			$allowed_forums = array_diff($allowed_forums, $forum_ids);

$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "

			$allowed_forums = array_diff($allowed_forums, $forum_ids);

$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "

				SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'

				SET allowed_forums = '" . ((count($allowed_forums)) ? serialize($allowed_forums) : '') . "'

				WHERE group_id = {$row['group_id']}";
$db->sql_query($sql);
}

				WHERE group_id = {$row['group_id']}";
$db->sql_query($sql);
}

Line 1927Line 1927
						}
$db->sql_freeresult($result);


						}
$db->sql_freeresult($result);


						if (sizeof($ids))

						if (count($ids))

						{

						{

							$start += sizeof($ids);

							$start += count($ids);


foreach ($tables as $table)
{


foreach ($tables as $table)
{

Line 1937Line 1937
							}
}
}

							}
}
}

					while (sizeof($ids) == $batch_size);

					while (count($ids) == $batch_size);

				}
unset($ids);


				}
unset($ids);


Line 1978Line 1978
		}

// Adjust users post counts

		}

// Adjust users post counts

		if (sizeof($post_counts))

		if (count($post_counts))

		{
foreach ($post_counts as $poster_id => $substract)
{

		{
foreach ($post_counts as $poster_id => $substract)
{

Line 2062Line 2062
		}
$db->sql_freeresult($result);


		}
$db->sql_freeresult($result);


		if (!sizeof($target))

		if (!count($target))

		{
// The forum is already on top or bottom
return false;

		{
// The forum is already on top or bottom
return false;