]> git.wh0rd.org Git - tt-rss.git/commitdiff
feed browser: prefer updated feeds when possible
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 5 Feb 2008 07:42:00 +0000 (08:42 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 5 Feb 2008 07:42:00 +0000 (08:42 +0100)
modules/pref-feed-browser.php

index 6e4abce3652462e21571536b7a7a939b4572c0cc..034d51202a688a9cf0b2170f823e05022b624cd9 100644 (file)
                while ($line = db_fetch_assoc($result)) {
                        $feed_url = $line["feed_url"];
                        $subscribers = $line["subscribers"];
-               
+
+                       // mysql returns NULL records first by default
+                       if (DB_TYPE == "mysql") $order_fix = "DESC";
+
                        $det_result = db_query($link, "SELECT site_url,title,id 
-                               FROM ttrss_feeds WHERE feed_url = '$feed_url' LIMIT 1");
+                               FROM ttrss_feeds WHERE feed_url = '$feed_url' 
+                               ORDER BY last_updated $order_fix LIMIT 1");
 
                        $details = db_fetch_assoc($det_result);