mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
Add more stats to the front page table
Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
79ce38d271
commit
2005a2889c
2 changed files with 34 additions and 4 deletions
|
@ -36,7 +36,7 @@ function updates_table($dbh)
|
||||||
global $apc_prefix, $apc_ttl;
|
global $apc_prefix, $apc_ttl;
|
||||||
$key = $apc_prefix . 'recent_updates';
|
$key = $apc_prefix . 'recent_updates';
|
||||||
if(!(EXTENSION_LOADED_APC && ($newest_packages = apc_fetch($key)))) {
|
if(!(EXTENSION_LOADED_APC && ($newest_packages = apc_fetch($key)))) {
|
||||||
$q = 'SELECT * FROM Packages ORDER BY ModifiedTS DESC LIMIT 0 , 10';
|
$q = 'SELECT * FROM Packages ORDER BY ModifiedTS DESC LIMIT 10';
|
||||||
$result = db_query($q, $dbh);
|
$result = db_query($q, $dbh);
|
||||||
|
|
||||||
$newest_packages = new ArrayObject();
|
$newest_packages = new ArrayObject();
|
||||||
|
@ -77,6 +77,9 @@ function general_stats_table($dbh)
|
||||||
$q = "SELECT count(*) FROM Packages";
|
$q = "SELECT count(*) FROM Packages";
|
||||||
$unsupported_count = db_cache_value($q, $dbh, $apc_prefix . 'unsupported_count');
|
$unsupported_count = db_cache_value($q, $dbh, $apc_prefix . 'unsupported_count');
|
||||||
|
|
||||||
|
$q = "SELECT count(*) FROM Packages WHERE MaintainerUID IS NULL";
|
||||||
|
$orphan_count = db_cache_value($q, $dbh, $apc_prefix . 'orphan_count');
|
||||||
|
|
||||||
$q = "SELECT count(*) from Users";
|
$q = "SELECT count(*) from Users";
|
||||||
$user_count = db_cache_value($q, $dbh, $apc_prefix . 'user_count');
|
$user_count = db_cache_value($q, $dbh, $apc_prefix . 'user_count');
|
||||||
|
|
||||||
|
@ -84,9 +87,20 @@ function general_stats_table($dbh)
|
||||||
$tu_count = db_cache_value($q, $dbh, $apc_prefix . 'tu_count');
|
$tu_count = db_cache_value($q, $dbh, $apc_prefix . 'tu_count');
|
||||||
|
|
||||||
$targstamp = intval(strtotime("-7 days"));
|
$targstamp = intval(strtotime("-7 days"));
|
||||||
$q = "SELECT count(*) from Packages WHERE Packages.ModifiedTS >= $targstamp";
|
$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, $apc_prefix . 'add_count');
|
||||||
|
|
||||||
|
$q = "SELECT count(*) from Packages WHERE Packages.ModifiedTS >= $targstamp AND Packages.ModifiedTS != Packages.SubmittedTS";
|
||||||
$update_count = db_cache_value($q, $dbh, $apc_prefix . 'update_count');
|
$update_count = db_cache_value($q, $dbh, $apc_prefix . 'update_count');
|
||||||
|
|
||||||
|
$q = "SELECT count(*) from Packages WHERE Packages.ModifiedTS >= $yearstamp AND Packages.ModifiedTS != Packages.SubmittedTS";
|
||||||
|
$update_year_count = db_cache_value($q, $dbh, $apc_prefix . 'update_year_count');
|
||||||
|
|
||||||
|
$q = "SELECT count(*) from Packages WHERE Packages.ModifiedTS = Packages.SubmittedTS";
|
||||||
|
$never_update_count = db_cache_value($q, $dbh, $apc_prefix . 'never_update_count');
|
||||||
|
|
||||||
include('stats/general_stats_table.php');
|
include('stats/general_stats_table.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,29 @@
|
||||||
<th colspan='2' class='boxSoftTitle'><span class='f3'><?php print __("Statistics") ?></span></th>
|
<th colspan='2' class='boxSoftTitle'><span class='f3'><?php print __("Statistics") ?></span></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='boxSoft'><span class='f4'><?php print __("Packages in unsupported"); ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print __("Packages"); ?></span></td>
|
||||||
<td class='boxSoft'><span class='f4'><?php print $unsupported_count; ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print $unsupported_count; ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='boxSoft'><span class='f4'><?php print __("Packages added or updated in the past 7 days"); ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print __("Orphan Packages"); ?></span></td>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print $orphan_count; ?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print __("Packages added in the past 7 days"); ?></span></td>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print $add_count; ?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print __("Packages updated in the past 7 days"); ?></span></td>
|
||||||
<td class='boxSoft'><span class='f4'><?php print $update_count; ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print $update_count; ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print __("Packages updated in the past year"); ?></span></td>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print $update_year_count; ?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print __("Packages never updated"); ?></span></td>
|
||||||
|
<td class='boxSoft'><span class='f4'><?php print $never_update_count; ?></span></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='boxSoft'><span class='f4'><?php print __("Registered Users"); ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print __("Registered Users"); ?></span></td>
|
||||||
<td class='boxSoft'><span class='f4'><?php print $user_count; ?></span></td>
|
<td class='boxSoft'><span class='f4'><?php print $user_count; ?></span></td>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue