]> git.wh0rd.org Git - tt-rss.git/commitdiff
tmp fix for label counters calculation being wrong when hidden feeds are present
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Jan 2009 08:21:05 +0000 (09:21 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Jan 2009 08:21:05 +0000 (09:21 +0100)
functions.php

index 428d628d9fcd9881acda6edc35ffd9f510080bb7..f11b91b7d7bbc140a743ef0bfd5c02d5dda83b04 100644 (file)
 
                        $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;