Minor improvements (#1570)

* Minor improvements

* Update index_data.php

* Updated

* Updated

* Update CHANGELOG.md

* Update common.php

* Updated

* Revert "Updated"

This reverts commit f5227b4083.

* Revert "Updated"

This reverts commit 911ac4ac29.

* Revert "Updated"

This reverts commit 3e19c1a973.

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-08-04 22:55:28 +07:00 committed by GitHub
commit c25a6f1dde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 16 deletions

View file

@ -124,33 +124,30 @@ switch ($mode) {
case 'releaser_stats':
$user_id = (int)$this->request['user_id'];
if (!IS_ADMIN && $user_id != $userdata['user_id']) {
$this->ajax_die($lang['NOT_AUTHORISED']);
}
$sql = "
SELECT COUNT(tor.poster_id) as total_releases, SUM(tor.size) as total_size, tor.poster_id, SUM(ad.download_count) as download_count
FROM " . BB_BT_TORRENTS . " tor
LEFT JOIN " . BB_USERS . " u ON(u.user_id = tor.poster_id)
LEFT JOIN " . BB_ATTACHMENTS_DESC . " ad ON(ad.attach_id = tor.attach_id)
LEFT JOIN " . BB_BT_USERS . " ut ON(ut.user_id = tor.poster_id)
SELECT COUNT(tor.poster_id) as total_releases, SUM(tor.size) as total_size, SUM(tor.complete_count) as total_complete, SUM(ad.download_count) as total_dl_count
FROM " . BB_BT_TORRENTS . " tor
LEFT JOIN " . BB_USERS . " u ON(u.user_id = tor.poster_id)
LEFT JOIN " . BB_ATTACHMENTS_DESC . " ad ON(ad.attach_id = tor.attach_id)
LEFT JOIN " . BB_BT_USERS . " ut ON(ut.user_id = tor.poster_id)
WHERE u.user_id = $user_id
GROUP BY tor.poster_id
ORDER BY SUM(ad.download_count) DESC
LIMIT 1
";
$total_releases_size = $total_releases = $total_releases_completed = 0;
$total_releases_size = $total_releases = $total_releases_completed = $total_releases_downloaded = 0;
if ($row = DB()->fetch_row($sql)) {
$total_releases = $row['total_releases'];
$total_releases_size = humn_size($row['total_size']);
$total_releases_completed = $row['download_count'];
$total_releases_downloaded = $row['total_dl_count'];
$total_releases_completed = $row['total_complete'];
}
$html = '[
' . $lang['RELEASES'] . ': <span class="seed bold">' . $total_releases . '</span> |
' . $lang['RELEASER_STAT_SIZE'] . ' <span class="seed bold">' . $total_releases_size . '</span> |
' . $lang['DOWNLOADED'] . ': <span class="seed bold">' . declension((int)$total_releases_completed, 'times') . '</span> ]
';
' . $lang['DOWNLOADED'] . ': <span title="' . $lang['COMPLETED'] . ':&nbsp;' . declension((int)$total_releases_completed, 'times') . '" class="seed bold">' . declension((int)$total_releases_downloaded, 'times') . '</span> ]';
break;
case 'get_traf_stats':