phpBB

Code Changes

File: includes/mcp/mcp_main.php

  Unmodified   Added   Modified   Removed
Line 47Line 47
			case 'unlock':
$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


			case 'unlock':
$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 60Line 60

$post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));



$post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));


				if (!sizeof($post_ids))

				if (!count($post_ids))

				{
trigger_error('NO_POST_SELECTED');
}

				{
trigger_error('NO_POST_SELECTED');
}

Line 75Line 75

$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));



$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 88Line 88

$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));



$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 101Line 101

$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));



$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 118Line 118
				$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
$soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;


				$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
$soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 135Line 135
				$post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));
$soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;


				$post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));
$soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;


				if (!sizeof($post_ids))

				if (!count($post_ids))

				{
trigger_error('NO_POST_SELECTED');
}

				{
trigger_error('NO_POST_SELECTED');
}

Line 148Line 148

$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));



$topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));


				if (!sizeof($topic_ids))

				if (!count($topic_ids))

				{
trigger_error('NO_TOPIC_SELECTED');
}

				{
trigger_error('NO_TOPIC_SELECTED');
}

Line 193Line 193

$forum_info = phpbb_get_forum_data($forum_id, 'm_', true);



$forum_info = phpbb_get_forum_data($forum_id, 'm_', true);


				if (!sizeof($forum_info))

				if (!count($forum_info))

				{
$this->main('main', 'front');
return;

				{
$this->main('main', 'front');
return;

Line 342Line 342
		);
extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars)));


		);
extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars)));


		$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';

		$success_msg = $l_prefix . ((count($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';


meta_refresh(2, $redirect);
$message = $user->lang[$success_msg];


meta_refresh(2, $redirect);
$message = $user->lang[$success_msg];

Line 355Line 355
	}
else
{

	}
else
{

		confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);

		confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((count($ids) == 1) ? '' : 'S'), $s_hidden_fields);

	}

redirect($redirect);

	}

redirect($redirect);

Line 373Line 373
		case 'make_announce':
$new_topic_type = POST_ANNOUNCE;
$check_acl = 'f_announce';

		case 'make_announce':
$new_topic_type = POST_ANNOUNCE;
$check_acl = 'f_announce';

			$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS';

			$l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS';

		break;

case 'make_global':
$new_topic_type = POST_GLOBAL;
$check_acl = 'f_announce_global';

		break;

case 'make_global':
$new_topic_type = POST_GLOBAL;
$check_acl = 'f_announce_global';

			$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS';

			$l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS';

		break;

case 'make_sticky':
$new_topic_type = POST_STICKY;
$check_acl = 'f_sticky';

		break;

case 'make_sticky':
$new_topic_type = POST_STICKY;
$check_acl = 'f_sticky';

			$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES';

			$l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES';

		break;

default:
$new_topic_type = POST_NORMAL;
$check_acl = false;

		break;

default:
$new_topic_type = POST_NORMAL;
$check_acl = false;

			$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS';

			$l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS';

		break;
}


		break;
}


Line 419Line 419
			WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);


			WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);


		if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids))

		if (($new_topic_type == POST_GLOBAL) && count($topic_ids))

		{
// Delete topic shadows for global announcements
$sql = 'DELETE FROM ' . TOPICS_TABLE . '

		{
// Delete topic shadows for global announcements
$sql = 'DELETE FROM ' . TOPICS_TABLE . '

Line 432Line 432
			$db->sql_query($sql);
}


			$db->sql_query($sql);
}


		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';

		$success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';





		if (sizeof($topic_ids))

		if (count($topic_ids))

		{
$data = phpbb_get_topic_data($topic_ids);


		{
$data = phpbb_get_topic_data($topic_ids);


Line 496Line 496
	{
$forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');


	{
$forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');


		if (!sizeof($forum_data))

		if (!count($forum_data))

		{
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
}

		{
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
}

Line 691Line 691
			$sync_sql[$forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted - ' . (int) $topics_moved_softdeleted;
}


			$sync_sql[$forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted - ' . (int) $topics_moved_softdeleted;
}


		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS';

		$success_msg = (count($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS';


foreach ($sync_sql as $forum_id_key => $array)
{


foreach ($sync_sql as $forum_id_key => $array)
{

Line 714Line 714
			'ADDITIONAL_MSG'		=> $additional_msg)
);


			'ADDITIONAL_MSG'		=> $additional_msg)
);


		confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');

		confirm_box(false, 'MOVE_TOPIC' . ((count($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');

	}

$redirect = $request->variable('redirect', "index.$phpEx");

	}

$redirect = $request->variable('redirect', "index.$phpEx");

Line 762Line 762

if (confirm_box(true))
{


if (confirm_box(true))
{

		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS';

		$success_msg = (count($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS';


$data = phpbb_get_topic_data($topic_ids);



$data = phpbb_get_topic_data($topic_ids);


Line 784Line 784
	}
else
{

	}
else
{

		confirm_box(false, (sizeof($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields);

		confirm_box(false, (count($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields);

	}

$topic_id = $request->variable('t', 0);

	}

$topic_id = $request->variable('t', 0);

Line 842Line 842

if (confirm_box(true))
{


if (confirm_box(true))
{

		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS';

		$success_msg = (count($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS';


$data = phpbb_get_topic_data($topic_ids);



$data = phpbb_get_topic_data($topic_ids);


Line 927Line 927
			'S_TOPIC_MODE'						=> true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),

			'S_TOPIC_MODE'						=> true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),

			'DELETE_TOPIC_PERMANENTLY_EXPLAIN'	=> $user->lang('DELETE_TOPIC_PERMANENTLY', sizeof($topic_ids)),

			'DELETE_TOPIC_PERMANENTLY_EXPLAIN'	=> $user->lang('DELETE_TOPIC_PERMANENTLY', count($topic_ids)),

		));


		));


		$l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';

		$l_confirm = (count($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';

		if ($only_softdeleted)
{
$l_confirm .= '_PERMANENTLY';

		if ($only_softdeleted)
{
$l_confirm .= '_PERMANENTLY';

Line 1042Line 1042
		{
$phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), $soft_delete_reason, isset($topic_data['first_post']), isset($topic_data['last_post']));
}

		{
$phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), $soft_delete_reason, isset($topic_data['first_post']), isset($topic_data['last_post']));
}

		$affected_topics = sizeof($topic_info);

		$affected_topics = count($topic_info);

		// None of the topics is really deleted, so a redirect won't hurt much.
$deleted_topics = 0;


		// None of the topics is really deleted, so a redirect won't hurt much.
$deleted_topics = 0;


		$success_msg = (sizeof($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS'];

		$success_msg = (count($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS'];


foreach ($approve_log as $row)
{


foreach ($approve_log as $row)
{

Line 1093Line 1093
		{
$topic_id_list[] = $row['topic_id'];
}

		{
$topic_id_list[] = $row['topic_id'];
}

		$affected_topics = sizeof($topic_id_list);

		$affected_topics = count($topic_id_list);

		$db->sql_freeresult($result);

$post_data = phpbb_get_post_data($post_ids);

		$db->sql_freeresult($result);

$post_data = phpbb_get_post_data($post_ids);

Line 1132Line 1132
		}
$return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');


		}
$return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');


		if (sizeof($post_ids) == 1)

		if (count($post_ids) == 1)

		{
if ($deleted_topics)
{

		{
if ($deleted_topics)
{

Line 1181Line 1181
			'S_SOFTDELETED'						=> $only_softdeleted,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),

			'S_SOFTDELETED'						=> $only_softdeleted,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),

			'DELETE_POST_PERMANENTLY_EXPLAIN'	=> $user->lang('DELETE_POST_PERMANENTLY', sizeof($post_ids)),

			'DELETE_POST_PERMANENTLY_EXPLAIN'	=> $user->lang('DELETE_POST_PERMANENTLY', count($post_ids)),

		));


		));


		$l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';

		$l_confirm = (count($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';

		if ($only_softdeleted)
{
$l_confirm .= '_PERMANENTLY';

		if ($only_softdeleted)
{
$l_confirm .= '_PERMANENTLY';

Line 1247Line 1247
	{
$forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');


	{
$forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');


		if (!sizeof($topic_ids))

		if (!count($topic_ids))

		{
$additional_msg = $user->lang['NO_TOPIC_SELECTED'];
}

		{
$additional_msg = $user->lang['NO_TOPIC_SELECTED'];
}

		else if (!sizeof($forum_data))

		else if (!count($forum_data))

		{
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
}

		{
$additional_msg = $user->lang['FORUM_NOT_EXIST'];
}

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


			}
$db->sql_freeresult($result);


			if (!sizeof($post_rows))

			if (!count($post_rows))

			{
continue;
}

			{
continue;
}

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


					}
$db->sql_freeresult($result);


					if (sizeof($sql_ary))

					if (count($sql_ary))

					{
$db->sql_multi_insert(ATTACHMENTS_TABLE, $sql_ary);
}

					{
$db->sql_multi_insert(ATTACHMENTS_TABLE, $sql_ary);
}

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


			}
$db->sql_freeresult($result);


			if (sizeof($sql_ary))

			if (count($sql_ary))

			{
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
}

			{
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
}

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


			}
$db->sql_freeresult($result);


			if (sizeof($sql_ary))

			if (count($sql_ary))

			{
$db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
}

			{
$db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
}

Line 1589Line 1589
		sync('topic', 'topic_id', $new_topic_id_list);
sync('forum', 'forum_id', $to_forum_id);


		sync('topic', 'topic_id', $new_topic_id_list);
sync('forum', 'forum_id', $to_forum_id);


		$config->increment('num_topics', sizeof($new_topic_id_list), false);

		$config->increment('num_topics', count($new_topic_id_list), false);

		$config->increment('num_posts', $total_posts, false);

foreach ($new_topic_id_list as $topic_id => $new_topic_id)

		$config->increment('num_posts', $total_posts, false);

foreach ($new_topic_id_list as $topic_id => $new_topic_id)

Line 1601Line 1601
			));
}


			));
}


		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS';

		$success_msg = (count($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS';

	}
else
{

	}
else
{

Line 1611Line 1611
			'ADDITIONAL_MSG'		=> $additional_msg)
);


			'ADDITIONAL_MSG'		=> $additional_msg)
);


		confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');

		confirm_box(false, 'FORK_TOPIC' . ((count($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');

	}

$redirect = $request->variable('redirect', "index.$phpEx");

	}

$redirect = $request->variable('redirect', "index.$phpEx");