]> git.wh0rd.org - tt-rss.git/commitdiff
create_published_article: set last_published properly on creation
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 06:30:01 +0000 (10:30 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 06:30:01 +0000 (10:30 +0400)
classes/article.php

index 595c6c4325cad16d8055333be98d349daf2858f0..b10766bf58386b5be761b0da252727ef138b72d7 100644 (file)
@@ -122,14 +122,16 @@ class Article extends Handler_Protected {
                                db_query($link, "UPDATE ttrss_entries SET
                                        content = '$content', content_hash = '$content_hash' WHERE id = '$ref_id'");
 
-                               db_query($link, "UPDATE ttrss_user_entries SET published = true WHERE
+                               db_query($link, "UPDATE ttrss_user_entries SET published = true,
+                                               last_published = NOW() WHERE
                                                int_id = '$int_id' AND owner_uid = '$owner_uid'");
                        } else {
 
                                db_query($link, "INSERT INTO ttrss_user_entries
-                                       (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, last_read, note, unread)
+                                       (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,
+                                               last_read, note, unread, last_published)
                                        VALUES
-                                       ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)");
+                                       ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false, NOW())");
                        }
 
                        if (count($labels) != 0) {
@@ -152,9 +154,10 @@ class Article extends Handler_Protected {
                                $ref_id = db_fetch_result($result, 0, "id");
 
                                db_query($link, "INSERT INTO ttrss_user_entries
-                                       (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, last_read, note, unread)
+                                       (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,
+                                               last_read, note, unread, last_published)
                                        VALUES
-                                       ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)");
+                                       ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false, NOW())");
 
                                if (count($labels) != 0) {
                                        foreach ($labels as $label) {