]> git.wh0rd.org Git - tt-rss.git/commitdiff
add hidden tunable _DISABLE_INACTIVE_FEEDS
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 22 May 2014 08:10:24 +0000 (08:10 +0000)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 22 May 2014 08:10:24 +0000 (08:10 +0000)
classes/pref/feeds.php

index 7d541ded183d2185746139c963edd765bc2c6dd8..6021978b76200bda19103452c3e758e524d441c1 100644 (file)
@@ -1259,13 +1259,18 @@ class Pref_Feeds extends Handler_Protected {
                        $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)";
                }
 
-               $result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE
+               // could be performance-intensive and prevent feeds pref-panel from showing
+               if (!defined('_DISABLE_INACTIVE_FEEDS') || !_DISABLE_INACTIVE_FEEDS) {
+                       $result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE
                                        (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
                                                ttrss_entries.id = ref_id AND
                                                        ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart AND
                        ttrss_feeds.owner_uid = ".$_SESSION["uid"]);
 
-               $num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive");
+                       $num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive");
+               } else {
+                       $num_inactive = 0;
+               }
 
                if ($num_inactive > 0) {
                        $inactive_button = "<button dojoType=\"dijit.form.Button\"