phpBB

Code Changes

File: includes/mcp/mcp_queue.php

  Unmodified   Added   Modified   Removed
Line 179Line 179

$post_info = phpbb_get_post_data(array($post_id), 'm_approve', true);



$post_info = phpbb_get_post_data(array($post_id), 'm_approve', true);


				if (!sizeof($post_info))

				if (!count($post_info))

				{
trigger_error('NO_POST_SELECTED');
}

				{
trigger_error('NO_POST_SELECTED');
}

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


					}
$db->sql_freeresult($result);


					if (sizeof($attachments))

					if (count($attachments))

					{
$update_count = array();
parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);

					{
$update_count = array();
parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);

Line 280Line 280
				$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']);


				$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']);


				$template->assign_vars(array(

				$post_data = array(

					'S_MCP_QUEUE'			=> true,
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"),
'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),

					'S_MCP_QUEUE'			=> true,
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"),
'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),

Line 324Line 324
					'S_FIRST_POST'			=> ($post_info['topic_first_post_id'] == $post_id),

'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',

					'S_FIRST_POST'			=> ($post_info['topic_first_post_id'] == $post_id),

'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',

				));





























				);

/**
* Alter post awaiting approval template before it is rendered
*
* @event core.mcp_queue_approve_details_template
* @var int post_id Post ID
* @var int topic_id Topic ID
* @var array topic_info Topic data
* @var array post_info Post data
* @var array post_data Post template data
* @var string message Post message
* @var string post_url Post URL
* @var string topic_url Topic URL
* @since 3.2.2-RC1
*/
$vars = array(
'post_id',
'topic_id',
'topic_info',
'post_info',
'post_data',
'message',
'post_url',
'topic_url',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_queue_approve_details_template', compact($vars)));

$template->assign_vars($post_data);


break;



break;


Line 349Line 377
				{
$topic_info = phpbb_get_topic_data(array($topic_id));


				{
$topic_info = phpbb_get_topic_data(array($topic_id));


					if (!sizeof($topic_info))

					if (!count($topic_info))

					{
trigger_error('TOPIC_NOT_EXIST');
}

					{
trigger_error('TOPIC_NOT_EXIST');
}

Line 379Line 407
						$forum_list[] = $row['forum_id'];
}


						$forum_list[] = $row['forum_id'];
}


					if (!sizeof($forum_list))

					if (!count($forum_list))

					{
trigger_error('NOT_MODERATOR');
}

					{
trigger_error('NOT_MODERATOR');
}

Line 395Line 423
				{
$forum_info = phpbb_get_forum_data(array($forum_id), $m_perm);


				{
$forum_info = phpbb_get_forum_data(array($forum_id), $m_perm);


					if (!sizeof($forum_info))

					if (!count($forum_info))

					{
trigger_error('NOT_MODERATOR');
}

					{
trigger_error('NOT_MODERATOR');
}

Line 465Line 493
					}
$db->sql_freeresult($result);


					}
$db->sql_freeresult($result);


					if (sizeof($post_ids))

					if (count($post_ids))

					{
$sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u

					{
$sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u

Line 537Line 565
					$db->sql_freeresult($result);
}


					$db->sql_freeresult($result);
}


				if (sizeof($forum_names))

				if (count($forum_names))

				{
// Select the names for the forum_ids
$sql = 'SELECT forum_id, forum_name

				{
// Select the names for the forum_ids
$sql = 'SELECT forum_id, forum_name

Line 771Line 799
			}
else
{

			}
else
{

				$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';

				$success_msg = (count($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';

			}

/**

			}

/**

Line 814Line 842
			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');

// If approving one post, also give links back to post...

			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');

// If approving one post, also give links back to post...

			if (sizeof($post_info) == 1 && $post_url)

			if (count($post_info) == 1 && $post_url)

			{
$message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>');
}

			{
$message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>');
}

Line 847Line 875

// Create the confirm box message
$action_msg = strtoupper($action);


// Create the confirm box message
$action_msg = strtoupper($action);

			$num_posts = sizeof($post_id_list) - $num_topics;

			$num_posts = count($post_id_list) - $num_topics;

			if ($num_topics > 0 && $num_posts <= 0)
{
$action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S');
}
else
{

			if ($num_topics > 0 && $num_posts <= 0)
{
$action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S');
}
else
{

				$action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S');

				$action_msg .= '_POST' . ((count($post_id_list) == 1) ? '' : 'S');

			}
confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html');
}

			}
confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html');
}

Line 919Line 947
				);
}


				);
}


			if (sizeof($topic_info) >= 1)

			if (count($topic_info) >= 1)

			{

			{

				$success_msg = (sizeof($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS';

				$success_msg = (count($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS';

			}

foreach ($approve_log as $log_data)

			}

foreach ($approve_log as $log_data)

Line 1024Line 1052
			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');

// If approving one topic, also give links back to topic...

			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');

// If approving one topic, also give links back to topic...

			if (sizeof($topic_info) == 1 && $topic_url)

			if (count($topic_info) == 1 && $topic_url)

			{
$message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>');
}

			{
$message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>');
}

Line 1055Line 1083
				'S_' . strtoupper($action)	=> true,
));


				'S_' . strtoupper($action)	=> true,
));


			confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');

			confirm_box(false, strtoupper($action) . '_TOPIC' . ((count($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');

		}

redirect($redirect);

		}

redirect($redirect);

Line 1206Line 1234
			}

// Get disapproved posts/topics counts separately

			}

// Get disapproved posts/topics counts separately

			$num_disapproved_topics = sizeof($disapprove_log_topics);
$num_disapproved_posts = sizeof($disapprove_log_posts);

			$num_disapproved_topics = count($disapprove_log_topics);
$num_disapproved_posts = count($disapprove_log_posts);


// Build the whole log
$disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);


// Build the whole log
$disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);

Line 1216Line 1244
			unset($post_data, $disapprove_log_topics, $disapprove_log_posts);

// Let's do the job - delete disapproved posts

			unset($post_data, $disapprove_log_topics, $disapprove_log_posts);

// Let's do the job - delete disapproved posts

			if (sizeof($post_disapprove_list))

			if (count($post_disapprove_list))

			{
if (!function_exists('delete_posts'))
{

			{
if (!function_exists('delete_posts'))
{

Line 1444Line 1472
				$l_confirm_msg = 'DELETE_POST_PERMANENTLY';
$confirm_template = 'confirm_delete_body.html';
}

				$l_confirm_msg = 'DELETE_POST_PERMANENTLY';
$confirm_template = 'confirm_delete_body.html';
}

			$l_confirm_msg .= ((sizeof($post_id_list) == 1) ? '' : 'S');

			$l_confirm_msg .= ((count($post_id_list) == 1) ? '' : 'S');


$template->assign_vars(array(
'S_NOTIFY_POSTER' => $show_notify,


$template->assign_vars(array(
'S_NOTIFY_POSTER' => $show_notify,