]> git.wh0rd.org Git - tt-rss.git/commitdiff
use getCategoryUnread in outputFeedList, misc fixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Aug 2006 13:19:24 +0000 (14:19 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Aug 2006 13:19:24 +0000 (14:19 +0100)
backend.php
mobile/functions.php

index 428939fe98bed46e16d5132cdaf3ef82a765d78c..583ab658fa92250ab5f6749ab9d118c7241b8e19 100644 (file)
                                                $ellipsis = "";
                                        }
 
-                                       if ($cat_id) {
-                                               $cat_id_qpart = "cat_id = '$cat_id'";
-                                       } else {
-                                               $cat_id_qpart = "cat_id IS NULL";
-                                       }
-
-                                       $tmp_result = db_query($link, "SELECT count(int_id) AS unread
-                                               FROM ttrss_user_entries,ttrss_feeds WHERE
-                                                       unread = true AND
-                                                       feed_id = ttrss_feeds.id AND $cat_id_qpart AND
-                                                       ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
-
-                                       $cat_unread = db_fetch_result($tmp_result, 0, "unread");
-
                                        $cat_id = sprintf("%d", $cat_id);
+
+                                       $cat_unread = getCategoryUnread($link, $cat_id);
                                        
                                        print "<li class=\"feedCat\" id=\"FCAT-$cat_id\">
                                                <a id=\"FCATN-$cat_id\" href=\"javascript:toggleCollapseCat($cat_id)\">$tmp_category</a>
index d35e6e23704c37f150be292953c5a567ca2ad5b2..398a12a5531e40ed3bb45fad2491498e4a69db53 100644 (file)
                                                $cat_id_qpart = "cat_id IS NULL";
                                        }
 
-                                       $tmp_result = db_query($link, "SELECT count(int_id) AS unread
-                                               FROM ttrss_user_entries,ttrss_feeds WHERE
-                                                       unread = true AND
-                                                       feed_id = ttrss_feeds.id AND $cat_id_qpart AND
-                                                       ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
-
-                                       $cat_unread = db_fetch_result($tmp_result, 0, "unread");
-
                                        $cat_id = sprintf("%d", $cat_id);
-                                       
+                                       $cat_unread = getCategoryUnread($link, $cat_id);
+
                                        print "<li class=\"feedCat\">
                                                <a href=\"?subop=tc&id=$cat_id\">$tmp_category</a>
                                                        <a href=\"?go=vf&id=$cat_id&cat=true\">