]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
implement proper last_marked/last_published feeds for proper sorting of
[tt-rss.git] / include / functions.php
index f17828d1db2d441696391b5fd58e71f9ddfc280c..bc8d48217c20c10c38d868afb4d83ab0c4f4b7c4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
        define('EXPECTED_CONFIG_VERSION', 26);
-       define('SCHEMA_VERSION', 104);
+       define('SCHEMA_VERSION', 105);
 
        $fetch_last_error = false;
        $pluginhost = false;
                                $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                                $allow_archived = true;
 
+                               if (!$override_order) $override_order = "last_marked DESC, updated DESC";
+
                        } else if ($feed == -2) { // published virtual feed OR labels category
 
                                if (!$cat_view) {
                                        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                                        $allow_archived = true;
 
-                                       if (!$override_order) $override_order = "last_read DESC, updated DESC";
+                                       if (!$override_order) $override_order = "last_published DESC, updated DESC";
                                } else {
                                        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
 
                                                comments,
                                                int_id,
                                                unread,feed_id,marked,published,link,last_read,orig_feed_id,
+                                               last_marked, last_published,
                                                ".SUBSTRING_FOR_DATE."(last_read,1,19) as last_read_noms,
                                                $vfeed_query_part
                                                $content_query_part
                                                                "label_cache," .
                                                                "link," .
                                                                "last_read," .
+                                                               "last_marked, last_published, " .
                                                                SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms," .
                                                                $since_id_part .
                                                                $vfeed_query_part .