Public feed #598214

Anonymous

public php v1 · immutable
Raw Edit
·published 2007-07-01 04:34 UTC
rendered paste body
<?if (extension_loaded('zlib')) @ob_start('ob_gzhandler');@header("Expires: Mon, 26 Jul 1995 05:00:00 GMT");@header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");@header("Cache-Control: no-cache, must-revalidate");@header("Pragma: no-cache");function check_record($current) {    $fp = fopen("record.txt", "r+b");    $record = fread($fp, 10);    if ($record >= $current) return $record;    rewind($fp);    ftruncate($fp, '0');    fwrite($fp, $current);    return $current;}?><html><head><title>Zone Status</title><link rel=stylesheet href="http://www.infinity-hq.com/files/style.css" type=text/css><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><TABLE width="100%" height="100%" border=0 cellPadding=2 cellSpacing=0>    <TBODY>      <TR class="td3d">        <TD> <table width="100%" cellpadding="0" cellspacing="0">          <tr class="td3d">            <td width="100"><b>Zone</b></td>            <td width="20"><center>#</center></td>          </tr>          <?$total_online = 0;$zones = array();$servers = array("EOL /68.119.196.183/2030");foreach ($servers as $server) {    $info = explode("/", $server);    if ($handle = fsockopen('udp://'.$info[1], $info[2])) {        socket_set_timeout($handle, 1);        $request = pack("CCCC", 0xB2, 0x6F, 0xA0, 0x00);        fwrite($handle, $request);        $online = fread($handle, 4);        if (empty($online)) continue;        $online = unpack('S', $online);        $online = implode($online);        $total_online += $online;	  $zones[] = array("Online" => $online, "Name" => $info[0]);        fclose($handle);    }}$record = check_record($total_online, 'record.txt');asort($zones, SORT_NUMERIC);arsort($zones);foreach ($zones as $zone) { ?>          <tr class='td3d'>            <td width='90%'>              <?=$zone['Name'];?>            </td>            <td width='10%'><font color=green> <center>              <?=$zone['Online'];?>              </center></font></td>          </tr>          <?}?>          <tr class='td3d'>            <td colspan='2' align='center'>&nbsp;</td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>Online:              <?=$total_online;?>            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>Record:              <? include "record.txt"; ?>            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>            &nbsp;            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>            <a href='loading.php?p=cz' title='Refresh'>[Refresh]</a>            </td>          </tr>        </table></TD>      </TR></TABLE><p>&nbsp;</p></body></html><br><br>