From a16e5d2492f387605fe2b95b3c4c2b874c35c6c3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 12 Mar 2005 08:52:29 +0000 Subject: - Patch #18692 by Goba: old comments (comments for nodes having no entry in the history table anymore) are counted as new comments, since the timestamp retrieved from the history table is used to check for new comments (which is 0, if an entry was not found). This patch sets the timestamp used to check for new comments to the NODE_NEW_LIMIT value at least (which is when the history table was/should have been pruned). --- modules/comment/comment.module | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index ae6e958b2..6117c3366 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1344,6 +1344,7 @@ function comment_num_new($nid, $timestamp = 0) { if (!$timestamp) { $timestamp = node_last_viewed($nid); } + $timestamp = ($timestamp > NODE_NEW_LIMIT ? $timestamp : NODE_NEW_LIMIT); // Use the timestamp to retrieve the number of new comments. $result = db_result(db_query('SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d AND c.status = 0', $nid, $timestamp)); -- cgit v1.2.3