From: Andrew Dolgov Date: Fri, 16 Dec 2005 16:51:39 +0000 (+0100) Subject: return feed update error msg in getFeedCounters() X-Git-Tag: schema_freeze_for_1.1.1~33 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d246bc9965e5ac8067dd0353dbff3c85890ca580;p=tt-rss.git return feed update error msg in getFeedCounters() --- 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 ""; } }