diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2015-05-08 11:07:50 +0200 | 
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2015-05-08 11:07:50 +0200 | 
| commit | 7a478b27dd433746a012b1dc8135f45eed355c08 (patch) | |
| tree | 69f209f76a38be597bb1fe8a7000654bbc92a46c | |
| parent | 4fc6e7dbc7af5bf1e8fb896188d16083d62d426e (diff) | |
| parent | 70cbe671051820f41a28023e320546665e2272ba (diff) | |
| download | forums-7a478b27dd433746a012b1dc8135f45eed355c08.tar forums-7a478b27dd433746a012b1dc8135f45eed355c08.tar.gz forums-7a478b27dd433746a012b1dc8135f45eed355c08.tar.bz2 forums-7a478b27dd433746a012b1dc8135f45eed355c08.tar.xz forums-7a478b27dd433746a012b1dc8135f45eed355c08.zip | |
Merge pull request #3459 from brunoais/ticket/13664
[ticket/13664] Add event to allow changing number of unapproved posts in mcp_front
| -rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 25 | 
1 files changed, 21 insertions, 4 deletions
| diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 65b27f6b88..629b6fd275 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); | 
