]> git.wh0rd.org Git - tt-rss.git/commitdiff
implement _CLASSIC_ADAPTIVE
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 17:33:06 +0000 (21:33 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 25 Mar 2013 17:33:06 +0000 (21:33 +0400)
include/functions.php

index 682ffd2ee8cdc688039926aa7e3e1d6e889727a6..93fa7cc0ea7eafa166d3d35adcb3bc0c5e2573f8 100644 (file)
                                        $view_query_part = " ";
                                } else if ($feed != -1) {
 
-                                       if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
-                                               $a_date_sort_field = "updated";
-                                       } else {
-                                               $a_date_sort_field = "date_entered";
-                                       }
+                                       if (defined('_CLASSIC_ADAPTIVE')) {
+
+                                               $unread = getFeedUnread($link, $feed, $cat_view);
+
+                                               if ($cat_view && $feed > 0 && $include_children)
+                                                       $unread += getCategoryChildrenUnread($link, $feed);
+
+                                               if ($unread > 0)
+                                       $view_query_part = " unread = true AND ";
 
-                                       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 (!$override_order) {
-                                               $override_order = "unread DESC, $a_order_by";
-                                       }
+                                               if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
+                                                       $a_date_sort_field = "updated";
+                                               } else {
+                                                       $a_date_sort_field = "date_entered";
+                                               }
 
-                                       if (!$ignore_vfeed_group && ($is_cat || $feed_id < 0) &&
-                                                       get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) {
+                                               if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
+                                                       $a_order_by = "$a_date_sort_field";
+                                               } else {
+                                                       $a_order_by = "$a_date_sort_field DESC";
+                                               }
 
-                                               $override_order = "ttrss_feeds.title, $override_order";
-                                       }
+                                               if (!$override_order) {
+                                                       $override_order = "unread DESC, $a_order_by";
+                                               }
+
+                                               if (!$ignore_vfeed_group && ($is_cat || $feed_id < 0) &&
+                                                               get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) {
 
+                                                       $override_order = "ttrss_feeds.title, $override_order";
+                                               }
+                                       }
                                }
                        }