]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix queryFeedHeadlines, rename getCategoryUnreadRecursive
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 13 Aug 2012 17:02:52 +0000 (21:02 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 13 Aug 2012 17:02:52 +0000 (21:02 +0400)
include/functions.php

index 0e2424c5811b3e004e5b68a0ea1b50a984ea765d..1116e422c7958978b2ba74f7d548c6435f6060b7 100644 (file)
                        $line["cat_id"] = (int) $line["cat_id"];
 
                        if ($line["num_children"] > 0) {
-                               $child_counter = getCategoryUnreadRecursive($link, $line["cat_id"], $_SESSION["uid"]);
+                               $child_counter = getCategoryChildrenUnread($link, $line["cat_id"], $_SESSION["uid"]);
                        } else {
                                $child_counter = 0;
                        }
        }
 
        // only accepts real cats (>= 0)
-       function getCategoryUnreadRecursive($link, $cat, $owner_uid = false) {
+       function getCategoryChildrenUnread($link, $cat, $owner_uid = false) {
                if (!$owner_uid) $owner_uid = $_SESSION["uid"];
 
                $result = db_query($link, "SELECT id FROM ttrss_feed_categories WHERE parent_cat = '$cat'
 
                while ($line = db_fetch_assoc($result)) {
                        $unread += getCategoryUnread($link, $line["id"], $owner_uid);
-                       $unread += getCategoryUnreadRecursive($link, $line["id"], $owner_uid);
+                       $unread += getCategoryChildrenUnread($link, $line["id"], $owner_uid);
                }
 
                return $unread;
                                        $unread = getFeedUnread($link, $feed, $cat_view);
 
                                        if ($cat_view && $feed > 0)
-                                               $unread = getCategoryUnreadRecursive($link, $feed);
+                                               $unread += getCategoryChildrenUnread($link, $feed);
 
                                        if ($unread > 0) {
                                                $view_query_part = " unread = true AND ";