function dltable($name, $arr, $torrent) { global $CURUSER, $lang, $INSTALLER09; $htmlout = ''; if (!count($arr)) { return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n"; } $htmlout = "\n"; $htmlout .= "<table class='table table-bordered'>\n"; $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>") . "" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n"; $now = TIME_NOW; $mod = $CURUSER['class'] >= UC_STAFF; foreach ($arr as $e) { $htmlout .= "<tr>\n"; $upspeed = $e["upspeed"] > 0 ? mksize($e["upspeed"]) : ($e["seedtime"] > 0 ? mksize($e["uploaded"] / ($e["seedtime"] + $e["leechtime"])) : mksize(0)); $downspeed = $e["downspeed"] > 0 ? mksize($e["downspeed"]) : ($e["leechtime"] > 0 ? mksize($e["downloaded"] / $e["leechtime"]) : mksize(0)); if ($e['username']) { if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['uid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2 && $CURUSER['id'] != $e['uid']) && $CURUSER['class'] < UC_STAFF) { $htmlout .= "<td><b>Kezer Soze</b></td>\n"; } else { $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['uid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n"; } } else { $htmlout .= "<td>" . ($mod ? XBT_IP_CONVERT($e["ipa"]) : preg_replace('/\\.\\d+$/', ".xxx", XBT_IP_CONVERT($e["ipa"]))) . "</td>\n"; } $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n"; $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($upspeed) . "/s</span></td>\n"; $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n"; $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($downspeed) . "/s</span></td>") . "\n"; $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n"; $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["left"] / $torrent["size"])) . "</td>\n"; $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n"; $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["peer_id"], $e['peer_id'])) . "</td>\n"; $htmlout .= "</tr>\n"; } $htmlout .= "</table>\n"; return $htmlout; }
$HTMLOUT .= "<table class='table table-bordered'>\n<tr>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_user']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_torrent']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_ip']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_port']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_up']}</td>\n" . ($INSTALLER09['ratio_free'] == true ? "" : "<td class='colhead' align='center' width='1%'>{$lang['wpeers_dn']}</td>") . "\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_pssky']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_con']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_seed']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_start']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_last']}</td>\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_upoff']}</td>\n" . ($INSTALLER09['ratio_free'] == true ? "" : "<td class='colhead' align='center' width='1%'>{$lang['wpeers_dnoff']}</td>") . "\n<td class='colhead' align='center' width='1%'>{$lang['wpeers_togo']}</td>\n</tr>"; } while ($row = mysqli_fetch_assoc($result)) { $smallname = substr(htmlsafechars($row["name"]), 0, 25); if ($smallname != htmlsafechars($row["name"])) { $smallname .= '...'; } if (XBT_TRACKER == true) { $upspeed = $row["upspeed"] > 0 ? mksize($row["upspeed"]) : ($row["seedtime"] > 0 ? mksize($row["uploaded"] / ($row["seedtime"] + $row["leechtime"])) : mksize(0)); $downspeed = $row["downspeed"] > 0 ? mksize($row["downspeed"]) : ($row["leechtime"] > 0 ? mksize($row["downloaded"] / $row["leechtime"]) : mksize(0)); } if (XBT_TRACKER == true) { $HTMLOUT .= '<tr> <td><a href="userdetails.php?id=' . (int) $row['uid'] . '">' . htmlsafechars($row['username']) . '</a></td> <td><a href="details.php?id=' . (int) $row['fid'] . '">' . $smallname . '</a></td> <td align="center">' . htmlsafechars(XBT_IP_CONVERT($row['ipa'])) . '</td> <td align="center">' . htmlsafechars(mksize($row['uploaded'])) . '</td> ' . ($INSTALLER09['ratio_free'] == true ? '' : '<td align="center">' . htmlsafechars(mksize($row['downloaded'])) . '</td>') . ' <td align="center">' . htmlsafechars($row['torrent_pass']) . '</td> <td align="center">' . ($row['seeders'] >= 1 ? "<img src='" . $INSTALLER09['pic_base_url'] . "aff_tick.gif' alt='{$lang['wpeers_yes']}' title='{$lang['wpeers_yes']}' />" : "<img src='" . $INSTALLER09['pic_base_url'] . "aff_cross.gif' alt='{$lang['wpeers_no']}' title='{$lang['wpeers_no']}' />") . '</td> <td align="center">' . get_date($row['mtime'], 'DATE', 0, 1) . '</td> <td align="center">' . htmlsafechars(mksize($row['upspeed'])) . '/s</td> ' . ($INSTALLER09['ratio_free'] == true ? '' : '<td align="center">' . htmlsafechars(mksize($row['downspeed'])) . '/s</td>') . ' <td align="center">' . htmlsafechars(mksize($row['left'])) . '</td> </tr>'; } else { $HTMLOUT .= '<tr> <td><a href="userdetails.php?id=' . (int) $row['userid'] . '">' . htmlsafechars($row['username']) . '</a></td> <td><a href="details.php?id=' . (int) $row['torrent'] . '">' . $smallname . '</a></td> <td align="center">' . htmlsafechars($row['ip']) . '</td> <td align="center">' . htmlsafechars($row['port']) . '</td>