mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge branch '3.1.x'
This commit is contained in:
commit
b1a52a5ef3
1 changed files with 21 additions and 4 deletions
|
@ -41,10 +41,27 @@ function mcp_front_view($id, $mode, $action)
|
|||
|
||||
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 int sql_ary Query 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue