Problem With PhP??
Posted: Wed Oct 15, 2003 10:37 pm
can plz some 1 tell me whats going on wiith this??
LINES 123-124
[mod_edit:
LINES 123-124
[mod_edit:
Code: Select all
tag added][/size]Code: Select all
<?
// nduration(unix timestamp) - returns duration in a [x]:xx format
function nduration($time) {
$time = floor($time / 30);
if ($time > 60) {
$m = floor($time / 60);
$s = $time - ($m * 60);
$s = substr("00".$s,-2);
return "$m:$s";
} else {
$s = substr("00".$time,-2);
return ":$s";
}
}
// mapname(map filename) - returns actual map name for a map, if present
// Idea from nontent =)
function mapname($mapname) {
switch($mapname) {
case "beavercreek":
return "Battle Creek";
case "bloodgulch":
return "Blood Gulch";
case "boardingaction":
return "Boarding Action";
case "carousel":
return "Derelict";
case "chillout":
return "Chillout";
case "damnation":
return "Damnation";
case "dangercanyon":
return "Danger Canyon";
case "deathisland":
return "Death Island";
case "gephyrophobia":
return "Gephryophobia";
case "hangemhigh":
return "Hang 'Em High";
case "icefields":
return "Ice Fields";
case "infinity":
return "Infinity";
case "longest":
return "Longest";
case "prisoner":
return "Prisoner";
case "putput":
return "Chiron TL34";
case "ratrace":
return "Rat Race";
case "sidewinder":
return "Sidewinder";
case "timberland":
return "Timberland";
case "unknown":
return "Unknown";
case "wizard":
return "Wizard";
}
return $mapname;
}
function showFavorites() {
global $favorites, $skin;
$cnt = count($favorites);
if ($cnt > 0)
echo "( Favorites: ";
for ($i=0;$i<$cnt;$i++) {
$z = explode(",", $favorites[$i]);
echo "<a href="$PHP_SELF?ip=$z[1]&port=$z[2]&skin=$skin"
class="link">$z[0]</a> ";
if ($i+1 < $cnt)
echo "- ";
}
if ($cnt > 0)
echo ")";
}
function showCredits($link) {
global $version;
echo "<a href="javascript:void(0);" onclick="return overlib('Coded by <font
class=color>David Cramer</font><br><br>Thanks to all the hard work from <font
class=colory>Brian Hurley</font> with his images and decoding the game_flags and
player_flags!<br><br>Testing thanks to <font class=color>K2</font> (<a
href=\''http://hardfought.org\'' target=_new
class=color>hardfought.org</a>)<br><br>Thanks to nontent with the classes idea
(<a href=\''http://nontent.com.org\'' target=_new
class=color>nontent.com</a>)<br><br>Source available <a
href=\''http://halomod.com/haloquery/release/\'' target=_new
class=color>here</a>', STICKY, CAPTION, 'HaloQuery $version', CENTER);"
onmouseout="nd();" class="link">$link</a>";
}
function showSkins() {
global $skin_dir, $skin, $ip, $port;
$d = dir($skin_dir);
//echo "Handle: ".$d->handle."<br>\n";
//echo "Path: ".$d->path."<br>\n";
echo "<SELECT name="skin">";
while (false !== ($entry = $d->read())) {
if (".css" == substr($entry,-4)) {
$skin_name = substr($entry,0,-4);
echo "<OPTION name="skin" value="$skin_name"".($skin == $skin_name ? "
SELECTED" : "").">$skin_name</OPTION>";
}
}
$d->close();
echo "</SELECT>";
}
function showVersion() {
global $version;
echo "<b class=red>HaloQuery $version</b>";
}
function showTip() {
switch (rand(1,3)) {
case 1:
echo ""If you fire burst shots with an assault rifle, you'll greatly
increase accuracy and range." - K2";
break;
case 2:
echo "When you're at close range with an opponent, try to hit them with your
gun instead of shooting them.";
break;
case 3:
echo "The pistol is your greatest enemy, and your greatest advantage.";
break;
case 4:
echo "Want to play God? Fly a banshee..";
}
}
function retrieveData($ip, $port) {
global $r, $x, $p_flags, $g_flags, $playerdat, $teamcnt, $teamscor;
$fp = fsockopen("udp://$ip", $port, $errno, $errstr, 1);
if (!$fp) {
return "-FAILED";
} else {
fwrite($fp, "þý".Chr(0)."wj