show amount of feeds category holds in category editor

This commit is contained in:
Andrew Dolgov 2012-06-15 10:43:58 +04:00
parent ca6a0741b4
commit a62812a6b4
1 changed files with 7 additions and 3 deletions

View 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;