From: Andrew Dolgov Date: Fri, 15 Jun 2012 06:43:58 +0000 (+0400) Subject: show amount of feeds category holds in category editor X-Git-Tag: 1.6.0~212 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a62812a6b4a0d5dd24d0046e894f93322becb52d;p=tt-rss.git show amount of feeds category holds in category editor --- diff --git a/classes/pref_feeds.php b/classes/pref_feeds.php index 6c34c271..da454b48 100644 --- a/classes/pref_feeds.php +++ b/classes/pref_feeds.php @@ -1192,9 +1192,11 @@ class Pref_Feeds extends Protected_Handler { print ""; - $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 { "; + print ""; + echo T_sprintf("%d feeds", $line['count']); print ""; ++$lnum;