PHP Classes

File: templates/classic.php

Recommend this page to a friend!
  Classes of Bogdan Zarchievici   Battlefield 2 Server Query   templates/classic.php   Download  
File: templates/classic.php
Role: Auxiliary script
Content type: text/plain
Description: Classic Template
Class: Battlefield 2 Server Query
Query information from a Battlefield 2 game server
Author: By
Last change:
Date: 18 years ago
Size: 6,817 bytes
 

Contents

Class file image Download
<html>
<head><title>Battlefield 2 Server Query PHP Class</title></head>
<body bgcolor="#F5F5F5" marginwidth="0" marginheight="0"><br/>

<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
    <tr bgcolor="#CCCCCC">
        <td><? if (!isset($status['results']) OR empty($status['results'])) { ?>
<table cellpadding="3" cellspacing="1" border="0" height="100%" width="100%">
                <tr bgcolor="#EEEEEE">
                    <td height="26" background="images/newback.gif"><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Unable to connect to the Battlefield 2 server. Server could be down or changing the map...</b></font></td>
                </tr>
            </table><? } else { ?>
<table cellpadding="3" cellspacing="1" border="0" height="100%" width="100%">
                <tr bgcolor="#EEEEEE">
                    <td height="26" colspan="2" background="images/newback.gif"><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b><?=$status['results']['server']['hostname']?></b></font></td>
                </tr>
            <tr bgcolor="#EEEEEE">
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Variable</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Value</b></font></td>
                </tr><? foreach ($status['results']['server'] as $key => $value) { ?>
<tr bgcolor="#FFFFFF">
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$key?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$value?></b></font></td>
                </tr><? } ?>
</table>
        </td>
    </tr>
</table>
<br/>

<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
    <tr bgcolor="#CCCCCC">
        <td>
<? if (isset($status['results']['players'])) { ?>
<table cellpadding="3" cellspacing="1" border="0" height="100%" width="100%">
                <tr bgcolor="#EEEEEE">
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>#</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Player</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Score</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Kills</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Deaths</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Team</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>PID</b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #003366; text-decoration: none; font-weight: bold;"><b>Ping</b></font></td>
                </tr><? for($i=0; $i<$status['results']['server']['numplayers']; $i++) { if (empty($status['results']['players'][$i]['ping'])) { ?>
<tr bgcolor="#FFFFFF">
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$i+1?></b></font></td>
                    <td align="center" colspan="7"><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b>CONNECTING</b></font></td>
                </tr><? } else { ?>
<tr bgcolor="#FFFFFF">
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=($i+1)?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['player']?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['score']?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['skill']?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['deaths']?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['teams']['team_t'][($status['results']['players'][$i]['team']-1)]?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['pid']?></b></font></td>
                    <td><font style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; color: #006699; text-decoration: none; font-weight: bold;"><b><?=$status['results']['players'][$i]['ping']?></b></font></td>
                </tr><? }} ?>
</table><? }} ?>
</td>
    </tr>
</table>
<br/>

</body>
</html>