]> git.wh0rd.org Git - tt-rss.git/commitdiff
implement feedbrowser using linked feeds; set proper fetch timeout
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Apr 2011 11:36:46 +0000 (15:36 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Apr 2011 11:36:46 +0000 (15:36 +0400)
functions.php
modules/pref-feeds.php

index e0c2a664bebb08811ac72e737f0b1dd12a0d8aec..4980140c1af59e017f8bca3929c525329a434ad5 100644 (file)
                        $instance_qpart = "";
 
                if (DB_TYPE == "pgsql") {
-                       $date_qpart = "last_connected < NOW() - INTERVAL '1 second'";
+                       $date_qpart = "last_connected < NOW() - INTERVAL '6 hours'";
                } else {
                        $date_qpart = "last_connected < DATE_SUB(NOW(), INTERVAL 6 HOUR";
                }
index f496c782f278cbf154447cf24a918a93d35edbea..238ca0a857bc73edce6151375e8f7730a93ccbc1 100644 (file)
                        }
 
                        if ($mode == 1) {
-                               $result = db_query($link, "SELECT feed_url, subscribers FROM
+                               /* $result = db_query($link, "SELECT feed_url, subscribers FROM
                                        ttrss_feedbrowser_cache WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
                                        WHERE tf.feed_url = ttrss_feedbrowser_cache.feed_url
                                        AND owner_uid = '$owner_uid') $search_qpart
-                                       ORDER BY subscribers DESC LIMIT $limit");
+                                       ORDER BY subscribers DESC LIMIT $limit"); */
+
+                               $result = db_query($link, "SELECT feed_url, title, SUM(subscribers) AS subscribers FROM
+                                       (SELECT feed_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL
+                                               SELECT feed_url, title, subscribers FROM ttrss_linked_feeds) AS qqq
+                                       WHERE
+                                               (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
+                                                       WHERE tf.feed_url = qqq.feed_url
+                                                               AND owner_uid = '$owner_uid') $search_qpart
+                                       GROUP BY feed_url, title ORDER BY subscribers DESC LIMIT $limit");
+
                        } else if ($mode == 2) {
                                $result = db_query($link, "SELECT *,
                                        (SELECT COUNT(*) FROM ttrss_user_entries WHERE