mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13664] From string query in mcp_front unapproved posts to built query
PHPBB3-13664
This commit is contained in:
parent
18de60c0e0
commit
5ad69bbecf
1 changed files with 9 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue