From: Andrew Dolgov Date: Tue, 13 Dec 2005 09:27:41 +0000 (+0100) Subject: display number of unread articles in category X-Git-Tag: schema_freeze_for_1.1.1~51 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=280ee9a3398c8fecd975f22147eb5f8c10552b77;p=tt-rss.git display number of unread articles in category --- diff --git a/backend.php b/backend.php index e8e4f992..f7c4e0d4 100644 --- a/backend.php +++ b/backend.php @@ -60,8 +60,23 @@ getFeedCounters($link); getTagCounters($link); getGlobalCounters($link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); + } } + function getCategoryCounters($link) { + $result = db_query($link, "SELECT COUNT(int_id) AS unread,cat_id + FROM ttrss_user_entries,ttrss_feeds WHERE unread = true AND feed_id = id + AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id"); + + while ($line = db_fetch_assoc($result)) { + $line["cat_id"] = sprintf("%d", $line["cat_id"]); + print ""; + } + } + function getFeedUnread($link, $feed) { $n_feed = sprintf("%d", $feed); @@ -104,7 +119,7 @@ ttrss_user_entries.ref_id = ttrss_entries.id AND owner_uid = " . $_SESSION["uid"]); $c_id = db_fetch_result($result, 0, "c_id"); - print ""; + print ""; } function getTagCounters($link, $smart_mode = SMART_RPC_COUNTERS) { @@ -142,7 +157,7 @@ if (!$smart_mode || $old_counters[$tag] != $unread) { $old_counters[$tag] = $unread; $tctrs_modified = true; - print ""; + print ""; } } @@ -170,7 +185,7 @@ $count = db_fetch_result($result, 0, "count"); - print "