]> git.wh0rd.org Git - tt-rss.git/commitdiff
experimentally tweak adaptive mode to show unread articles first and other stuff...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 12:30:45 +0000 (16:30 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 12:30:45 +0000 (16:30 +0400)
include/functions.php

index 9a3ea4315779360bd2404ba6a9e850c5021d7dc6..4a584f96934ae5219d146c3bba52d13d5e0b8b82 100644 (file)
                                if ($search) {
                                        $view_query_part = " ";
                                } else if ($feed != -1) {
-                                       $unread = getFeedUnread($link, $feed, $cat_view);
 
-                                       if ($cat_view && $feed > 0 && $include_children)
-                                               $unread += getCategoryChildrenUnread($link, $feed);
+                                       if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
+                                               $a_date_sort_field = "updated";
+                                       } else {
+                                               $a_date_sort_field = "date_entered";
+                                       }
+
+                                       if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
+                                               $a_order_by = "$a_date_sort_field";
+                                       } else {
+                                               $a_order_by = "$a_date_sort_field DESC";
+                                       }
 
-                                       if ($unread > 0) {
-                                               $view_query_part = " unread = true AND ";
+                                       if (!$override_order) {
+                                               $override_order = "unread DESC, $a_order_by";
                                        }
                                }
                        }