aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-05-08 11:07:56 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-05-08 11:07:56 +0200
commitb1a52a5ef394ae6b9322a18495d1f234fd1ebb36 (patch)
tree2c2532c3d6319b6a8fc538a8c78b6d4c1dfa2463 /phpBB/includes
parent3f84473306d2a5c06adb726fbd22a6a18555c47e (diff)
parent7a478b27dd433746a012b1dc8135f45eed355c08 (diff)
downloadforums-b1a52a5ef394ae6b9322a18495d1f234fd1ebb36.tar
forums-b1a52a5ef394ae6b9322a18495d1f234fd1ebb36.tar.gz
forums-b1a52a5ef394ae6b9322a18495d1f234fd1ebb36.tar.bz2
forums-b1a52a5ef394ae6b9322a18495d1f234fd1ebb36.tar.xz
forums-b1a52a5ef394ae6b9322a18495d1f234fd1ebb36.zip
Merge branch '3.1.x'
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/mcp/mcp_front.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index e6fd3e3a6b..0d03a37731 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -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);