From 8ce9d2aca46345f7b83911efd3d83c6159af08de Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 12 Oct 2004 19:44:16 +0000 Subject: - Patch #11298 by nato: the function _forum_topics_read was not returning only nodes of type 'forum' resulting in the forum overview listing counting all node types as topics; attached patch modifies queries to return counts of only 'forum' type nodes. --- modules/forum/forum.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index ffc099fff..7845b673e 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -390,8 +390,8 @@ function _forum_topics_read($term, $uid) { // Calculate the number of topics the user has read. Assume all entries older // than NODE_NEW_LIMIT are read, and include the recent posts that user has // read. - $ancient = db_result(db_query('SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d '. node_access_join_sql() .' WHERE n.created <= %d AND n.status = 1 AND '. node_access_where_sql(), $term, NODE_NEW_LIMIT)); - $recent = db_result(db_query('SELECT COUNT(n.nid) FROM {node} n '. node_access_join_sql() .' INNER JOIN {history} h ON n.nid = h.nid AND h.uid = %d INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.created > %d AND '. node_access_where_sql(), $uid, $term, NODE_NEW_LIMIT)); + $ancient = db_result(db_query("SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d ". node_access_join_sql() ." WHERE n.created <= %d AND n.status = 1 AND n.type = 'forum' AND ". node_access_where_sql(), $term, NODE_NEW_LIMIT)); + $recent = db_result(db_query("SELECT COUNT(n.nid) FROM {node} n ". node_access_join_sql() ." INNER JOIN {history} h ON n.nid = h.nid AND h.uid = %d INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum' AND n.created > %d AND ". node_access_where_sql(), $uid, $term, NODE_NEW_LIMIT)); return $ancient + $recent; } -- cgit v1.2.3