From d2ca9130948093c04f4f6e0303d8bf981c62e50a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 May 2007 07:14:32 +0100 Subject: [PATCH] pref-feeds: block sorting by last_article when column is not present --- modules/pref-feeds.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 -- 2.39.5