Gazelle/sections/torrents/peerlist.php
Git 31439ec5ec 92 changes from Sun Aug 21 14:42:15 2011 -0400 to Tue Sep 6 03:27:54 2011 +0000
Fix collector for multi-artist albums
Sanitize tags in top10 filter
Sanitize query
Fixes a bug showing the Disable Avatars box for users with the "Can disable users' posting rights" permission
Revert "#trying to fix mono"
fix unknown release (try 1)
trying to roll this out with dirty cache support
Go back to memcached's internal incr/decr functions
fixed nextElementSibling()
patappatch g  [patapper]
2011-09-06 08:00:10 +00:00

70 lines
1.8 KiB
PHP

<?
if(!isset($_GET['torrentid']) || !is_number($_GET['torrentid'])) { error(404); }
$TorrentID = $_GET['torrentid'];
if(!empty($_GET['page']) && is_number($_GET['page'])) {
$Page = $_GET['page'];
$Limit = (string)(($Page-1)*100) .', 100';
} else {
$Page = 1;
$Limit = 100;
}
$Result = $DB->query("SELECT SQL_CALC_FOUND_ROWS
xu.uid,
t.Size,
um.Username,
xu.active,
xu.connectable,
xu.uploaded,
xu.remaining,
xu.useragent
FROM xbt_files_users AS xu
LEFT JOIN users_main AS um ON um.ID=xu.uid
JOIN torrents AS t ON t.ID=xu.fid
WHERE xu.fid='$TorrentID'
AND um.Visible='1'
ORDER BY xu.uploaded DESC
LIMIT $Limit");
$DB->query("SELECT FOUND_ROWS()");
list($NumResults) = $DB->next_record();
$DB->set_query_id($Result);
?>
<h4>Peerlist</h4>
<? if($NumResults>100) { ?>
<div class="linkbox"><?=js_pages('show_peers', $_GET['torrentid'], $NumResults, $Page)?></div>
<? } ?>
<table>
<tr class="colhead_dark" style="font-weight: bold;">
<td>User</td>
<td>Active</td>
<td>Connectable</td>
<td>Up</td>
<td>%</td>
<td>Client</td>
</tr>
<?
while(list($PeerUserID, $Size, $Username, $Active, $Connectable, $Uploaded, $Remaining, $UserAgent) = $DB->next_record()) {
?>
<tr>
<td><?=format_username($PeerUserID, $Username)?></td>
<td><?= ($Active) ? '<span style="color:green">Yes</span>' : '<span style="color:red">No</span>' ?></td>
<td><?= ($Connectable) ? '<span style="color:green">Yes</span>' : '<span style="color:red">No</span>' ?></td>
<td><?=get_size($Uploaded) ?></td>
<td><?=number_format(($Size-$Remaining)/$Size*100, 2)?></td>
<td><?=display_str($UserAgent)?></td>
</tr>
<?
}
?>
</table>
<? if($NumResults>100) { ?>
<div class="linkbox"><?=js_pages('show_peers', $_GET['torrentid'], $NumResults, $Page)?></div>
<? } ?>