1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-06 15:19:15 +00:00

fix getCategoryCounters() for categories with no unread messages

This commit is contained in:
Andrew Dolgov
2005-12-13 11:32:55 +01:00
parent 0813387b1a
commit 7160700cbf

View File

@@ -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"]);