remove cache_content remnants

This commit is contained in:
Andrew Dolgov 2013-03-16 16:11:58 +04:00
parent cc38c8e549
commit 8349a32e75
4 changed files with 2 additions and 40 deletions

View File

@ -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'] .= "<span id=\"CWRAP-$id\">";
$reply['content'] .= $line["content"];
$reply['content'] .= "</span>";

View File

@ -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;

View File

@ -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,

View File

@ -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'));