mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Minor improvements
This commit is contained in:
parent
7f746af5d5
commit
dece92cd58
2 changed files with 7 additions and 11 deletions
|
@ -124,33 +124,29 @@ 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
|
||||
SELECT COUNT(tor.poster_id) as total_releases, SUM(tor.size) as total_size, tor.poster_id, 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
|
||||
";
|
||||
|
||||
$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'] . ': ' . declension((int)$total_releases_completed, 'times') . '" class="seed bold">' . declension((int)$total_releases_downloaded, 'times') . '</span> ]';
|
||||
break;
|
||||
|
||||
case 'get_traf_stats':
|
||||
|
|
|
@ -462,12 +462,12 @@ ajax.callback.group_membership = function(data) {
|
|||
<td><b>{AGE}</b></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF SHOW_BT_USERDATA --><!-- IF PROFILE_USER || IS_ADMIN -->
|
||||
<!-- IF SHOW_BT_USERDATA -->
|
||||
<tr>
|
||||
<th>{L_RELEASER_STAT}</th>
|
||||
<td id="releases_profile">[ <a href="#" class="med" onclick="ajax.index_data('releaser_stats'); return false;">{L_RELEASER_STAT_SHOW}</a> ]</td>
|
||||
</tr>
|
||||
<!-- ENDIF --><!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- IF SHOW_BT_USERDATA -->
|
||||
<tr>
|
||||
<td colspan="2" class="pad_4">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue