Fix bug #47685 - Wrong count of posts awaiting approval in MCP

Authorised by: AcydBurn

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9739 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Joas Schilling 2009-07-08 20:36:57 +00:00
parent c875e29249
commit 144f2e8d73
2 changed files with 11 additions and 5 deletions

View file

@ -145,6 +145,7 @@
<li>[Fix] Color bbcode now supports three-digit hex notation. (Bug #39965 - Patch by m0rpha)</li>
<li>[Fix] Search by authorname does not display posts of guests and deleted or deactivated users (Bug #36565, #47765 - Patch by nickvergessen)</li>
<li>[Fix] View end of ban in MCP and ACP when user is banned by duration (Bug #47815 - Patch by Pyramide)</li>
<li>[Fix] Wrong count of posts awaiting approval in MCP. (Bug #47685 - Patch by nickvergessen)</li>
<li>[Fix] Display user's posts count in private message when it is equal to 0 (prosilver). (Bug #40155 - Patch by rxu)</li>
<li>[Fix] Disable word-censor option in UCP lacks the config-setting (Bug #47575 - Patch by 00mohgta7)</li>
<li>[Fix] Fix database updater and db tools to support multiple column changes/additions/removals with SQLite</li>

View file

@ -569,6 +569,9 @@ function get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false)
* sorting in mcp
*
* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
*
* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table
* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
*/
function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
{
@ -616,12 +619,14 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$type = 'posts';
$default_key = 't';
$default_dir = 'd';
$where_sql .= ($topic_id) ? ' topic_id = ' . $topic_id . ' AND' : '';
$where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : '';
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . "
$where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
AND post_approved = 0';
$sql = 'SELECT COUNT(p.post_id) AS total
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
AND p.post_approved = 0
AND t.topic_id = p.topic_id
AND t.topic_first_post_id <> p.post_id';
if ($min_time)
{