summaryrefslogtreecommitdiffstats
path: root/web/lib/stats.inc
diff options
context:
space:
mode:
authorelij <elij.mx@gmail.com>2011-05-29 23:33:37 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-06-22 15:15:04 +0200
commit888db089c515270fd5cd9a9bedd217110f43bc4c (patch)
treee31d78b517c5b849a91c56883dcff179fd3c3164 /web/lib/stats.inc
parent023d2a2521306be2c68f7cf1514bfc50bb250c04 (diff)
downloadaur-888db089c515270fd5cd9a9bedd217110f43bc4c.tar.gz
aur-888db089c515270fd5cd9a9bedd217110f43bc4c.tar.xz
rename *.inc files to *.inc.php and adjust imports and references
Lukas: Add note to "UPGRADING". Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/stats.inc')
-rw-r--r--web/lib/stats.inc71
1 files changed, 0 insertions, 71 deletions
diff --git a/web/lib/stats.inc b/web/lib/stats.inc
deleted file mode 100644
index 67fbdca9..00000000
--- a/web/lib/stats.inc
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-include_once('aur.inc');
-
-function updates_table($dbh)
-{
- $key = 'recent_updates';
- if(!($newest_packages = get_cache_value($key))) {
- $q = 'SELECT * FROM Packages ORDER BY ModifiedTS DESC LIMIT 10';
- $result = db_query($q, $dbh);
-
- $newest_packages = new ArrayObject();
- while ($row = mysql_fetch_assoc($result)) {
- $newest_packages->append($row);
- }
- set_cache_value($key, $newest_packages);
- }
- include('stats/updates_table.php');
-}
-
-function user_table($user, $dbh)
-{
- $escuser = mysql_real_escape_string($user);
- $base_q = "SELECT count(*) FROM Packages,Users WHERE Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'";
-
- $maintainer_unsupported_count = db_cache_value($base_q, $dbh,
- 'user_unsupported_count:' . $escuser);
-
- $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDateTS IS NOT NULL AND Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'";
-
- $flagged_outdated = db_cache_value($q, $dbh,
- 'user_flagged_outdated:' . $escuser);
-
- # If the user is a TU calculate the number of the packages
- $atype = account_from_sid($_COOKIE["AURSID"]);
-
- include('stats/user_table.php');
-}
-
-function general_stats_table($dbh)
-{
- # AUR statistics
- $q = "SELECT count(*) FROM Packages";
- $unsupported_count = db_cache_value($q, $dbh, 'unsupported_count');
-
- $q = "SELECT count(*) FROM Packages WHERE MaintainerUID IS NULL";
- $orphan_count = db_cache_value($q, $dbh, 'orphan_count');
-
- $q = "SELECT count(*) FROM Users";
- $user_count = db_cache_value($q, $dbh, 'user_count');
-
- $q = "SELECT count(*) FROM Users,AccountTypes WHERE Users.AccountTypeID = AccountTypes.ID AND AccountTypes.AccountType = 'Trusted User'";
- $tu_count = db_cache_value($q, $dbh, 'tu_count');
-
- $targstamp = intval(strtotime("-7 days"));
- $yearstamp = intval(strtotime("-1 year"));
-
- $q = "SELECT count(*) FROM Packages WHERE Packages.ModifiedTS >= $targstamp AND Packages.ModifiedTS = Packages.SubmittedTS";
- $add_count = db_cache_value($q, $dbh, 'add_count');
-
- $q = "SELECT count(*) FROM Packages WHERE Packages.ModifiedTS >= $targstamp AND Packages.ModifiedTS != Packages.SubmittedTS";
- $update_count = db_cache_value($q, $dbh, 'update_count');
-
- $q = "SELECT count(*) FROM Packages WHERE Packages.ModifiedTS >= $yearstamp AND Packages.ModifiedTS != Packages.SubmittedTS";
- $update_year_count = db_cache_value($q, $dbh, 'update_year_count');
-
- $q = "SELECT count(*) FROM Packages WHERE Packages.ModifiedTS = Packages.SubmittedTS";
- $never_update_count = db_cache_value($q, $dbh, 'never_update_count');
-
- include('stats/general_stats_table.php');
-}