From a62812a6b4a0d5dd24d0046e894f93322becb52d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 15 Jun 2012 10:43:58 +0400 Subject: [PATCH] show amount of feeds category holds in category editor --- classes/pref_feeds.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/classes/pref_feeds.php b/classes/pref_feeds.php index 6c34c2712..da454b48a 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;