From: Andrew Dolgov Date: Thu, 22 May 2014 08:10:24 +0000 (+0000) Subject: add hidden tunable _DISABLE_INACTIVE_FEEDS X-Git-Tag: 1.13~30 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=34899cf9e87303a5d35d8979b8d790c7a45ea13d;p=tt-rss.git add hidden tunable _DISABLE_INACTIVE_FEEDS --- diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 7d541ded..6021978b 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -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 = "