\r\n". '\r\n". " \r\n". " ".$ServerName."\r\n". " ".$ServerAddress."\r\n". " ".$Owner."\r\n". " ".$Patch."\r\n". " 0 weeks 1 days 0 hours 0 mins\r\n". " ".$Registration."\r\n". " ".$MaxPlayers."\r\n". " ".$XP."\r\n". " \r\n"; $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword); mysql_select_db($RealmDatabase, $realm_db); $db_result = mysql_query("SET NAMES $DatabaseEncoding", $realm_db); $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE); mysql_select_db($Database, $mangos_db); $db_result = mysql_query("SET NAMES $DatabaseEncoding", $mangos_db); $db_result = mysql_query("SELECT count(*) FROM `character` WHERE `online`='1' ORDER BY `name`", $mangos_db); $PlayersCount = mysql_fetch_row($db_result); $Result .= " ".$PlayersCount[0]."\r\n"; $db_result = mysql_query("SELECT * FROM `character` WHERE `online`='1' ORDER BY `name`", $mangos_db); while($result = mysql_fetch_array($db_result)) { // Get GM level by character $db_result2 = mysql_query("SELECT gmlevel FROM `account` WHERE `id`='".$result['account']."'", $realm_db); //echo("SELECT `gmlevel` FROM `account` WHERE `id`='".$result['account']."'"); $result2 = mysql_fetch_array($db_result2); $char_data = explode(' ',$result['data']); $Result .= " \r\n". " ".$result['name']."\r\n". " ".$char_data[34]."\r\n". " ".$result['race']."\r\n". " ".$result['class']."\r\n". " ".get_zone_name($result['map'], $result['position_x'], $result['position_y'])."\r\n". " ".$result['map']."\r\n". " 178.12.14.2\r\n". " ".$result2['gmlevel']."\r\n". " \r\n"; } $Result .= " \r\n". " \r\n"; return($Result); } function get_zone_name($mapid, $x, $y) { global $realm_db; $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db); $zmap = 0; while($result = mysql_fetch_array($query)) { if ($result['map']==$mapid AND $result['y_min'] < $x AND $result['y_max'] > $x AND $result['x_max'] < $y AND $result['x_min'] > $y) $zmap=$result['zone_id']; } return $zmap; } ?>