diff options
author | Andrew Dolgov <[email protected]> | 2020-09-22 09:04:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-09-22 09:04:33 +0300 |
commit | 74568df4ff7b7788991636f6fb2ed62012f85c3b (patch) | |
tree | 673bcb01157b38e4b38f8f4c8227012e8a750e18 /plugins/cache_starred_images/init.php | |
parent | d04ac399ff284e9747e3fb55e87d05e0a5b8d85f (diff) |
remove a lot of stuff from global context (functions.php), add a few helper classes instead
Diffstat (limited to 'plugins/cache_starred_images/init.php')
-rwxr-xr-x | plugins/cache_starred_images/init.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index ae369f56e..5fe963e32 100755 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -40,16 +40,16 @@ class Cache_Starred_Images extends Plugin { Debug::log("caching media of starred articles for user " . $this->host->get_owner_uid() . "..."); - $sth = $this->pdo->prepare("SELECT content, ttrss_entries.title, + $sth = $this->pdo->prepare("SELECT content, ttrss_entries.title, ttrss_user_entries.owner_uid, link, site_url, ttrss_entries.id, plugin_data FROM ttrss_entries, ttrss_user_entries LEFT JOIN ttrss_feeds ON (ttrss_user_entries.feed_id = ttrss_feeds.id) WHERE ref_id = ttrss_entries.id AND marked = true AND - site_url != '' AND + site_url != '' AND ttrss_user_entries.owner_uid = ? AND plugin_data NOT LIKE '%starred_cache_images%' - ORDER BY ".sql_random_function()." LIMIT 100"); + ORDER BY ".Db::sql_random_function()." LIMIT 100"); if ($sth->execute([$this->host->get_owner_uid()])) { @@ -139,7 +139,7 @@ class Cache_Starred_Images extends Plugin { if (!$this->cache->exists($local_filename)) { Debug::log("cache_images: downloading: $url to $local_filename", Debug::$LOG_VERBOSE); - $data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]); + $data = UrlHelper::fetch(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]); if ($data) return $this->cache->put($local_filename, $data);; |