From: Andrew Dolgov Date: Fri, 18 May 2007 06:14:32 +0000 (+0100) Subject: pref-feeds: block sorting by last_article when column is not present X-Git-Tag: schema_freeze_for_1.2.11~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d2ca9130948093c04f4f6e0303d8bf981c62e50a;p=tt-rss.git pref-feeds: block sorting by last_article when column is not present --- diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 3f5e2f61..4594326b 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -793,12 +793,6 @@ $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 = ""; @@ -809,6 +803,14 @@ $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