diff options
author | Andrew Dolgov <[email protected]> | 2011-04-27 09:55:05 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-04-27 09:55:05 +0400 |
commit | cdaa144301762d100bfc0e6f946a584012f3ab47 (patch) | |
tree | cbee23b4b67e0584e54a4ff307a0dae9835c2711 | |
parent | 4a4a15e67936ac75077d6fa8ea5d2b0fab287ecd (diff) |
do not mark post as updated when comments count changes
-rw-r--r-- | functions.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/functions.php b/functions.php index 79318dc68..fc50bd46e 100644 --- a/functions.php +++ b/functions.php @@ -1289,6 +1289,7 @@ } $post_needs_update = false; + $update_insignificant = false; if ($content_hash != $orig_content_hash) { // print "<!-- [$entry_title] $content_hash vs $orig_content_hash -->"; @@ -1301,6 +1302,7 @@ if ($orig_num_comments != $num_comments) { $post_needs_update = true; + $update_insignificant = true; } // this doesn't seem to be very reliable @@ -1326,14 +1328,16 @@ num_comments = '$num_comments' WHERE id = '$ref_id'"); - if ($mark_unread_on_update) { - db_query($link, "UPDATE ttrss_user_entries - SET last_read = null, unread = true WHERE ref_id = '$ref_id'"); - } else if ($update_on_checksum_change) { - db_query($link, "UPDATE ttrss_user_entries - SET last_read = null WHERE ref_id = '$ref_id' AND unread = false"); + if (!$update_insignificant) { + if ($mark_unread_on_update) { + db_query($link, "UPDATE ttrss_user_entries + SET last_read = null, unread = true WHERE ref_id = '$ref_id'"); + } else if ($update_on_checksum_change) { + db_query($link, "UPDATE ttrss_user_entries + SET last_read = null WHERE ref_id = '$ref_id' + AND unread = false"); + } } - } } |