From 0b74db5ad7b3b93cf97b7fa65b467f929f6b232f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 6 Mar 2019 20:02:06 +0300 Subject: remove feedbrowser (other feeds) --- classes/feeds.php | 55 +--------------------------------------------------- classes/rpc.php | 14 ------------- classes/rssutils.php | 50 ----------------------------------------------- 3 files changed, 1 insertion(+), 118 deletions(-) (limited to 'classes') diff --git a/classes/feeds.php b/classes/feeds.php index 5daed696a..f7a6aea7b 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -6,7 +6,7 @@ class Feeds extends Handler_Protected { private $params; function csrf_ignore($method) { - $csrf_ignored = array("index", "feedbrowser", "quickaddfeed", "search"); + $csrf_ignored = array("index", "quickaddfeed", "search"); return array_search($method, $csrf_ignored) !== false; } @@ -707,65 +707,12 @@ class Feeds extends Handler_Protected { print ""; - if (!(defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER)) { - print ""; - } - print ""; print ""; print ""; } - function feedBrowser() { - if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return; - - $browser_search = $_REQUEST["search"]; - - print_hidden("op", "rpc"); - print_hidden("method", "updateFeedBrowser"); - - print "
-
- - - -
"; - - print " "; - - print __("limit:"); - - print " "; - - print "
"; - - require_once "feedbrowser.php"; - - print ""; - - print ""; - - } - function search() { $this->params = explode(":", $_REQUEST["param"], 2); diff --git a/classes/rpc.php b/classes/rpc.php index 76cca6f8e..037e14132 100755 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -347,20 +347,6 @@ class RPC extends Handler_Protected { print ""; } - function updateFeedBrowser() { - if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return; - - $search = clean($_REQUEST["search"]); - $limit = clean($_REQUEST["limit"]); - $mode = (int) clean($_REQUEST["mode"]); - - require_once "feedbrowser.php"; - - print json_encode(array("content" => - make_feed_browser($search, $limit, $mode), - "mode" => $mode)); - } - // Silent function massSubscribe() { diff --git a/classes/rssutils.php b/classes/rssutils.php index 8684a2c5d..36236bafe 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -19,53 +19,6 @@ class RSSUtils { return preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $str); } - static function update_feedbrowser_cache() { - - $pdo = Db::pdo(); - - $sth = $pdo->query("SELECT feed_url, site_url, title, COUNT(id) AS subscribers - FROM ttrss_feeds WHERE feed_url NOT IN (SELECT feed_url FROM ttrss_feeds - WHERE private IS true OR auth_login != '' OR auth_pass != '' OR feed_url LIKE '%:%@%/%') - GROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT 1000"); - - $pdo->beginTransaction(); - - $pdo->query("DELETE FROM ttrss_feedbrowser_cache"); - - $count = 0; - - while ($line = $sth->fetch()) { - - $subscribers = $line["subscribers"]; - $feed_url = $line["feed_url"]; - $title = $line["title"]; - $site_url = $line["site_url"]; - - $tmph = $pdo->prepare("SELECT subscribers FROM - ttrss_feedbrowser_cache WHERE feed_url = ?"); - $tmph->execute([$feed_url]); - - if (!$tmph->fetch()) { - - $tmph = $pdo->prepare("INSERT INTO ttrss_feedbrowser_cache - (feed_url, site_url, title, subscribers) - VALUES - (?, ?, ?, ?)"); - - $tmph->execute([$feed_url, $site_url, $title, $subscribers]); - - ++$count; - - } - - } - - $pdo->commit(); - - return $count; - - } - static function update_daemon_common($limit = DAEMON_FEED_LIMIT) { $schema_version = get_schema_version(); @@ -1542,9 +1495,6 @@ class RSSUtils { RSSUtils::expire_error_log(); RSSUtils::expire_feed_archive(); - $count = RSSUtils::update_feedbrowser_cache(); - Debug::log("Feedbrowser updated, $count feeds processed."); - Article::purge_orphans(); RSSUtils::cleanup_counters_cache(); -- cgit v1.2.3