Sorry :o It seems It works good now. It does slow the webpage a little bit, but not enough to take it off. Now I have this code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
$content ="";
$html = file_get_contents("http://nw4.novaworld.net/bhd_3_list.lob?page=0");
$html = file_get_contents("http://nw4.novaworld.net/bhd_3_list.lob?page=1");
$html = file_get_contents("http://nw4.novaworld.net/bhd_3_list.lob?page=2");
$regex = '~<td><b>(<font.*>)+\{a\.s\.u\}</font.*><font.*>sniper(</font>)+</b></td>.*<td><font.*>TDM</font></td>.*<td><font.*>(.*)</font></td>~iUs';
if (preg_match($regex, $html, $matches)); {
array_shift($matches);
$content .="<b>{a.s.u}Sniper</b>";
$content .="<br>";
$content .="<img src=http://asu-clan.info/html/serverstatus/onlineanim.gif>Server <font color=#FFFFFF>Online!</font>";
$content .="<br>";
$content .=" Current Players: <br><font color=#FFFFFF>$matches[2]</font>";
$content .="<br>";
$content .="Gametype: <font color=#FFFFFF>TDM</font>";
} else {
$content .="<b>{a.s.u}Sniper</b>";
$content .="<br>";
$content .="<img src=http://asu-clan.info/html/serverstatus/offlineanim.gif>Server Offline";
}
?>
But this results in an error:
Parse error: syntax error, unexpected T_ELSE in /home/rsksquad/public_html/html/blocks/block-serverstatus.php on line 24
I cannot seem to use the else statement. Am I doing something wrong here or do I have to use a different statement ?
Sorry, another question,
I have 16 different images for 0-16 of 16 players. How can I use these? Say the Array returns 10 of 16, how can I make an image display? And a different image for every value that the Array returns ?
I tried using:
if ($matches[2]) = "1 of 16" {
$content .="<img src=http://asu-clan.info/html/serverstatus/1p.bmp>";
} elseif ($matches[2]) = "2 of 16" {
$content .="<img src=http://asu-clan.info/html/serverstatus/2p.bmp>";
} elseif ($matches[2]) = "3 of 16" {
$content .="<img src=http://asu-clan.info/html/serverstatus/3p.bmp>";
But this resulted in an error that I cannot use the '='.
How could I make this work ?
Thanks in advance,
VipleX