]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix getCategoryCounters() for categories with no unread messages
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 13 Dec 2005 10:32:55 +0000 (11:32 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 13 Dec 2005 10:32:55 +0000 (11:32 +0100)
backend.php

index 7df13c0aeb057cff283328d40e5b7d3ee0a555ea..a4d604179db068d83c9ba677be7282effa49b37c 100644 (file)
        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"]);