]> git.wh0rd.org Git - tt-rss.git/commitdiff
pref-feeds: block sorting by last_article when column is not present
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 May 2007 06:14:32 +0000 (07:14 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 May 2007 06:14:32 +0000 (07:14 +0100)
modules/pref-feeds.php

index 3f5e2f61f3c75e6f98fcc04e0b5587f049bf79b2..4594326bf37c35cc29035d173b7e8bd887ca803a 100644 (file)
                        $search_qpart = "";
                }
 
-               if (get_pref($link, 'ENABLE_FEED_CATS')) {
-                       $order_by_qpart = "category,$feeds_sort,title";
-               } else {
-                       $order_by_qpart = "$feeds_sort,title";
-               }
-
                $show_last_article_info = false;
                $show_last_article_checked = "";
                $show_last_article_qpart = "";
                        $show_last_article_qpart = ", (SELECT SUBSTRING(MAX(updated),1,16) FROM ttrss_user_entries,
                                ttrss_entries WHERE ref_id = ttrss_entries.id
                                AND feed_id = F1.id) AS last_article";
+               } else if ($feeds_sort == "last_article") {
+                       $feeds_sort = "title";
+               }
+
+               if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                       $order_by_qpart = "category,$feeds_sort,title";
+               } else {
+                       $order_by_qpart = "$feeds_sort,title";
                }
 
                $result = db_query($link, "SELECT