mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Code re-formatting (#1059)
This commit is contained in:
parent
30c31144ca
commit
3ed64ab494
1 changed files with 15 additions and 11 deletions
|
@ -75,18 +75,21 @@ foreach ($rowset as $cnt => $row) {
|
||||||
$peers_in_last_sec[] = sprintf('%3s', $row['peers']) . (($cnt && !(++$cnt % 15)) ? " \n" : '');
|
$peers_in_last_sec[] = sprintf('%3s', $row['peers']) . (($cnt && !(++$cnt % 15)) ? " \n" : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detailed statistics for peer clients
|
||||||
$clients = [];
|
$clients = [];
|
||||||
$client_count = 0;
|
$client_count = 0;
|
||||||
|
$client_list = '';
|
||||||
$rowset = DB()->fetch_rowset('SELECT peer_id AS client FROM ' . TMP_TRACKER_TABLE);
|
$rowset = DB()->fetch_rowset('SELECT peer_id AS client FROM ' . TMP_TRACKER_TABLE);
|
||||||
foreach ($rowset as $cnt => $row) {
|
if (!empty($rowset)) {
|
||||||
$clientString = substr($row['client'], 0, 3);
|
foreach ($rowset as $cnt => $row) {
|
||||||
if (!isset($clients[$clientString])) {
|
$clientString = substr($row['client'], 0, 3);
|
||||||
$clients[$clientString] = 1;
|
if (!isset($clients[$clientString])) {
|
||||||
}
|
$clients[$clientString] = 1;
|
||||||
else {
|
}
|
||||||
$clients[$clientString]++;
|
else {
|
||||||
}
|
$clients[$clientString]++;
|
||||||
$client_count++;
|
}
|
||||||
|
$client_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($clients as $value => $count) {
|
foreach ($clients as $value => $count) {
|
||||||
|
@ -94,7 +97,8 @@ foreach ($clients as $value => $count) {
|
||||||
$clients_percentage[] = get_user_torrent_client($value) . " ($count) => $percentage%";
|
$clients_percentage[] = get_user_torrent_client($value) . " ($count) => $percentage%";
|
||||||
}
|
}
|
||||||
|
|
||||||
$clients = implode('<br>', $clients_percentage);
|
$client_list = implode('<br>', $clients_percentage);
|
||||||
|
}
|
||||||
|
|
||||||
function commify_callback($matches)
|
function commify_callback($matches)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +143,7 @@ echo "\n
|
||||||
<tr><td align=center> clients: </td>
|
<tr><td align=center> clients: </td>
|
||||||
<td align=center>
|
<td align=center>
|
||||||
|
|
||||||
$clients
|
$client_list
|
||||||
</td></tr>
|
</td></tr>
|
||||||
\n";
|
\n";
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue