summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-10-01 04:26:06 +0100
committerAndrew Dolgov <[email protected]>2007-10-01 04:26:06 +0100
commit1f3335dcde535ddc0bcfb7fbcae4bf779df0d7bb (patch)
treedff88fb461cb71380efa9961cd26836d5d1c6f1e /functions.php
parentdc85be2b3535237ffb9234a8add4db99a7c90820 (diff)
fix catchup of fresh feed
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/functions.php b/functions.php
index a32358997..45c59d37e 100644
--- a/functions.php
+++ b/functions.php
@@ -1854,15 +1854,25 @@
$intl = get_pref($link, "FRESH_ARTICLE_MAX_AGE");
if (DB_TYPE == "pgsql") {
- $match_part .= " AND date_entered > NOW() - INTERVAL '$intl hour' ";
+ $match_part = "date_entered > NOW() - INTERVAL '$intl hour' ";
} else {
- $match_part .= " AND date_entered > DATE_SUB(NOW(),
+ $match_part = "date_entered > DATE_SUB(NOW(),
INTERVAL $intl HOUR) ";
}
- db_query($link, "UPDATE ttrss_user_entries
- SET unread = false,last_read = NOW()
- WHERE $match_part AND owner_uid = ".$_SESSION["uid"]);
+ $result = db_query($link, "SELECT id FROM ttrss_entries,
+ ttrss_user_entries WHERE $match_part AND
+ unread = true AND
+ ttrss_user_entries.ref_id = ttrss_entries.id AND
+ owner_uid = ".$_SESSION["uid"]);
+
+ $affected_ids = array();
+
+ while ($line = db_fetch_assoc($result)) {
+ array_push($affected_ids, $line["id"]);
+ }
+
+ catchupArticlesById($link, $affected_ids, 0);
}
} else if ($feed < -10) { // label