summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-20 09:27:13 +0100
committerAndrew Dolgov <[email protected]>2009-01-20 09:27:13 +0100
commit467ff402100df1b90c9abf443e3e7cf8041bbaae (patch)
treecd7bcff4a3c3dda2794fb570202ea1f516161555 /functions.php
parentddb0a9a80a550019612c4b8ae1dac525c7a7c375 (diff)
tmp fix for label counters calculation being wrong when hidden feeds are present (2)
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php13
1 files changed, 3 insertions, 10 deletions
diff --git a/functions.php b/functions.php
index 428d628d9..f11b91b7d 100644
--- a/functions.php
+++ b/functions.php
@@ -2644,22 +2644,15 @@
$owner_uid = $_SESSION["uid"];
- $result = db_query($link,
- "SELECT ttrss_labels2.id, caption, COUNT(unread) AS unread FROM ttrss_labels2
- LEFT JOIN ttrss_user_labels2 ON (label_id = ttrss_labels2.id)
- LEFT JOIN ttrss_user_entries ON (ref_id = article_id AND
- unread = true AND
- ttrss_user_entries.owner_uid = '$owner_uid')
- LEFT JOIN ttrss_feeds ON (ttrss_feeds.id = feed_id AND hidden = false)
- WHERE ttrss_labels2.owner_uid = '$owner_uid'
- GROUP BY ttrss_labels2.id, caption");
+ $result = db_query($link, "SELECT id, caption FROM ttrss_labels2
+ WHERE owner_uid = '$owner_uid'");
while ($line = db_fetch_assoc($result)) {
$id = -$line["id"] - 11;
$label_name = $line["caption"];
- $count = $line["unread"];
+ $count = getFeedUnread($link, $id);
if (!$smart_mode || $old_counters[$id] != $count) {
$old_counters[$id] = $count;