Used humn_size() to count average of releases in tr_stats.php (#1313)

This commit is contained in:
Roman Kelesidis 2024-01-09 14:05:21 +07:00 committed by GitHub
commit 0c15224d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -20,7 +20,7 @@ if (!IS_ADMIN) {
$sql[] = 'SELECT count(*) FROM `' . BB_USERS . '` WHERE `user_lastvisit` < UNIX_TIMESTAMP()-2592000 AND user_id NOT IN (' . EXCLUDED_USERS . ')';
$sql[] = 'SELECT count(*) FROM `' . BB_USERS . '` WHERE `user_lastvisit` < UNIX_TIMESTAMP()-7776000 AND user_id NOT IN (' . EXCLUDED_USERS . ')';
$sql[] = 'SELECT round(avg(size)/1048576) FROM `' . BB_BT_TORRENTS . '`';
$sql[] = 'SELECT round(avg(size)) FROM `' . BB_BT_TORRENTS . '`';
$sql[] = 'SELECT count(*) FROM `' . BB_BT_TORRENTS . '`';
$sql[] = 'SELECT count(distinct(topic_id)) FROM `' . BB_BT_TRACKER_SNAP . '` WHERE seeders > 0';
$sql[] = 'SELECT count(distinct(topic_id)) FROM `' . BB_BT_TRACKER_SNAP . '` WHERE seeders > 5';
@ -31,8 +31,9 @@ echo '<html><body><head></head>';
echo '<br /><br /><table border="1" cellspacing="0" cellpadding="6" align="center">';
foreach ($sql as $i => $query) {
$row = mysqli_fetch_row(DB()->query($query));
echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>{$row[0]}</b></td>";
$row = mysqli_fetch_row(DB()->query($query))[0];
$row = ($i == 2) ? humn_size($row) : $row;
echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>$row</b></td>";
}
echo '</table>';

View file

@ -2745,7 +2745,7 @@ $lang['TERMS_EXPLAIN'] = 'On this page, you can specify the text of the basic ru
$lang['TR_STATS'] = [
0 => 'inactive users in 30 days',
1 => 'inactive users for 90 days',
2 => 'medium size distributions on the tracker (many megabytes)',
2 => 'medium size distributions on the tracker',
3 => 'how many total hands on the tracker',
4 => 'how many live hands (there is at least 1 led)',
5 => 'how many hands where that seeding more than 5 seeds',