diff options
author | Andrew Dolgov <[email protected]> | 2007-11-19 10:27:24 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-11-19 10:27:24 +0100 |
commit | 9c705370053c0ab4664b815c9e67f9c6794ac5c0 (patch) | |
tree | b69bb7c90ec7a1fbc886972074ebef534c6e7f7c /utils | |
parent | b5dabd1a7fc8a214f768c1901a7dc1daf39bac11 (diff) |
tweak stats.php
Diffstat (limited to 'utils')
-rw-r--r-- | utils/stats.php | 29 |
1 files 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 "<h2>Per-user storage</h2>"; @@ -60,12 +61,36 @@ while ($line = db_fetch_assoc($result)) { print "<tr>"; - print "<td>" . $line["cid"] . "</td><td>" . $line["login"] . "</td>"; + print "<td>" . $line["cid"] . "</td>"; + print "<td>" . $line["login"] . "</td>"; print "</tr>"; } print "</table>"; + $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 "<h2>Per-user subscriptions</h2>"; + + print "<table border width='100%'>"; + + print "<tr> + <td>Owner</td> + <td>Feeds</td> + </tr>"; + + while ($line = db_fetch_assoc($result)) { + print "<tr>"; + print "<td>" . $line["login"] . "</td>"; + print "<td>" . $line["fc"] . "</td>"; + print "</tr>"; + } + + print "</table>"; + print "<h2>User subscriptions</h2>"; $result = db_query($link, "SELECT title,feed_url,site_url,login, |