All pastes #163189 Raw Edit

Someone

public text v1 · immutable
·published 2006-09-07 08:26 UTC
rendered paste body
<?
ob_start("ob_gzhandler");

require "include/bittorrent.php";

$maxusers = "5000";
$registered = number_format(get_row_count("users", "WHERE enabled='yes'"));
$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
$torrents = number_format(get_row_count("torrents"));
$seeders = get_row_count("peers", "WHERE seeder='yes'");
$leechers = get_row_count("peers", "WHERE seeder='no'");
$seeders = number_format($seeders);
$leechers = number_format($leechers);
$peers = number_format($leechers + $seeders);
$unconnectable = get_row_count("peers", "WHERE connectable='no'");
$connectable = get_row_count("peers", "WHERE connectable='yes'");
$load = min(100, round(exec('ps ax | grep -c apache') / 256 * 100));
if ($unconnectable == "0") { $unratio = "0"; }
elseif ($connectable == "0") { $unratio = "0"; }
else {
$unratio = round($unconnectable / $connectable * 100);
}
if ($seeders == "0") { $ratio = "0"; }
elseif ($leechers == "0") { $ratio = "0"; }
else {
$ratio = round($seeders / $leechers * 100);
}
?>
Registered users...:<?=$registered?>/<?=$maxusers?><br>
Torrents...:<?=$torrents?><br>
Peers...:<?=$peers?><br>
Seeders...:<?=$seeders?><br>
Leechers...:<?=$leechers?><br>
Server Load...:<?=$load?>%<br>