]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix getGlobalCounters re hidden feeds
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Aug 2006 12:53:04 +0000 (13:53 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Aug 2006 12:53:04 +0000 (13:53 +0100)
functions.php

index 81da7256cf31284a3e6f24ba954b66c5e13d733b..5a0e75c1818c90d9a50574670495897ef167ccb5 100644 (file)
        /* FIXME this needs reworking */
 
        function getGlobalUnread($link) {
-               $result = db_query($link, "SELECT count(id) as c_id FROM ttrss_entries,ttrss_user_entries
+               $result = db_query($link, "SELECT count(ttrss_entries.id) as c_id FROM ttrss_entries,ttrss_user_entries,ttrss_feeds
                        WHERE unread = true AND 
+                       ttrss_user_entries.feed_id = ttrss_feeds.id AND
                        ttrss_user_entries.ref_id = ttrss_entries.id AND 
-                       owner_uid = " . $_SESSION["uid"]);
+                       hidden = false AND
+                       ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
                $c_id = db_fetch_result($result, 0, "c_id");
                return $c_id;
        }