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 @@ + + 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; + } +?> + + +
+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 "Articles | +Owner | +
" . $line["cid"] . " | " . $line["login"] . " | "; + print "
Site | +Feed | +Owner | +Stored Articles | +Unread Articles | +
".$line["title"]." | "; + print "".$line["feed_url"]." | "; + print "" . $line["login"] . " | "; + print "" . $line["num_articles"] . " | "; + print "" . $line["num_articles_unread"] . " | "; + print "