(config.php)
Code:
<?php
$ip = 	 "85.190.142.9";
$port =	 "28960";
$bgcolor = 	 "#272526";
$textcolor = "#FFFFFF";
$links = 	 "#272526";
$linkstext = "#FFFFFF";
$rechts = 	 "#272526";
$rechtstext ="#FFFFFF";
?>
(index.php)
Code:
<?
include("config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Serverstatus</title>
<style type="text/css">
body {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.status_error {
	font-weight: bold;
	color: red;
}
th {
  text-align: left;
  background-color: <?=$links?>;
  color: <?=$linkstext?>;
}
td {
  text-align: left;
  background-color: <?=$rechts?>;
  color: <?=$rechtstext?>;
}
img {
  border: 1px solid <?=$rechtstext?>;
}
</style>
</head>
<body bgcolor="<?=$bgcolor?>" text="<?=$textcolor?>">
<?php
$timeout = 0.5;  		//Timeout in Sekunden
$html = <<<HEREDOC
<table border="0" cellspacing="2" cellpadding="0">
  <tr>
    <th width="120"><left>Spiel:</left></th>
    <td>{gamename}</td>
  </tr>
  <tr>
    <th>Servername:</th>
    <td>{sv_hostname}</td>
  </tr>
  <tr>
    <th>Server IP:</th>
    <td>{ip}:{port}</td>
  </tr>
  <tr>
    <th>Serverversion:</th>
    <td>{shortversion}</td>
  </tr>
  <tr>
    <th>Map:</th>
    <td>{mapname}</td>
  </tr>
  <tr>
    <th></th>
    <td><img src="data/maps/{mapname}.jpg"></td>
  </tr>
  <tr>
    <th>Spieltyp:</th>
    <td>{g_gametype}</td>
  </tr>
  <tr>
    <th>Spieler:</th>
    <td>{currentplayers}/{sv_maxclients}</td>
  </tr>
  <tr>
    <th>Passwort:</b></th>
    <td>{pswrd}</td>
  </tr>
  <tr>
    <th>PunkBuster:</th>
    <td>{sv_punkbuster}</td>
  </tr>
  <tr>
    <th>Mod:</th>
    <td>{fs_game}</td>
  </tr>
</table>
HEREDOC;

/* CONFIG END */

$con = fsockopen("udp://$ip", $port, $errno, $errstr, 3);

if (!$con) {
	echo "<b class='status_error'>Server offline</b>\n";
}
else {
	fwrite($con, "\xFF\xFF\xFF\xFFgetstatus\x00");
	stream_set_timeout($con, (int) $timeout, ($timeout - ((int) $timeout)) * 100000);
	$start = microtime(true);
	$s = "";
	do {
		$s .= substr(fread($con, 9999), 10);
		$info = stream_get_meta_data($con);
		if (!isset($end)) {
			$end = microtime(true);
		}
	}
	while(!$info["timed_out"]) ;


	if (empty($s)) {
		echo "<b class='status_error'>The Serverbanner ist in Bau gerade!</b>\n";
	}
	else {
		$ping = round(($end - $start) * 1000) . " ms";

		list($dummy, $dvarslist, $playerlist) = explode("\n", $s, 3);

		$dvarslist = explode("\\", $dvarslist);
		$dvars = array();
		for ($i = 1; $i < count($dvarslist); $i += 2) {
			$dvars[$dvarslist[$i]] = htmlentities(trimcolor($dvarslist[$i + 1]));
		}

		$playerlist = explode("\n", $playerlist);
		array_pop($playerlist);
		$players = array();
		foreach ($playerlist as $value) {
			list($score, $pingp, $name) = explode(" ", $value, 3);
			$players[] = array(
				"name" => htmlspecialchars(trimcolor(substr($name, 1, -1))),
				"score" => $score,
				"ping" => $pingp
			);
		}

		$dvars["mapname"] = getmap($dvars["mapname"]);
		$dvars["g_gametype"] = getgametype($dvars["g_gametype"]);
		$dvars["fs_game"] = getmods($dvars["fs_game"]);
		$dvars["sv_punkbuster"] = getpb($dvars["sv_punkbuster"]);
		$dvars["pswrd"] = getpw($dvars["pswrd"]);


		$playerlist = "";
		foreach ($players as $value) {
			$playerlist .= "<tr><td>$value[name]</td><td>$value[score]</td><td>$value[ping]</td></tr>\n";
		}

		$search[] = "{playerlist}";
		$replace[] = $playerlist;
		$search[] = "{ping}";
		$replace[] = $ping;
		$search[] = "{ip}";
		$replace[] = $ip;
		$search[] = "{port}";
		$replace[] = $port;
		$search[] = "{currentplayers}";
		$replace[] = count($players);

		foreach ($dvars as $key => $value) {
			$search[] = "{" . $key ."}";
			$replace[] = $value;
		}

		echo str_replace($search, $replace, $html);
	}
}


function trimcolor($name) {
	return preg_replace('|\^.|', '', $name);
}

function getmap($short) {
	$maps = array(

		// Call of Duty 2
		"mp_toujane" => "Toujane",


		// Call of Duty 4: Modern Warfare Maps
		"mp_backlot" => "Backlot",
		"mp_bloc" => "Bloc",
		"mp_bog" => "Bog",
		"mp_cargoship" => "Wet Work",
		"mp_citystreets" => "District",
		"mp_convoy" => "Ambush",
		"mp_countdown" => "Countdown",
		"mp_crash" => "Crash",
		"mp_crash_snow" => "Winter Crash",
		"mp_crossfire" => "Crossfire",
		"mp_farm" => "Downpour",
		"mp_overgrown" => "Overgrown",
		"mp_pipeline" => "Pipeline",
		"mp_showdown" => "Showdown",
		"mp_strike" => "Strike",
		"mp_vacant" => "Vacant",
		"mp_shipment" => "Shipment",
		"mp_broadcast" => "Broadcast",
		"mp_carentan" => "Chinatown",
		"mp_creek" => "Creek",
		"mp_killhouse" => "Killhouse"

	);
	if (array_key_exists($short, $maps)) {
		return $maps[$short];
	}
	return $short;
}
function getgametype($short) {
	$gametypes = array(
		"dm" => "Deathmatch",
		"tdm" => "TeamDeathmatch",
		"sd" => "Suchen und Zerstören",
		"koth" => "Hauptquatier",
		"ctf" => "Capture the Flag",
	);
	if (array_key_exists($short, $gametypes)) {
		return $gametypes[$short];
	}
	return $short;
}
function getmods($short) {
	$mods = array(
		"" => "Kein Mod",
		"mods/pam4" => "Pam4",
		"mods/promod_version3" => "Promod Version 3",
	);
	if (array_key_exists($short, $mods)) {
		return $mods[$short];
	}
	return $short;
}
function getpb($short) {
	$pb = array(
		"1" => "An",
		"0" => "Aus",
	);
	if (array_key_exists($short, $pb)) {
		return $pb[$short];
	}
	return $short;
}
function getpw($short) {
	$pw = array(
		"1" => "Ja",
		"0" => "Nein",
	);
	if (array_key_exists($short, $pw)) {
		return $pw[$short];
	}
	return $short;
}
?>
</body>
</html>
All times coming Server offline pls help