]> git.wh0rd.org Git - tt-rss.git/commitdiff
set last_read to NOW() when publishing, order published feed by last read by default...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 10 Sep 2012 06:27:51 +0000 (10:27 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 10 Sep 2012 06:27:51 +0000 (10:27 +0400)
classes/rpc.php
include/functions.php

index 733649139f381d184e899ec30fc77d6ae479f1df..c4d0cd53c3f6561929cb4cc307a09a3a4878a3fb 100644 (file)
@@ -276,7 +276,7 @@ class RPC extends Handler_Protected {
                }
 
                $result = db_query($this->link, "UPDATE ttrss_user_entries SET
-                       published = $pub
+                       published = $pub, last_read = NOW()
                        WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
 
                $pubsub_result = false;
index 65b794dd866ba85844d5302642ab710b76ccedd1..729cb2625d9bfcba1127a28722e3373172a0fe97 100644 (file)
                                        $query_strategy_part = "published = true";
                                        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                                        $allow_archived = true;
+
+                                       if (!$override_order) $override_order = "last_read DESC, updated DESC";
                                } else {
                                        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
 
                        } else if ($feed == -6) { // recently read
                                $query_strategy_part = "unread = false AND last_read IS NOT NULL";
                                $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
-                               $override_order = "last_read DESC";
+
+                               if (!$override_order) $override_order = "last_read DESC";
                        } else if ($feed == -3) { // fresh virtual feed
                                $query_strategy_part = "unread = true AND score >= 0";
 
                        WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
                } else if ($cmode == 1) {
                        db_query($link, "UPDATE ttrss_user_entries SET
-                       published = true
+                       published = true,last_read = NOW()
                        WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
                } else {
                        db_query($link, "UPDATE ttrss_user_entries SET