S
SkiFteL
Гость
dimka3210, не робит...
case 'user_statistic':
$user_id = (int) $this->request['user_id'];
$sql = DB()->fetch_row("
SELECT COUNT(tor.poster_id), SUM(tor.size), tor.poster_id, SUM(tor.complete_count)
FROM ". BB_BT_TORRENTS ." tor
LEFT JOIN ". BB_USERS ." u ON(u.user_id = tor.poster_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(tor.complete_count) DESC
");
if ($row = $sql)
{
$total_releases = ($row['COUNT(tor.poster_id)']) ? $row['COUNT(tor.poster_id)'] : 0;
$total_releases_size = (humn_size($row['SUM(tor.size)'])) ? humn_size($row['SUM(tor.size)']) : 0;
$total_releases_completed = ($row['SUM(tor.complete_count)']) ? $row['SUM(tor.complete_count)'] : 0;
}
$this->response['user_statistic_html'] = '<br />[
'.$lang['RELEASES'].' <span class="seed bold">'.$total_releases.'</span> |
'.$lang['CONTENT'].' <span class="seed bold">'.$total_releases_size.'</span> |
'.$lang['DOWNLOAD_NUMBER'].' <span class="seed bold">'.declension($total_releases_completed, 'times').'</span>
]';
break;
<!-- IF LOGGED_IN -->
<script type="text/javascript">
ajax.index_data = function(mode) {
ajax.exec({
action : 'index_data',
mode : mode,
user_id : {PROFILE_USER_ID}
});
}
ajax.callback.index_data = function(data) {
$('#user_statistic').html(data.user_statistic_html);
}
</script>
<!-- ENDIF -->
<span id="user_statistic">
[ <a href="#" class="med" onclick="ajax.index_data('user_statistic'); return false;">{L_RELEASER_STAT}</a> ]
</span>
case 'get_releases_profile':
$user_id = intval($this->request['user_id']);
if (!$user_id || !get_userdata($user_id))
{
$this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
}
$total_releases = $total_releases_size = $total_releases_completed = 0;
$sql = "
SELECT COUNT(tor.poster_id), SUM(tor.size), tor.poster_id, SUM(tor.complete_count)
FROM ". BB_BT_TORRENTS ." tor
LEFT JOIN ". BB_USERS ." u ON(u.user_id = tor.poster_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(tor.complete_count) DESC
";
if ($row = DB()->fetch_row($sql))
{
$total_releases = $row['COUNT(tor.poster_id)'];
$total_releases_size = humn_size($row['SUM(tor.size)']);
$total_releases_completed = $row['SUM(tor.complete_count)'];
}
$this->response['releases_profile_html'] = '[
'.$lang['RELEASES'].' <span class="seed bold">'.$total_releases.'</span> |
'.$lang['CONTENT'].' <span class="seed bold">'.$total_releases_size.'</span> |
'.$lang['DOWNLOAD_NUMB'].' <span class="seed bold">'.declension($total_releases_completed, 'times').'</span> ]
';
break;
<script type="text/javascript">
ajax.view_profile = function(mode) {
ajax.exec({
action : 'view_profile',
mode : mode,
user_id : {PROFILE_USER_ID}
});
}
ajax.callback.view_profile = function(data) {
$('#releases_profile').html(data.releases_profile_html);
<tr>
<th>{L_RELEASER_STAT}</th>
<td id="releases_profile">
[ <a href="#" class="med" onclick="ajax.view_profile('get_releases_profile'); return false;">{L_RELEASER_STAT_SHOW}</a> ]
</td>
</tr>
// Total releases in profile
$lang['RELEASES'] = 'Релизов:';
$lang['CONTENT'] = 'Объемом:';
$lang['DOWNLOAD_NUMB'] = 'Скачаны:';
$lang['RELEASER_STAT'] = 'Статистика релизера:';
$lang['RELEASER_STAT_SHOW'] = 'Показать статистику';
if (!$user_id = intval($this->request['user_id']) || !$profiledata = get_userdata($user_id))
$user_id = intval($this->request['user_id']);
if (!$user_id || !get_userdata($user_id))