aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-10-21 11:50:16 +0000
committerNils Adermann <naderman@naderman.de>2007-10-21 11:50:16 +0000
commit9c4cb18c0db51d37c8b0cd382887db5ec72b2efe (patch)
treef486c9b630fa46304fad99218145f610800e5826 /phpBB/viewforum.php
parent19d3483c3824c4d4859e8f14a50cb57d97577938 (diff)
downloadforums-9c4cb18c0db51d37c8b0cd382887db5ec72b2efe.tar
forums-9c4cb18c0db51d37c8b0cd382887db5ec72b2efe.tar.gz
forums-9c4cb18c0db51d37c8b0cd382887db5ec72b2efe.tar.bz2
forums-9c4cb18c0db51d37c8b0cd382887db5ec72b2efe.tar.xz
forums-9c4cb18c0db51d37c8b0cd382887db5ec72b2efe.zip
- Correctly count announcements when filtering forums by date [Bug #14877]
git-svn-id: file:///svn/phpbb/trunk@8212 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index cb4e44f569..8621ba8ab8 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -211,6 +211,8 @@ $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// Limit topics to certain time frame, obtain correct topic count
+// global announcements must not be counted, normal announcements have to
+// be counted, as forum_topics(_real) includes them
if ($sort_days)
{
$min_post_time = time() - ($sort_days * 86400);
@@ -218,8 +220,8 @@ if ($sort_days)
$sql = 'SELECT COUNT(topic_id) AS num_topics
FROM ' . TOPICS_TABLE . "
WHERE forum_id = $forum_id
- AND topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ")
- AND topic_last_post_time >= $min_post_time
+ AND ((topic_type <> " . POST_GLOBAL . " AND topic_last_post_time >= $min_post_time)
+ OR topic_type = " . POST_ANNOUNCE . ")
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('num_topics');