diff --git a/backend.php b/backend.php index e8e4f992c..f7c4e0d4e 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 "