Downloads containing example2-2.php

Downloads
Name Author Game Mode Rating
Jazz Server List + Server...Featured Download Cataphract PT Utility 8 Download file

File preview

<?php
/*
** This file handles the server information functionality
** of example2.php and is meant to be included from there.
** Please see 'example2.php' for more information.
**********************************************************
*/
function array_key_existsl($search,$subject) {
	$res = TRUE;
	for ($i=0; $i<count($search); $i++) {
		$res = $res&&array_key_exists($search[$i],$subject);
	}
	return $res;
}

//Checks for input variables
if (
	!array_key_existsl(
		array("version","ip","gamemode","name"),
		$_GET)
) die("Insufficient parameters");

//Define required variables for si.php script
$si_version = signifnumber($_GET['version']);
if ($si_version === FALSE) die("Unsupported version");
$si_ip = $_GET["ip"];	

?>
<?php echo '<?xml version="1.0" encoding="ISO-8859-1"?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Info for <?php
	echo ($name = stripslashes(urldecode($_GET["name"])));
?></title>
<link href="digiex.css" title="Jazz2 Online color set"
	rel="stylesheet" />
</head>
<body class="si">
<div class="SIMain">

<?php
include "si.php";
function showError($message) {
	echo "<div class=\"SITitle SIError\">Error</div>\n";
	echo "<div class=\"SIErrorMsg\">$message</div>"."\n";
}
if ($si_errno != 0) {
	if ($si_errno == 10060) { //Connection timed out
		showError("Unable to contact the server to retrieve
		information: the connection timed out.<br />The server
		is most likely not running anymore.");
	}
	elseif ($si_errno == -2) { //Unexpected response
		showError("The server has sent an unexpected response.
		<br />Possible causes:
		<ul>
		<li>The server is full</li>
		<li>The server version is listed incorrectly</li>
		<li>The server has banned or kicked this web server</li>
		</ul>");
	}
	else showError("($si_errno) $si_errstr");;
}
else { //If there were no errors...
	echo "<div class=\"SITitle\">$name</div>\n";
	echo "<div class=\"SIPlList\">\n";
	for ($i=0; $i<count($si_players); $i++) {
		$obj = $si_players[$i];
		echo "\t".($i+1).". ".$obj->getname(TRUE);
		if ($i+1 != count($si_players)) echo "<br />\n";
		else echo "\n";
	}
	echo "</div>\n";
	echo "<div class=\"SIExtInfo\"><table><tr><td>\n";
	echo "\t".$_GET["gamemode"]."<br />\n".
		"\t".$_GET["version"]."<br />\n".
		"\t".$si_levelname."</td></tr></table>\n</div>";
	echo "\n";
}
?>
</div>
</body>
</html>