]> git.wh0rd.org Git - tt-rss.git/commitdiff
show amount of feeds category holds in category editor
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 15 Jun 2012 06:43:58 +0000 (10:43 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 15 Jun 2012 06:43:58 +0000 (10:43 +0400)
classes/pref_feeds.php

index 6c34c2712269ac7f6db1f7b773eeaf4caf7452fc..da454b48a070aa853cfb5d8ccaaf52dce27b7ee3 100644 (file)
@@ -1192,9 +1192,11 @@ class Pref_Feeds extends Protected_Handler {
 
                print "</div>";
 
-               $result = db_query($this->link, "SELECT title,id FROM ttrss_feed_categories
-                       WHERE owner_uid = ".$_SESSION["uid"]."
-                       ORDER BY title");
+               $result = db_query($this->link, "SELECT c.title, c.id,COUNT(f.*) AS count
+                       FROM ttrss_feed_categories AS c LEFT JOIN ttrss_feeds AS f ON
+                               (f.cat_id = c.id)
+                       WHERE c.owner_uid = ".$_SESSION["uid"]."
+                       GROUP BY c.title, c.id ORDER BY title");
 
                if (db_num_rows($result) != 0) {
 
@@ -1241,6 +1243,8 @@ class Pref_Feeds extends Protected_Handler {
                                        </script>
                                </span>";
 
+                               print "<td align='right' class='insensitive'>";
+                               echo T_sprintf("%d feeds", $line['count']);
                                print "</td></tr>";
 
                                ++$lnum;