]> git.wh0rd.org Git - tt-rss.git/commitdiff
disable SORT_HEADLINES_BY_FEED_DATE; replace with a toolbar newest first order
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Mar 2013 16:51:06 +0000 (20:51 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Mar 2013 16:51:06 +0000 (20:51 +0400)
classes/feeds.php
classes/handler/public.php
classes/pref/prefs.php
index.php

index 6aca206a2f6c8e8985ba8d6fa7a5fd4559fc30f8..fcac6e4d6ee856671e6579326f03c6bd82f8034e 100644 (file)
@@ -862,15 +862,12 @@ class Feeds extends Handler_Protected {
 
                $override_order = false;
 
-               if (get_pref($this->link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
-                       $date_sort_field = "updated";
-               } else {
-                       $date_sort_field = "date_entered";
-               }
-
                switch ($order_by) {
                        case "date_reverse":
-                               $override_order = "$date_sort_field, updated";
+                               $override_order = "date_entered DESC, updated";
+                               break;
+                       case "feed_dates":
+                               $override_order = "updated DESC";
                                break;
                }
 
index 5adb3ab6ea410022d05a898e8947b2a4b1f7a457..32e40657de06e3d7b700aa62543d466366bf67c4 100644 (file)
@@ -14,11 +14,7 @@ class Handler_Public extends Handler {
 
                if (!$limit) $limit = 100;
 
-               if (get_pref($this->link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
-                       $date_sort_field = "updated";
-               } else {
-                       $date_sort_field = "date_entered";
-               }
+               $date_sort_field = "date_entered DESC, updated DESC";
 
                if ($feed == -2)
                        $date_sort_field = "last_published";
@@ -27,7 +23,7 @@ class Handler_Public extends Handler {
 
                $qfh_ret = queryFeedHeadlines($this->link, $feed,
                        $limit, $view_mode, $is_cat, $search, $search_mode,
-                       "$date_sort_field DESC", $offset, $owner_uid,
+                       $date_sort_field, $offset, $owner_uid,
                        false, 0, false, true);
 
                $result = $qfh_ret[0];
index be8b94447800b0120793ce587ce7d8439c8acfd3..ad5dff4add1e70c1b41cf2697d0a65b28763ec49 100644 (file)
@@ -121,7 +121,8 @@ class Pref_Prefs extends Handler_Protected {
 
                global $access_level_names;
 
-               $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES");
+               $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES",
+                       "SORT_HEADLINES_BY_FEED_DATE");
 
                /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */
 
index 963e5940cf2bcde2d237711da48705c406a85994..e9db16bb9426dc5251c39f1fb331bb070fb8d9b0 100644 (file)
--- a/index.php
+++ b/index.php
                        dojoType="dijit.form.Select" name="order_by">
                        <option selected="selected" value="default"><?php echo __('Default') ?></option>
                        <option value="date_reverse"><?php echo __('Oldest first') ?></option>
+                       <option value="feed_dates"><?php echo __('Newest first') ?></option>
                </select>
 
                <!-- deprecated -->