From d246bc9965e5ac8067dd0353dbff3c85890ca580 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 16 Dec 2005 17:51:39 +0100 Subject: [PATCH] return feed update error msg in getFeedCounters() --- backend.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/backend.php b/backend.php index 50d04e6b..8652a1c4 100644 --- a/backend.php +++ b/backend.php @@ -226,13 +226,16 @@ function getFeedCounter($link, $id) { $result = db_query($link, "SELECT - count(id) as count FROM ttrss_entries,ttrss_user_entries + count(id) as count,last_error + FROM ttrss_entries,ttrss_user_entries,ttrss_feeds WHERE feed_id = '$id' AND unread = true + AND ttrss_user_entries.feed_id = ttrss_feeds.id AND ttrss_user_entries.ref_id = ttrss_entries.id"); $count = db_fetch_result($result, 0, "count"); + $last_error = db_fetch_result($result, 0, "last_error"); - print ""; + print ""; } function getFeedCounters($link, $smart_mode = SMART_RPC_COUNTERS) { @@ -245,10 +248,11 @@ $old_counters = $_SESSION["fctr_last_value"]; - $result = db_query($link, "SELECT id, + $result = db_query($link, "SELECT id,last_error, (SELECT count(id) FROM ttrss_entries,ttrss_user_entries - WHERE feed_id = ttrss_feeds.id AND ttrss_user_entries.ref_id = ttrss_entries.id + WHERE feed_id = ttrss_feeds.id AND + ttrss_user_entries.ref_id = ttrss_entries.id AND unread = true AND owner_uid = ".$_SESSION["uid"].") as count FROM ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]); @@ -258,11 +262,19 @@ $id = $line["id"]; $count = $line["count"]; + $last_error = $line["last_error"]; if (!$smart_mode || $old_counters[$id] != $count) { $old_counters[$id] = $count; $fctrs_modified = true; - print ""; + + if ($last_error) { + $error_part = "error=\"$last_error\""; + } else { + $error_part = ""; + } + + print ""; } } -- 2.39.5