phpBB

Code Changes

File: includes/mcp/mcp_reports.php

  Unmodified   Added   Modified   Removed
Line 53Line 53

$report_id_list = $request->variable('report_id_list', array(0));



$report_id_list = $request->variable('report_id_list', array(0));


				if (!sizeof($report_id_list))

				if (!count($report_id_list))

				{
trigger_error('NO_REPORT_SELECTED');
}

				{
trigger_error('NO_REPORT_SELECTED');
}

Line 158Line 158

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



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


				if (!sizeof($post_info))

				if (!count($post_info))

				{
trigger_error('NO_REPORT_SELECTED');
}

				{
trigger_error('NO_REPORT_SELECTED');
}

Line 222Line 222
					}
$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 321Line 321
				{
$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 346Line 346
						$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 362Line 362
				{
$forum_info = phpbb_get_forum_data(array($forum_id), 'm_report');


				{
$forum_info = phpbb_get_forum_data(array($forum_id), 'm_report');


					if (!sizeof($forum_info))

					if (!count($forum_info))

					{
trigger_error('NOT_MODERATOR');
}

					{
trigger_error('NOT_MODERATOR');
}

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


				}
$db->sql_freeresult($result);


				if (sizeof($report_ids))

				if (count($report_ids))

				{
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, 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, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru

				{
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, 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, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru

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


		}
$db->sql_freeresult($result);


		if (sizeof($reports))

		if (count($reports))

		{
$close_report_posts = array_unique($close_report_posts);
$close_report_topics = array_unique($close_report_topics);


		{
$close_report_posts = array_unique($close_report_posts);
$close_report_topics = array_unique($close_report_topics);


			if (!$pm && sizeof($close_report_posts))

			if (!$pm && count($close_report_posts))

			{
// Get a list of topics that still contain reported posts
$sql = 'SELECT DISTINCT topic_id

			{
// Get a list of topics that still contain reported posts
$sql = 'SELECT DISTINCT topic_id

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


			}
$db->sql_query($sql);


			if (sizeof($close_report_posts))

			if (count($close_report_posts))

			{
if ($pm)
{

			{
if ($pm)
{

Line 679Line 679
						WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
$db->sql_query($sql);


						WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
$db->sql_query($sql);


					if (sizeof($close_report_topics))

					if (count($close_report_topics))

					{
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_reported = 0

					{
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_reported = 0

Line 721Line 721
		}

// Notify reporters

		}

// Notify reporters

		if (sizeof($notify_reporters))

		if (count($notify_reporters))

		{
foreach ($notify_reporters as $report_id => $reporter)
{

		{
foreach ($notify_reporters as $report_id => $reporter)
{

Line 761Line 761

unset($notify_reporters, $post_info, $reports);



unset($notify_reporters, $post_info, $reports);


		$success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';

		$success_msg = (count($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';

	}
else
{

	}
else
{

		confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);

		confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((count($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);

	}

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

	}

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

Line 784Line 784

if (!$pm)
{


if (!$pm)
{

			if (sizeof($forum_ids) === 1)

			if (count($forum_ids) === 1)

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


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


			if (sizeof($topic_ids) === 1)

			if (count($topic_ids) === 1)

			{
$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}

			{
$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}