tweak stats.php

This commit is contained in:
Andrew Dolgov 2007-11-19 10:27:24 +01:00
parent b5dabd1a7f
commit 9c70537005
1 changed files with 27 additions and 2 deletions

View File

@ -47,7 +47,8 @@
$result = db_query($link, "SELECT count(ttrss_entries.id) AS cid, $result = db_query($link, "SELECT count(ttrss_entries.id) AS cid,
login FROM ttrss_entries login FROM ttrss_entries
LEFT JOIN ttrss_user_entries ON (ref_id = ttrss_entries.id) 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>"; print "<h2>Per-user storage</h2>";
@ -60,12 +61,36 @@
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {
print "<tr>"; print "<tr>";
print "<td>" . $line["cid"] . "</td><td>" . $line["login"] . "</td>"; print "<td>" . $line["cid"] . "</td>";
print "<td>" . $line["login"] . "</td>";
print "</tr>"; print "</tr>";
} }
print "</table>"; 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>"; print "<h2>User subscriptions</h2>";
$result = db_query($link, "SELECT title,feed_url,site_url,login, $result = db_query($link, "SELECT title,feed_url,site_url,login,