1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
|
<?php
if(!$_GET["ip"]) {
echo "IP is missing!<br>&ip=...";
die;
}
if(!$_GET["port"]) {
$ipport = explode(':', $_GET['ip']);
if(!$ipport[1] && strpos($ipport[0], '.')) {
echo "PORT is missing!<br>&port=...";
die;
} else { $port = $ipport[1]; }
if(!$ipport[0] || !strpos($ipport[0], '.')) {
echo "IP is missing!<br>&ip=...";
die;
} else { $ip = $ipport[0]; }
} else {
$port = $_GET['port'];
$ip = $_GET['ip'];
}
require("hlquery_funcs.inc");
require("binary_funcs.inc");
$info = Source_A2S_Info($ip, $port);
$info['address'] = $ip . ":" . $port;
$challenge = Source_A2S_GetChallenge($ip, $port);
$rules = Source_A2S_Rules($ip, $port, $challenge);
$mpg = "http://maps.#########";
$info = Format_Info_Array($info, $rules, $mpg);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Status of <?php echo $info['hostname']; ?></TITLE>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV=Refresh CONTENT="180">
<style type="text/css">
<!--
body table {
font-family:Arial,Verdana,Helvetica;
font-size:10px;
text-decoration:none;
}
a {text-decoration:none;}
-->
</style>
</HEAD>
<body topmargin="0" leftmargin="0" bgcolor="#<?php echo $_GET['bg']; ?>"
text="#<?php echo $_GET['text']; ?>"
vlink="#<?php echo $_GET['text']; ?>"
alink="#<?php echo $_GET['text']; ?>"
link="#<?php echo $_GET['text']; ?>"
background="<?php echo $_GET['img']; ?>" >
<?php
echo "<center>\n"
."<TABLE width=\"132\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
if ($_GET['pic']) {
echo "<tr><td colspan=\"2\" align=\"center\"></td></tr>\n"
."<TR><TD colspan=\"2\" width=\"100%\" align=\"center\">\n";
echo $info['img']."\n";
echo "</TD></TR>\n";
}
?>
<TABLE topmargin="0" leftmargin="0" cellspacing=1 cellpadding=5 border=0 width=100% align=center>
<TR><td nowrap>©</td><TD nowrap><table width=100%><tr><td align=left class=td-dark><?php echo $info['hostname']; ?></td><td align=right> </td></tr></table></TD><TD><a href="hlsw://<?php echo $info['address']; ?>"><?php echo $info['address']; ?></a></TD><TD nowrap><?php echo $info['short_descr']; ?></TD><TD><?php echo $info['map']?></TD><TD><?php echo $info['players']; ?> / <?php echo $info['max']; ?></TD></table>
<?php
if ($_GET['top']) {
$top=$_GET['top'];
$dbhost=""; //mysql host address
$dbname=""; // database name
$dbpass=""; // database password
$dbuname=""; //mysql user name
@mysql_connect($dbhost, $dbuname, $dbpass) or die ("Unable to connect to mysql server");
@mysql_select_db($dbname) or die ("Unable to select database");
$sql = 'SELECT lastName, skill, game FROM hlstats_Players where game="css" AND hideranking=0 ORDER BY skill DESC limit 10';
$result = mysql_query("SELECT lastName, skill FROM hlstats_Players where game='".$info['game']."' AND hideranking=0 ORDER BY skill DESC limit $top");
if($result) {
echo "<table width=\"132\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
."<tr><td colspan=\"2\" align=\"center\">Top $top</td></tr>\n"
."<tr><td width=\"102\" align=\"left\"><b><u>Name</b></u></font></td><td width=\"30\" align=\"right\"><b><u>Skill</b></u></td></tr>\n";
$i=0;
while ($i!=($_GET['top']) && $data = mysql_fetch_object($result)) {
echo "<TR><TD ALIGN=\"left\">";
$show_length = 17; //Set to however many characters you would like to show in players name
if(strlen($data->lastName)>$show_length){
$data->lastName = substr($data->lastName, 0, $show_length);
$data->lastName .= "..";
}
echo htmlentities($data->lastName);
echo "</TD><td align=\"right\">$data->skill</td></TR>\n";
$i++;
}
mysql_close();
echo "</table>";
}
}
if ($_GET["ppl"]) {
$players = Source_A2S_Player($ip, $port, $challenge); // already challenged for rules above
if ($players) {
echo "<table width=\"132\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n"
."<tr><td colspan=\"2\" align=\"center\"><b>Spieler</b></td></tr>\n"
."<tr><td width=\"102\" align=\"left\"><b><u>Name</b></u></font></td><td width=\"30\" align=\"right\"><b><u>Frags</b></u></td></tr>\n";
foreach($players as $name=>$value) {
echo "<TR bgcolor=\"".$_GET['bg']."\">"
."<TD align=\"left\">";
$show_length = 17; //Set to however many characters you would like to show in players name
if(strlen($value['name'])>$show_length){
$value['name'] = substr($value['name'], 0, $show_length);
$value['name'] .= "..";
}
echo htmlentities($value["name"])."</TD><TD align=\"right\"> ".$value["frags"]."</TD></TR>\n";
}
echo "</table>";
}
}
?>
</BODY>
</HTML>
|