X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Ffeeds.php;h=bef759d369bd0c853ff060ee7dab4257f49cac0c;hb=1ffe3391f902c4baa984982f19e61a0e45de21ff;hp=6ee5bad0b8626606255338c8d8ec6f5e3ae47e7d;hpb=86f7d2a9f2b6468a34b20d7a26c7cfc3afbe00ee;p=tt-rss.git diff --git a/classes/feeds.php b/classes/feeds.php index 6ee5bad0..bef759d3 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -108,14 +108,12 @@ class Feeds extends Handler_Protected { } - global $pluginhost; - - if ($pluginhost->get_plugin("mail")) { + if (PluginHost::getInstance()->get_plugin("mail")) { $reply .= ""; } - if ($pluginhost->get_plugin("mailto")) { + if (PluginHost::getInstance()->get_plugin("mailto")) { $reply .= ""; } @@ -132,7 +130,7 @@ class Feeds extends Handler_Protected { //$reply .= "get_hooks($pluginhost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) { echo $p->hook_headline_toolbar_button($feed_id, $is_cat); } @@ -164,62 +162,60 @@ class Feeds extends Handler_Protected { if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) { // Update the feed if required with some basic flood control - $result = db_query($this->link, + $result = $this->dbh->query( "SELECT cache_images,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated FROM ttrss_feeds WHERE id = '$feed'"); - if (db_num_rows($result) != 0) { - $last_updated = strtotime(db_fetch_result($result, 0, "last_updated")); - $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images")); + if ($this->dbh->num_rows($result) != 0) { + $last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated")); + $cache_images = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "cache_images")); if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) { include "rssfuncs.php"; - update_rss_feed($this->link, $feed, true, true); + update_rss_feed($feed, true, true); } else { - db_query($this->link, "UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01' + $this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01' WHERE id = '$feed'"); } } } if ($method_split[0] == "MarkAllReadGR") { - catchup_feed($this->link, $method_split[1], false); + catchup_feed($method_split[1], false); } // FIXME: might break tag display? if (is_numeric($feed) && $feed > 0 && !$cat_view) { - $result = db_query($this->link, + $result = $this->dbh->query( "SELECT id FROM ttrss_feeds WHERE id = '$feed' LIMIT 1"); - if (db_num_rows($result) == 0) { + if ($this->dbh->num_rows($result) == 0) { $reply['content'] = "