]> git.wh0rd.org Git - tt-rss.git/commitdiff
getFeedUnread: add parent feed id when calculating counts for linked feeds
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 2 Oct 2006 05:02:01 +0000 (06:02 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 2 Oct 2006 05:02:01 +0000 (06:02 +0100)
functions.php

index f6a5164236653f70e100d2b596cd8e1d16e5d2c3..3eaa5925b6913d25b05aabd1eaf574f095e7c18c 100644 (file)
                        $match_part = "marked = true";
                } else if ($n_feed > 0) {
 
-                       $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE parent_feed = '$n_feed'
+                       $result = db_query($link, "SELECT id FROM ttrss_feeds 
+                                       WHERE parent_feed = '$n_feed'
                                        AND hidden = false
                                        AND owner_uid = " . $_SESSION["uid"]);
 
                                while ($line = db_fetch_assoc($result)) {
                                        array_push($linked_feeds, "feed_id = " . $line["id"]);
                                }
+
+                               array_push($linked_feeds, "feed_id = $n_feed");
                                
                                $match_part = implode(" OR ", $linked_feeds);
 
                                $result = db_query($link, "SELECT COUNT(int_id) AS unread 
                                        FROM ttrss_user_entries
-                                       WHERE   unread = true AND ($match_part) AND owner_uid = " . $_SESSION["uid"]);
+                                       WHERE   unread = true AND ($match_part) 
+                                       AND owner_uid = " . $_SESSION["uid"]);
 
                                $unread = 0;