summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-13 11:32:55 +0100
committerAndrew Dolgov <[email protected]>2005-12-13 11:32:55 +0100
commit7160700cbf738093201b8015de8e8e58451a8aa1 (patch)
tree04d556e79d18543f8d28c1275a5a97c8adaf96d0 /backend.php
parent0813387b1adfbbc52885fe61b6c5df5f60d6c366 (diff)
fix getCategoryCounters() for categories with no unread messages
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend.php b/backend.php
index 7df13c0ae..a4d604179 100644
--- a/backend.php
+++ b/backend.php
@@ -68,7 +68,10 @@
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");
+ AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id
+ UNION
+ SELECT 0,cat_id FROM ttrss_feeds
+ WHERE ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id");
while ($line = db_fetch_assoc($result)) {
$line["cat_id"] = sprintf("%d", $line["cat_id"]);