From 0c15224d8770fdca27e5bb245e11f8c9015e2ce6 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 9 Jan 2024 14:05:21 +0700 Subject: [PATCH] Used `humn_size() ` to count average of releases in tr_stats.php (#1313) --- admin/stats/tr_stats.php | 7 ++++--- library/language/source/main.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/stats/tr_stats.php b/admin/stats/tr_stats.php index 6cd8eea56..495cc6af7 100644 --- a/admin/stats/tr_stats.php +++ b/admin/stats/tr_stats.php @@ -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 ''; echo '

'; foreach ($sql as $i => $query) { - $row = mysqli_fetch_row(DB()->query($query)); - echo ""; + $row = mysqli_fetch_row(DB()->query($query))[0]; + $row = ($i == 2) ? humn_size($row) : $row; + echo ""; } echo '
{$lang['TR_STATS'][$i]}{$row[0]}
{$lang['TR_STATS'][$i]}$row
'; diff --git a/library/language/source/main.php b/library/language/source/main.php index 5f9c2b496..985a87051 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -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',