summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-11-26 14:48:22 +0400
committerAndrew Dolgov <[email protected]>2012-11-26 14:48:22 +0400
commit130b07810989fd32ffed47e543981d7f8ca52162 (patch)
treeeb3034acd36c6cc42b571b4053be81f3dcf346e7 /include
parentdd8c289b8fd3733924f94c061f32f310f09fea15 (diff)
minor cached content updating tweaks
Diffstat (limited to 'include')
-rw-r--r--include/rssfuncs.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index be7e19edc..c273cc3c4 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -816,7 +816,6 @@
$entry_cached_content = cache_images($entry_cached_content, $site_url, $debug_enabled);
$entry_cached_content = db_escape_string($entry_cached_content, false);
-
}
// base post entry does not exist, create it
@@ -873,7 +872,7 @@
id,content_hash,no_orig_date,title,
".SUBSTRING_FOR_DATE."(date_updated,1,19) as date_updated,
".SUBSTRING_FOR_DATE."(updated,1,19) as updated,
- num_comments
+ num_comments, cached_content
FROM
ttrss_entries
WHERE guid = '$entry_guid'");
@@ -891,6 +890,7 @@
$orig_content_hash = db_fetch_result($result, 0, "content_hash");
$orig_title = db_fetch_result($result, 0, "title");
$orig_num_comments = db_fetch_result($result, 0, "num_comments");
+ $orig_cached_content = trim(db_fetch_result($result, 0, "cached_content"));
$orig_date_updated = strtotime(db_fetch_result($result,
0, "date_updated"));
@@ -1026,6 +1026,7 @@
$post_needs_update = false;
$update_insignificant = false;
+ $cached_content_needs_update = false;
if ($orig_num_comments != $num_comments) {
$post_needs_update = true;
@@ -1035,19 +1036,27 @@
if ($content_hash != $orig_content_hash) {
$post_needs_update = true;
$update_insignificant = false;
+ $cached_content_needs_update = true;
+ }
- if ($cache_content) {
- if ($debug_enabled) {
- _debug("update_rss_feed: caching content because original checksum changed...");
- }
+ if ($cache_content) {
+ if ($debug_enabled) {
+ _debug("update_rss_feed: caching content because original checksum changed...");
+ }
- $entry_cached_content = cache_content($link, $entry_link, $auth_login, $auth_pass);
+ $entry_cached_content = cache_content($link, $entry_link, $auth_login, $auth_pass);
+ if ($entry_cached_content) {
if ($cache_images && is_writable(CACHE_DIR . '/images'))
$entry_cached_content = cache_images($entry_cached_content, $site_url, $debug_enabled);
$entry_cached_content = db_escape_string($entry_cached_content, false);
+ $post_needs_update = true;
+ } else {
+ $entry_cached_content = db_escape_string($orig_cached_content);
}
+ } else {
+ $entry_cached_content = db_escape_string($orig_cached_content);
}
if (db_escape_string($orig_title) != $entry_title) {