diff options
author | Andrew Dolgov <[email protected]> | 2005-09-07 15:03:30 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-09-07 15:03:30 +0100 |
commit | deaaa02c504a685ea383b203e1432fadd01d1a27 (patch) | |
tree | ceb1bd4e8715e79a57cb00f0c7fb5131f5b27b17 /backend.php | |
parent | 77a1bf8b833c0f3f24b918606e3e8b00a0ebce01 (diff) |
fixed viewfeed/MarkAllRead behaviour
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/backend.php b/backend.php index b4181069f..556c94697 100644 --- a/backend.php +++ b/backend.php @@ -303,19 +303,12 @@ $line = db_fetch_assoc($result); - if ($subop == "ForceUpdate" || - $line["last_updated"] == "" || - $line["update_timeout"] > MIN_UPDATE_TIME) { - - update_rss_feed($link, $line["feed_url"], $feed); + update_rss_feed($link, $line["feed_url"], $feed); - } else { + if ($subop == "MarkAllRead") { - if ($subop == "MarkAllRead") { - - db_query($link, "UPDATE ttrss_entries SET unread = false,last_read = NOW() - WHERE feed_id = '$feed'"); - } + db_query($link, "UPDATE ttrss_entries SET unread = false,last_read = NOW() + WHERE feed_id = '$feed'"); } } @@ -361,15 +354,8 @@ $limit_query_part = "LIMIT " . $limit; } - if (DB_TYPE == "pgsql") { - $extract_epoch_qpart = " - ,EXTRACT(EPOCH FROM last_read) AS last_read_ts, - EXTRACT(EPOCH FROM updated) AS updated_ts"; - } - $result = db_query($link, "SELECT - id,title,updated,unread,feed_id,marked,link - $extract_epoch_qpart + id,title,updated,unread,feed_id,marked,link,last_read FROM ttrss_entries WHERE @@ -389,7 +375,12 @@ $id = $line["id"]; $feed_id = $line["feed_id"]; - if ($line["last_read_ts"] < $line["updated_ts"] && $line["unread"] == "f") { +// printf("%d %s - %d %s<br>", strtotime($line["last_read"]), $line["last_read"], +// strtotime($line["updated"]), $line["updated"]); + + if (strtotime($line["last_read"]) < strtotime($line["updated"]) && + ($line["unread"] == "f" || $line["unread"] == "0")) { + $update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\" alt=\"Updated\">"; ++$num_unread; |