[ticket/13664] From string query in mcp_front unapproved posts to built query

PHPBB3-13664
This commit is contained in:
brunoais 2015-03-01 19:55:43 +00:00
parent 18de60c0e0
commit 5ad69bbecf

View file

@ -41,10 +41,15 @@ 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 => '',
),
'WHERE' => $db->sql_in_set('forum_id', $forum_list) . '
AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE))
);
$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);