]> git.wh0rd.org - tt-rss.git/commitdiff
posts register as updated when their MD5 hash changes
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 Aug 2005 09:07:47 +0000 (10:07 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 Aug 2005 09:07:47 +0000 (10:07 +0100)
config.php-dist
functions.php

index 56d9c13a273f23d599b2bc3238146176f12678a3..9126ef2fd95effe10e5afcd47af9dcd47f0475f5 100644 (file)
@@ -3,6 +3,6 @@
        define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache');
        define(HEADLINES_PER_PAGE, 15);
        define(MIN_UPDATE_TIME, 600);
-       define(CONTENT_CHECK_MD5, false);
+//     define(CONTENT_CHECK_MD5, false);
 ?>
 
index d89e6bc8397928b4c94ceb683812f3d6dc833430..bafb8d08e8238d1d84d8e03836ca4ec82cc491ca 100644 (file)
@@ -77,7 +77,7 @@
        
                                $result = pg_query($link, "
                                        SELECT 
-                                               id,unread,md5_hash,
+                                               id,unread,md5_hash,last_read,
                                                EXTRACT(EPOCH FROM updated) as updated_timestamp
                                        FROM
                                                ttrss_entries 
                                        $entry_id = pg_fetch_result($result, 0, "id");
                                        $updated_timestamp = pg_fetch_result($result, 0, "updated_timestamp");
                                        $entry_timestamp_fmt = strftime("%Y/%m/%d %H:%M:%S", $entry_timestamp);
+                                       $last_read = pg_fetch_result($result, 0, "last_read");
        
                                        $unread = pg_fetch_result($result, 0, "unread");
                                        $md5_hash = pg_fetch_result($result, 0, "md5_hash");
                                        
-                                       if ($md5_hash != $content_md5 && CONTENT_CHECK_MD5) 
-                                               $unread = "true";
-                               
+//                                     if ($md5_hash != $content_md5 && CONTENT_CHECK_MD5) 
+//                                             $unread = "true";
+
+                                       if ($md5_hash != $content_md5) {
+                                               $last_read = 'null';
+                                       } else {
+                                               $last_read = "'$last_read'";
+                                       }
+
 //                                     if ($unread || !CONTENT_CHECK_MD5) {
 //                                             $updated_query_part = "updated = '$entry_timestamp',";
 //                                     }
                                                        updated = '$entry_timestamp_fmt',
                                                        content = '$entry_content',
                                                        md5_hash = '$content_md5',
+                                                       last_read = $last_read,
                                                        unread = '$unread'
                                                WHERE
                                                        id = '$entry_id'";