have this code and I'm trying to get it to work. It mostly works, but
$serverpop does not seem to work. What it looks to me like this code
does is scan http://www.worldofwarcraft.com*/serverstatus/ for
keywords
and grab the information about the server that you're looking for. Can
anyone help me try and get the $serverpop part to work?
Thanks in advance,
Craft
______________________________*__________
$server = "Bonechewer";
$up = 'Up';
$down = 'Down';
$hig = 'High';
$med = 'Medium';
$low = 'Low';
// PHP Magic Below, Don't Edit
$html =
file_get_contents('http://www.worldofwarcraft.com*/serverstatus/');
$server = str_replace("'", "'", $server);
$length = strlen($server);
$pos = strpos($html, $server);
$serverstatus = stristr(substr(substr($html, -(strlen($html) - $pos +
154)), 0 ,4), "up");
if ($serverstatus == false) {$serverstatus = "down"; $length = $length
+ 2;}
$servertype = substr(substr($html, -(strlen($html) - ($pos + $length +
117))), 0, 3);
if ($serverstatus == "up") $fontcolor=("00FF00");
if ($serverstatus == "down") $fontcolor=("FF0000");
if ($servertype == "(RP") {$length = $length + 1; $servertype =
"Roleplay";}
else if ($servertype == "Nor") {$length = $length + 3; $servertype =
"Normal";}
else {$length = $length + 2; $servertype= "PVP";}
$serverpop = strtolower(substr(substr($html*, -(strlen($html) - ($pos
+
$length + 256))), 0, 3));
if ($serverpop == "hig") $fontcolr=("FF0000");
if ($serverpop == "med") $fontcolr=("FFFFFF");
if ($serverpop == "low") $fontcolr=("FFFF00");
$serverstatus = $$serverstatus; $serverpop = $$serverpop;
//////////////////////////////*//////////// Output, Edit at your own
risk:
echo "<body bgcolor=black>";
echo "<font color=white><b>Server Name: </b></font>";
echo "<font color=4444FF><b>$server</b></font><br>";
echo "<font color=white><b>Server Type: </font>";
echo "<font color =\"$fontcolor\">";
echo "$servertype</font><br>";
echo "<font color=white><b>Server Status: </font>";
echo "<font color =\"$fontcolor\">";
echo "$serverstatus</font><br>";
echo "<font color=white>Server Load: </font>";
echo "<font color =\"$fontcolr\"> ";
echo "$serverpop </font></b> <br><br><br><br>";
echo "</body>";