Changeset 614 for trunk/stat/stat.php
- Timestamp:
- Aug 7, 2009, 11:38:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/stat/stat.php
r591 r614 5 5 $Username = $Config['Database']['User']; 6 6 $Password = $Config['Database']['Password']; 7 $Database = $Config['Mangos'][' DatabaseMangos']; // must contains characters table7 $Database = $Config['Mangos']['RealmList'][1]['DatabaseMangos']; // must contains characters table 8 8 $RealmHostname = $Hostname; 9 9 $RealmUsername = $Username; 10 10 $RealmPassword = $Password; 11 11 $RealmDatabase = $Config['Mangos']['DatabaseRealmd']; // must contains zone_coordinates and accounts table 12 $CharactersDatabase = $Config['Mangos'][' DatabaseCharacters']; // must contains zone_coordinates and accounts table12 $CharactersDatabase = $Config['Mangos']['RealmList'][1]['DatabaseCharacters']; // must contains zone_coordinates and accounts table 13 13 $EmuVersion = $Config['Mangos']['ClientVersion']; 14 14 $Owner = $Config['Web']['Admin']; … … 52 52 " <players>\r\n"; 53 53 54 55 54 $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword); 55 mysql_select_db($RealmDatabase, $realm_db); 56 56 $db_result = mysql_query("SET NAMES $DatabaseEncoding", $realm_db); 57 57 58 59 58 $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE); 59 mysql_select_db($Database, $mangos_db); 60 60 $db_result = mysql_query("SET NAMES $DatabaseEncoding", $mangos_db); 61 61 62 63 62 $characters_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword); 63 mysql_select_db($CharactersDatabase, $characters_db); 64 64 $db_result = mysql_query("SET NAMES $DatabaseEncoding", $characters_db); 65 65 66 66 $db_result = mysql_query("SELECT * FROM `characters` WHERE `online`='1' ORDER BY `name`", $characters_db); 67 68 67 while($result = mysql_fetch_array($db_result)) 68 { 69 69 // Get GM level by character 70 70 $db_result2 = mysql_query("SELECT gmlevel FROM `account` WHERE `id`='".$result['account']."'", $realm_db); … … 73 73 74 74 $char_data = explode(' ',$result['data']); 75 75 $Result .= " <player>\r\n". 76 76 " <name>".$result['name']."</name>\r\n". 77 77 " <race>".$result['race']."</race>\r\n". … … 92 92 function get_zone_name($mapid, $x, $y) 93 93 { 94 95 96 97 98 99 100 101 94 global $realm_db; 95 $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db); 96 $zmap = 0; 97 while($result = mysql_fetch_array($query)) 98 { 99 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']; 100 } 101 return $zmap; 102 102 } 103 103
Note:
See TracChangeset
for help on using the changeset viewer.