summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/comment.module1
-rw-r--r--modules/comment/comment.module1
2 files changed, 2 insertions, 0 deletions
diff --git a/modules/comment.module b/modules/comment.module
index ae6e958b2..6117c3366 100644
--- a/modules/comment.module
+++ b/modules/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));
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));