From 2678cb904f52cf6f86d08a50765f76ec54660095 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Sat, 29 Mar 2003 00:51:38 +0000 Subject: [PATCH] Fixed topic count for users who can view unapproved items git-svn-id: file:///svn/phpbb/trunk@3741 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewforum.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index ee05349fbf..9f036d85bf 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -191,7 +191,8 @@ if ($forum_data['forum_postable']) // ref type on as rows as topics ... also not great $sql = "SELECT COUNT(topic_id) AS forum_topics FROM " . TOPICS_TABLE . " - WHERE forum_id = $forum_id + WHERE forum_id = $forum_id + " . (($auth->acl_gets('m_approve', 'a_', $forum_id)) ? '' : 'AND t.topic_approved = 1') . " AND topic_last_post_time >= $min_topic_time AND topic_type <> " . POST_ANNOUNCE; $result = $db->sql_query($sql); @@ -202,7 +203,14 @@ if ($forum_data['forum_postable']) } else { - $topics_count = ($forum_data['forum_topics']) ? $forum_data['forum_topics'] : 1; + if ($auth->acl_get('m_approve', $forum_id)) + { + $topics_count = ($forum_data['forum_topics']) ? $forum_data['forum_topics'] : 1; + } + else + { + $topics_count = ($forum_data['forum_topics_real']) ? $forum_data['forum_topics_real'] : 1; + } $limit_topics_time = ''; }