From 1696229f9df3a65e06246ea9e5b1ee1424f4c02a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 12 Oct 2005 11:54:09 +0100 Subject: fixed serious bug in MySQL schema (cascade deletes were unfunctional), add yet another content: subtype workaround --- functions.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 80cd61913..0c0fc047f 100644 --- a/functions.php +++ b/functions.php @@ -27,9 +27,9 @@ $result = db_query($link, "SELECT feed_url,id,last_updated FROM ttrss_feeds"); while ($line = db_fetch_assoc($result)) { - if (!$line["last_updated"] || time() - strtotime($line["last_updated"]) > 1800) { +// if (!$line["last_updated"] || time() - strtotime($line["last_updated"]) > 1800) { update_rss_feed($link, $line["feed_url"], $line["id"]); - } +// } } purge_old_posts($link); @@ -158,17 +158,23 @@ if (!$entry_title) continue; if (!$entry_link) continue; - $entry_content = $item["description"]; - if (!$entry_content) $entry_content = $item["content:escaped"]; + $entry_content = $item["content:escaped"]; + + if (!$entry_content) $entry_content = $item["content:encoded"]; if (!$entry_content) $entry_content = $item["content"]; + if (!$entry_content) $entry_content = $item["description"]; // if (!$entry_content) continue; // WTF if (is_array($entry_content)) { $entry_content = $entry_content["encoded"]; + if (!$entry_content) $entry_content = $entry_content["escaped"]; } +// print_r($item); +// print_r($entry_content); + $content_hash = "SHA1:" . sha1(strip_tags($entry_content)); $entry_comments = $item["comments"]; @@ -188,6 +194,8 @@ WHERE guid = '$entry_guid'"); +// print db_num_rows($result) . "$entry_guid
"; + if (db_num_rows($result) == 0) { error_reporting(0); -- cgit v1.2.3-54-g00ecf