1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 21:31:29 +00:00

implement ttrss_feeds.cache_content

This commit is contained in:
Andrew Dolgov
2012-11-23 13:22:34 +04:00
parent 7b28a98697
commit 87764a50cf
10 changed files with 142 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
<?php
define('EXPECTED_CONFIG_VERSION', 26);
define('SCHEMA_VERSION', 98);
define('SCHEMA_VERSION', 99);
$fetch_last_error = false;
@@ -2367,7 +2367,7 @@
}
}
$content_query_part = "content as content_preview,";
$content_query_part = "content as content_preview, cached_content, ";
if (is_numeric($feed)) {
@@ -3111,15 +3111,17 @@
//if (!$zoom_mode) { print "<article id='$id'><![CDATA["; };
$result = db_query($link, "SELECT rtl_content, always_display_enclosures FROM ttrss_feeds
$result = db_query($link, "SELECT rtl_content, always_display_enclosures, cache_content FROM ttrss_feeds
WHERE id = '$feed_id' AND owner_uid = $owner_uid");
if (db_num_rows($result) == 1) {
$rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
$always_display_enclosures = sql_bool_to_bool(db_fetch_result($result, 0, "always_display_enclosures"));
$cache_content = sql_bool_to_bool(db_fetch_result($result, 0, "cache_content"));
} else {
$rtl_content = false;
$always_display_enclosures = false;
$cache_content = false;
}
if ($rtl_content) {
@@ -3146,7 +3148,8 @@
tag_cache,
author,
orig_feed_id,
note
note,
cached_content
FROM ttrss_entries,ttrss_user_entries
WHERE id = '$id' AND ref_id = id AND owner_uid = $owner_uid");
@@ -3344,6 +3347,10 @@
}
}
if ($cache_content && $line["cached_content"] != "") {
$line["content"] =& $line["cached_content"];
}
$article_content = sanitize($link, $line["content"], false, $owner_uid,
$feed_site_url);
@@ -4460,6 +4467,11 @@
}
if ($show_content) {
if ($line["cached_content"] != "") {
$line["content_preview"] =& $line["cached_content"];
}
if ($sanitize_content) {
$headline_row["content"] = sanitize($link,
$line["content_preview"], false, false, $line["site_url"]);