<?php
$GameTypesArray = Array ("dm" => "Deathmatch", "tdm" => "Team Deathmatch", "sd" => "Search and Destroy", "bel" => "Behind Enemy Lines", "wqctf" => "Capture the Flag", "re" => "Retrieval", "c_re" => "Retrieval", "c_sd" => "Search and Destroy", "hq" => "Headquarters");
$PunkbusterArray = Array("0" => "Uitgeschakeld", "" => "Uitgeschakeld", "1" => "Ingeschakeld");
$Query = "SELECT * FROM ips WHERE `id` > '3' ORDER BY ip ASC";
$ResultaatQuery = mysql_query($Query) Or Die (mysql_error());
While ($server = mysql_fetch_object($ResultaatQuery))
{
$RTCW = New Quake3;
$IP = $server->ip;
$Poort = $server->poort;
$Status = $RTCW->GetServerStatus($IP, $Poort, 1500);
If ($Status)
{
$ServerNaam = $RTCW->m_servervars["sv_hostname"];
$ServerNaam = StripColors ($ServerNaam);
$Aantal = $RTCW->m_servervars["sv_currentclients"] ."/". $RTCW->m_servervars["sv_maxclients"];
If ($RTCW->m_servervars["sv_currentclients"] == 0)
{
$ServerNaam = "<font color=\"#A4A4A4\">". $ServerNaam ."</font>";
} ElseIf ($RTCW->m_servervars["sv_currentclients"] == (($RTCW->m_servervars["sv_maxclients"]) - ($RTCW->m_servervars["sv_privateClients"])))
{
$ServerNaam = "<font color=\"#FF0000\">". $ServerNaam ." </font><i> (full)</i>";
} ElseIf ($RTCW->m_servervars["sv_currentclients"] == (($RTCW->m_servervars["sv_maxclients"])))
{
$ServerNaam = "<font color=\"#FF0000\">". $ServerNaam ." </font><i> (full)</i>";
} Else {
$ServerNaam = "<font color=\"#CAD7E2\">". $ServerNaam ."</font>";
}
$Spelers = "";
$AantalClanSpelers = 0;
$NamenClanSpelers = "";
$ClanSpelers = "";
$HoogtePopup = "";
While (list(,$player) = @each ($RTCW->m_playerinfo)) {
$Speler = " ". addslashes(htmlspecialchars(($player["name"]))); // spatie toevoegen aan begin, als clantag eerste letter van het woord is werkt dit anders NIET
$PositieClanSpeler = strpos($Speler, $ClanTag);
If ($PositieClanSpeler == false) {
If ($player["ping"] == 999) {
$Spelers .= "- " .$Speler ." <i>(lagged out)</i><br>";
} Else {
$Spelers .= "- " .$Speler ."<br>";
}
} Else {
$Spelers .= "- <b>" .$Speler ."</b><br>";
$AantalClanSpelers++;
$NamenClanSpelers[] = $Speler;
}
}
$PositieClanSpeler = "";
If ($AantalClanSpelers > 0) {
$ClanSpelers = $AantalClanSpelers .": ";
For ($i=0; $i<Count($NamenClanSpelers); $i++) {
$ClanSpelers .= "<b>". substr($NamenClanSpelers[$i], (strlen($ClanTag) + 1), strlen($NamenClanSpelers[$i])) ."</b>, ";
}
}
$Map = $RTCW->m_servervars["mapname"];
/* $AantalAllies = $RTCW->m_servervars["Players_Allies"];
$AantalAxis = $RTCW->m_servervars["Players_Axis"]; */
$ModName = $RTCW->m_servervars["gamename"];
$GameType = $GameTypesArray[$RTCW->m_servervars["g_gametype"]];
$GameType2 = $RTCW->m_servervars["g_gametype"];
$Punkbuster = $PunkbusterArray[$RTCW->m_servervars["sv_punkbuster"]]; /* ==> <b>Tijdslimiet:</b> ". $Timelimit ." minuten <br>*/
$Timelimit = $RTCW->m_servervars["timelimit"];
$Version = $RTCW->m_servervars["shortversion"];
$Text = "<b>Map:</b> ". stripslashes($Map) ."<br> <b>Mod:</b> ". stripslashes($ModName) ." <br> <b>Punkbuster:</b> ". $Punkbuster ." <br> <b>Gametype:</b> ". stripslashes($GameType) ." <br> <b>Versie:</b> ". $Version;
} Else {
$ServerNaam = "<font color=\"666666\">Server timed out</font>";
$Aantal = "/ ";
}
@$HoogtePopup = 450 + ($RTCW->m_servervars["sv_currentclients"] * 14);
?>
<tr>
<td width="20%"><b><?=$IP?>:<?=$Poort?></b></td>
<td width="70%" onmouseover="return overlib('<?=$Text?>');" onmouseout="return nd();"><a href="#" OnClick="javascript:popup('quake3status.php?IP=<?=$IP?>&Poort=<?=$Poort?>','<?=$HoogtePopup?>');" onMouseOver="window.status='Server info'; return true;" onMouseOut="window.status=' ';return true;"><?=$ServerNaam?></a></td>
<td align="left" width="5%"><font color="CAD7E2"><?=$GameType2?></font></td>
<td align="right" width="5%" onmouseover="return overlib('<b>Spelers:</b><br> <?=$Spelers?>');" onmouseout="return nd();"><b><?=$Aantal?></b></td>
</tr>
<?php
$Spelers = "";
$AantalAllies = "";
$AantalAxis = "";
$AantalClanSpelers = 0;
$ClanSpelers = "";
}
?>