<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

eval ("\$title_server = \"".gettemplate("title_server")."\";");
echo $title_server;

$ergebnis=safe_query("SELECT * FROM ".PREFIX."servers ORDER BY sort");

if(mysql_num_rows($ergebnis)) {
$i=1;
while($ds=mysql_fetch_array($ergebnis)) {
	if($i%2) {
		$bg1=BG_1;
		$bg2=BG_2;
 		$bg3=BG_3;
		$bg4=BG_4;
	}
	else {
		$bg1=BG_3;
		$bg2=BG_4;
 		$bg3=BG_1;
		$bg4=BG_2;

  }
			
	if($ds[game]=="CS") $game="HL";	else $game=$ds[game];

  	$serverdata = explode(":",$ds[ip]);
  	$ip = $serverdata[0];
  	$port = $serverdata[1];
  	
  	if(!checkenv('disable_functions','fsockopen')) {
  		if(!fsockopen("udp://".$ip,$port,$strErrNo,$strErrStr,30)) $status= "<i>timeout</i>"; 
  		else $status = "<b>online</b>";
  	} else $status = "<i>Not supported by server</i>";
  	
  	fclose($connection);
	 		 	
  	eval ("\$server = \"".gettemplate("server")."\";");
 		echo $server;
		$i++;
}

}
else echo'no servers available.';


eval ("\$server_foot = \"".gettemplate("server_foot")."\";");
echo $server_foot;


?>

