diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-03-12 08:52:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-03-12 08:52:29 +0000 |
commit | a16e5d2492f387605fe2b95b3c4c2b874c35c6c3 (patch) | |
tree | 1f5077220d03b4f861a581a243dacba324dc23bb /modules/comment | |
parent | 2ec787df347c3ff8c812f713a4faf6b4904b1afa (diff) | |
download | brdo-a16e5d2492f387605fe2b95b3c4c2b874c35c6c3.tar.gz brdo-a16e5d2492f387605fe2b95b3c4c2b874c35c6c3.tar.bz2 |
- 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).
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 1 |
1 files changed, 1 insertions, 0 deletions
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)); |