Fixed topic count for users who can view unapproved items

git-svn-id: file:///svn/phpbb/trunk@3741 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-03-29 00:51:38 +00:00
parent 213beefc17
commit 2678cb904f

View file

@ -192,6 +192,7 @@ if ($forum_data['forum_postable'])
$sql = "SELECT COUNT(topic_id) AS forum_topics $sql = "SELECT COUNT(topic_id) AS forum_topics
FROM " . TOPICS_TABLE . " 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_last_post_time >= $min_topic_time
AND topic_type <> " . POST_ANNOUNCE; AND topic_type <> " . POST_ANNOUNCE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -201,8 +202,15 @@ if ($forum_data['forum_postable'])
$limit_topics_time = "AND t.topic_last_post_time >= $min_topic_time"; $limit_topics_time = "AND t.topic_last_post_time >= $min_topic_time";
} }
else else
{
if ($auth->acl_get('m_approve', $forum_id))
{ {
$topics_count = ($forum_data['forum_topics']) ? $forum_data['forum_topics'] : 1; $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 = ''; $limit_topics_time = '';
} }