From d2888e8832259628ac8185dd0663c7bc08754f5c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 25 Mar 2013 10:30:01 +0400 Subject: [PATCH] create_published_article: set last_published properly on creation --- classes/article.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/classes/article.php b/classes/article.php index 595c6c43..b10766bf 100644 --- a/classes/article.php +++ b/classes/article.php @@ -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) { -- 2.39.5