diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-10-12 19:44:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-10-12 19:44:16 +0000 |
commit | 8ce9d2aca46345f7b83911efd3d83c6159af08de (patch) | |
tree | fac8c4a9cc0241238dd8d47a7f24a8dd3ebc4f86 /modules/forum.module | |
parent | a185443ed34db91d65b5278572c038a98508e4cb (diff) | |
download | brdo-8ce9d2aca46345f7b83911efd3d83c6159af08de.tar.gz brdo-8ce9d2aca46345f7b83911efd3d83c6159af08de.tar.bz2 |
- 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.
Diffstat (limited to 'modules/forum.module')
-rw-r--r-- | modules/forum.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/forum.module b/modules/forum.module index ffc099fff..7845b673e 100644 --- a/modules/forum.module +++ b/modules/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; } |