diff options
author | Andrew Dolgov <[email protected]> | 2005-08-22 06:58:37 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-08-22 06:58:37 +0100 |
commit | 76798ff3f24b7c7b69bd12109228f769ceb650a6 (patch) | |
tree | bcb7763bf9367cf3f3e0cd260607827636e9faa8 /functions.php | |
parent | 0e091d38cf6419edf5e623a584dc28a404fc2613 (diff) |
early title work
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/functions.php b/functions.php index 3da349f1d..cbaefa503 100644 --- a/functions.php +++ b/functions.php @@ -8,8 +8,10 @@ EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) > " . MIN_UPDATE_TIME); + $num_unread = 0; + while ($line = pg_fetch_assoc($result)) { - update_rss_feed($link, $line["feed_url"], $line["id"]); + $num_unread += update_rss_feed($link, $line["feed_url"], $line["id"]); } } @@ -17,6 +19,8 @@ function update_rss_feed($link, $feed_url, $feed) { $rss = fetch_rss($feed_url); + + $num_unread = 0; if ($rss) { @@ -80,7 +84,9 @@ '$entry_timestamp', '$entry_content', '$feed', '$content_md5')"; - pg_query($link, $query); + $result = pg_query($link, $query); + + if ($result) ++$num_unread; } else { @@ -110,15 +116,15 @@ $result = pg_query($link, $query); - -// print "$entry_guid - $entry_timestamp - $entry_title - -// $entry_link - $entry_id<br>"; + if ($result) ++$num_unread; } } - $result = pg_query($link, "UPDATE ttrss_feeds SET last_updated = NOW()"); + if ($result) { + $result = pg_query($link, "UPDATE ttrss_feeds SET last_updated = NOW()"); + } } |