From 9c705370053c0ab4664b815c9e67f9c6794ac5c0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 19 Nov 2007 10:27:24 +0100 Subject: [PATCH] tweak stats.php --- utils/stats.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/utils/stats.php b/utils/stats.php index 51dcaf59a..b8e6e06df 100644 --- a/utils/stats.php +++ b/utils/stats.php @@ -47,7 +47,8 @@ $result = db_query($link, "SELECT count(ttrss_entries.id) AS cid, login FROM ttrss_entries LEFT JOIN ttrss_user_entries ON (ref_id = ttrss_entries.id) - LEFT JOIN ttrss_users ON (ttrss_users.id = owner_uid) GROUP BY login"); + LEFT JOIN ttrss_users ON (ttrss_users.id = ttrss_user_entries.owner_uid) + GROUP BY login"); print "

Per-user storage

"; @@ -60,12 +61,36 @@ while ($line = db_fetch_assoc($result)) { print ""; - print "" . $line["cid"] . "" . $line["login"] . ""; + print "" . $line["cid"] . ""; + print "" . $line["login"] . ""; print ""; } print ""; + $result = db_query($link, "SELECT COUNT(ttrss_feeds.id) AS fc, + login FROM ttrss_users, ttrss_feeds + WHERE ttrss_users.id = ttrss_feeds.owner_uid + GROUP BY login ORDER BY fc DESC"); + + print "

Per-user subscriptions

"; + + print ""; + + print " + + + "; + + while ($line = db_fetch_assoc($result)) { + print ""; + print ""; + print ""; + print ""; + } + + print "
OwnerFeeds
" . $line["login"] . "" . $line["fc"] . "
"; + print "

User subscriptions

"; $result = db_query($link, "SELECT title,feed_url,site_url,login,