session_start();
require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "db-prefs.php";
require_once "functions.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
login_sequence($link);
if ($_SESSION["access_level"] < 10) {
header("Location: error.php?c=8");
exit;
}
?>
Tiny Tiny Statistics
Tiny Tiny Statistics
Counters
$result = db_query($link, "SELECT count(id) AS cid,
SUM(LENGTH(content)) AS size
FROM ttrss_entries");
$total_articles = db_fetch_result($result, 0, "cid");
$articles_size = round(db_fetch_result($result, 0, "size") / 1024);
print "Total articles stored: $total_articles (${articles_size}K)
";
$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 "
Articles |
Owner |
";
while ($line = db_fetch_assoc($result)) {
print "";
print "" . $line["cid"] . " | " . $line["login"] . " | ";
print "
";
}
print "
";
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 "
Site |
Feed |
Owner |
Stored Articles |
Unread Articles |
";
$cur_login = "";
while ($line = db_fetch_assoc($result)) {
print "";
print "".$line["title"]." | ";
print "".$line["feed_url"]." | ";
print "" . $line["login"] . " | ";
print "" . $line["num_articles"] . " | ";
print "" . $line["num_articles_unread"] . " | ";
print "
";
if ($cur_login != $line["login"] && $cur_login != "") {
print " |
";
$cur_login = $line["login"];
}
}
print "
";
?>