Merge pull request #3455 from brunoais/ticket/13660

[ticket/13660] Allow changing the query for total reports in mcp_front
This commit is contained in:
Marc Alexander 2015-05-08 00:17:10 +02:00
commit 1e28748c0c

View file

@ -157,6 +157,18 @@ function mcp_front_view($id, $mode, $action)
AND r.pm_id = 0 AND r.pm_id = 0
AND r.report_closed = 0 AND r.report_closed = 0
AND ' . $db->sql_in_set('p.forum_id', $forum_list); 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 int 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); $result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total'); $total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result); $db->sql_freeresult($result);