Commit a16e5d24 authored by Dries's avatar Dries
Browse files

- Patch #18692 by Goba: old comments (comments for nodes having no entry in...

- 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).
parent 2ec787df
......@@ -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));
......
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment