]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix adaptive behaviour for linked feeds
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 25 Jul 2006 05:02:42 +0000 (06:02 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 25 Jul 2006 05:02:42 +0000 (06:02 +0100)
functions.php

index 9bd505d5b7a642676226329734941779630b112e..ea1cb71102ff8abe92d144550b4d8f3a4dcd6347 100644 (file)
                $n_feed = sprintf("%d", $feed);
 
                if ($is_cat) {
-                       return getCategoryUnread($link, $feed);
+                       return getCategoryUnread($link, $n_feed);               
                } else if ($n_feed == -1) {
                        $match_part = "marked = true";
                } else if ($feed > 0) {
-                       $match_part = "feed_id = '$n_feed'";
+
+                       $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE parent_feed = '$n_feed'");
+
+                       if (db_num_rows($result) > 0) {
+                               $linked_feeds = array();
+                               while ($line = db_fetch_assoc($result)) {
+                                       array_push($linked_feeds, "feed_id = " . $line["id"]);
+                               }
+                               
+                               $match_part = implode(" OR ", $linked_feeds);
+
+                       } else {
+                               $match_part = "feed_id = '$n_feed'";
+                       }
                } else if ($feed < -10) {
                        $label_id = -$feed - 11;