From 81f8401db744830ca78f6aa7a54e11de79bcf1e9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Feb 2006 11:45:47 +0100 Subject: [PATCH] statistics stub --- error.php | 1 + stats.php | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 stats.php diff --git a/error.php b/error.php index 2dd8e133e..cc57b64db 100644 --- a/error.php +++ b/error.php @@ -28,6 +28,7 @@ $ERRORS[8] = "Could not display feed: query failed. Please check label match syntax or local configuration."; + $ERRORS[8] = "Denied. Your access level is insufficient to access this page."; ?> diff --git a/stats.php b/stats.php new file mode 100644 index 000000000..65723ff2e --- /dev/null +++ b/stats.php @@ -0,0 +1,102 @@ + + + + + Tiny Tiny Statistics + + + + +

Tiny Tiny Statistics

+ +

Counters

+ +Total articles stored: $total_articles

"; + + $result = db_query($link, "SELECT COUNT(int_id) as cid,owner_uid,login + FROM ttrss_user_entries + JOIN ttrss_users ON (owner_uid = ttrss_users.id) + GROUP BY owner_uid,login ORDER BY cid DESC"); + + print "

Per-user storage

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

User subscriptions

"; + + $result = db_query($link, "SELECT title,feed_url,site_url,login, + (SELECT count(int_id) FROM ttrss_user_entries + WHERE feed_id = ttrss_feeds.id) AS num_articles, + (SELECT count(int_id) FROM ttrss_user_entries + WHERE feed_id = ttrss_feeds.id AND unread = true) AS num_articles_unread + FROM ttrss_feeds,ttrss_users + WHERE owner_uid = ttrss_users.id ORDER BY login"); + + print ""; + print " + + + + + + "; + + $cur_login = ""; + + while ($line = db_fetch_assoc($result)) { + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + + if ($cur_login != $line["login"] && $cur_login != "") { + print ""; + $cur_login = $line["login"]; + } + } + + print "
SiteFeedOwnerStored ArticlesUnread Articles
".$line["title"]."".$line["feed_url"]."" . $line["login"] . "" . $line["num_articles"] . "" . $line["num_articles_unread"] . "
 
"; + +?> + + + +