From 22c3f055e1b4115561dfa4514747d7d8e4475531 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 8 Jan 2003 19:43:35 +0000 Subject: - Bugfix: fixed the SQL query in _forum_topics_read to avoid counting shadowed topics in forums. Patch by David. --- modules/forum/forum.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index f1d507e3f..605d8048f 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -386,7 +386,7 @@ function _forum_num_replies($term) { } function _forum_topics_read($uid) { - $result = db_query("SELECT tid, count(*) AS c FROM history h, term_node r, node n WHERE r.nid = h.nid AND n.nid = h.nid AND n.type = 'forum' AND n.status = 1 AND h.uid = '%d' GROUP BY tid", $uid); + $result = db_query("SELECT tid, count(*) AS c FROM history h, term_node r, node n, forum f WHERE f.nid = r.nid AND r.nid = h.nid AND n.nid = h.nid AND f.shadow = 0 AND n.type = 'forum' AND n.status = 1 AND h.uid = '%d' GROUP BY tid", $uid); while ($obj = db_fetch_object($result)) { $topics_read[$obj->tid] = $obj->c; -- cgit v1.2.3