phpBB

Code Changes

File: includes/mcp/mcp_front.php

  Unmodified   Added   Modified   Removed
Line 41Line 41

if (!empty($forum_list))
{


if (!empty($forum_list))
{

			$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));


















			$sql_ary = array(
'SELECT' => 'COUNT(post_id) AS total',
'FROM' => array(
POSTS_TABLE => 'p',
),
'WHERE' => $db->sql_in_set('p.forum_id', $forum_list) . '
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE))
);

/**
* Allow altering the query to get the number of unapproved posts
*
* @event core.mcp_front_queue_unapproved_total_before
* @var array sql_ary Query array to get the total number of unapproved posts
* @var array forum_list List of forums to look for unapproved posts
* @since 3.1.5-RC1
*/
$vars = array('sql_ary', 'forum_list');
extract($phpbb_dispatcher->trigger_event('core.mcp_front_queue_unapproved_total_before', compact($vars)));

$sql = $db->sql_build_query('SELECT', $sql_ary);

			$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);

			$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);

Line 157Line 174
					AND r.pm_id = 0
AND r.report_closed = 0
AND ' . $db->sql_in_set('p.forum_id', $forum_list);

					AND r.pm_id = 0
AND r.report_closed = 0
AND ' . $db->sql_in_set('p.forum_id', $forum_list);

 

/**
* Alter sql query to count the number of reported posts
*
* @event core.mcp_front_reports_count_query_before
* @var string sql The query string used to get the number of reports that exist
* @var array forum_list List of forums that contain the posts
* @since 3.1.5-RC1
*/
$vars = array('sql', 'forum_list');
extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_count_query_before', compact($vars)));


			$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);

			$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);

Line 197Line 226
				* Alter sql query to get latest reported posts
*
* @event core.mcp_front_reports_listing_query_before

				* Alter sql query to get latest reported posts
*
* @event core.mcp_front_reports_listing_query_before

				* @var	int		sql_ary						Associative array with the query to be executed
* @var array forum_list List of forums that contain the posts

				* @var	array	sql_ary			Associative array with the query to be executed
* @var array forum_list List of forums that contain the posts

				* @since 3.1.0-RC3
*/
$vars = array('sql_ary', 'forum_list');

				* @since 3.1.0-RC3
*/
$vars = array('sql_ary', 'forum_list');

Line 234Line 263
						'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}

						'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}

 
				$db->sql_freeresult($result);

			}

$template->assign_vars(array(

			}

$template->assign_vars(array(

Line 244Line 274
	}

// Latest 5 reported PMs

	}

// Latest 5 reported PMs

	if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report'))

	if ($module->loaded('pm_reports') && $auth->acl_get('m_pm_report'))

	{
$template->assign_var('S_SHOW_PM_REPORTS', true);
$user->add_lang(array('ucp'));

	{
$template->assign_var('S_SHOW_PM_REPORTS', true);
$user->add_lang(array('ucp'));

Line 290Line 320
				$pm_by_id[(int) $row['msg_id']] = $row;
$pm_list[] = (int) $row['msg_id'];
}

				$pm_by_id[(int) $row['msg_id']] = $row;
$pm_list[] = (int) $row['msg_id'];
}

 
			$db->sql_freeresult($result);


$address_list = get_recipient_strings($pm_by_id);



$address_list = get_recipient_strings($pm_by_id);