summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-22 05:56:40 +0100
committerAndrew Dolgov <[email protected]>2005-08-22 05:56:40 +0100
commit331900c642bbea3f8b7e242975fae4cfec459433 (patch)
tree0274646a70639a2cff5fdec9cfa5ac8c1fb6acbd /functions.php
parent857a92708b77c3d570f4ec97936de6c19900abd6 (diff)
basic functionality pass 10
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index d49c951fc..3da349f1d 100644
--- a/functions.php
+++ b/functions.php
@@ -4,7 +4,7 @@
function update_all_feeds($link) {
$result = pg_query($link, "SELECT feed_url,id FROM ttrss_feeds WHERE
- last_updated is null OR
+ last_updated is null OR title = '' OR
EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) > " .
MIN_UPDATE_TIME);
@@ -19,6 +19,16 @@
$rss = fetch_rss($feed_url);
if ($rss) {
+
+ $result = pg_query("SELECT title FROM ttrss_feeds WHERE id = '$feed'");
+
+ $registered_title = pg_fetch_result($result, 0, "title");
+
+ if (!$registered_title) {
+
+ $feed_title = $rss->channel["title"];
+ pg_query("UPDATE ttrss_feeds SET title = '$feed_title' WHERE id = '$feed'");
+ }
foreach ($rss->items as $item) {
@@ -30,7 +40,9 @@
$entry_timestamp = $item["pubdate"];
if (!$entry_timestamp) $entry_timestamp = $item["modified"];
if (!$entry_timestamp) $entry_timestamp = $item["updated"];
-
+
+ if (!$entry_timestamp) continue;
+
$entry_timestamp = strtotime($entry_timestamp);
if (!$entry_timestamp) continue;