From 8349a32e751e009ba368b4dc6bc900b08b2954d3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 16 Mar 2013 16:11:58 +0400 Subject: [PATCH] remove cache_content remnants --- classes/feeds.php | 10 ++-------- classes/pref/feeds.php | 7 ------- include/functions.php | 4 ---- include/rssfuncs.php | 21 --------------------- 4 files changed, 2 insertions(+), 40 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index dd9a4f58..62142b47 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -165,15 +165,14 @@ class Feeds extends Handler_Protected { // Update the feed if required with some basic flood control $result = db_query($this->link, - "SELECT cache_images,cache_content,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated + "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")); - $cache_content = sql_bool_to_bool(db_fetch_result($result, 0, "cache_content")); - if (!$cache_images && !$cache_content && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) { + if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) { include "rssfuncs.php"; update_rss_feed($this->link, $feed, true, true); } else { @@ -224,7 +223,6 @@ class Feeds extends Handler_Protected { $feed_title = $qfh_ret[1]; $feed_site_url = $qfh_ret[2]; $last_error = $qfh_ret[3]; - $cache_content = true; $vgroup_last_feed = $vgr_last_feed; @@ -618,10 +616,6 @@ class Feeds extends Handler_Protected { $feed_site_url = $line["site_url"]; - if ($cache_content && $line["cached_content"] != "") { - $line["content_preview"] =& $line["cached_content"]; - } - $reply['content'] .= ""; $reply['content'] .= $line["content"]; $reply['content'] .= ""; diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 2ed7b1b2..bfcc75f0 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -856,8 +856,6 @@ class Pref_Feeds extends Handler_Protected { db_escape_string($_POST["include_in_digest"])); $cache_images = checkbox_to_sql_bool( db_escape_string($_POST["cache_images"])); - $cache_content = checkbox_to_sql_bool( - db_escape_string($_POST["cache_content"])); $always_display_enclosures = checkbox_to_sql_bool( db_escape_string($_POST["always_display_enclosures"])); @@ -889,7 +887,6 @@ class Pref_Feeds extends Handler_Protected { auth_pass = '$auth_pass', private = $private, cache_images = $cache_images, - cache_content = $cache_content, include_in_digest = $include_in_digest, always_display_enclosures = $always_display_enclosures, mark_unread_on_update = $mark_unread_on_update @@ -955,10 +952,6 @@ class Pref_Feeds extends Handler_Protected { $qpart = "cache_images = $cache_images"; break; - case "cache_content": - $qpart = "cache_content = $cache_content"; - break; - case "cat_id": $qpart = $category_qpart_nocomma; break; diff --git a/include/functions.php b/include/functions.php index dd40b952..f17828d1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3034,10 +3034,6 @@ } } - if ($cache_content && $line["cached_content"] != "") { - $line["content"] =& $line["cached_content"]; - } - $rv['content'] .= $line["content"]; $rv['content'] .= format_article_enclosures($link, $id, diff --git a/include/rssfuncs.php b/include/rssfuncs.php index feffe001..156be0b1 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -1268,27 +1268,6 @@ } } - function cache_content($link, $url, $login, $pass) { - - $content = fetch_file_contents($url, $login, $pass); - - if ($content) { - $doc = new DOMDocument(); - @$doc->loadHTML($content); - $xpath = new DOMXPath($doc); - - $node = $doc->getElementsByTagName('body')->item(0); - - if ($node) { - $content = $doc->saveXML($node); - - return $content; - } - } - - return ""; - } - function make_guid_from_title($title) { return preg_replace("/[ \"\',.:;]/", "-", mb_strtolower(strip_tags($title), 'utf-8')); -- 2.39.5