Changeset 578 for trunk/inc/player.php
- Timestamp:
- Apr 30, 2009, 7:10:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/player.php
r577 r578 115 115 public function GetGmLvl() 116 116 { 117 // $this -> NumCheck($guid); 118 $this->db->select_db($db_realmd); 119 $row = $this->db->query('SELECT `gmlevel` FROM `account` WHERE `id` = "'.$_SESSION['UserId'].'" LIMIT 1;')->fetch_array(); 117 global $Config; 118 119 $this->db->select_db($Config['Mangos']['DatabaseRealmd']); 120 $row = $this->db->query('SELECT `gmlevel` FROM `account` WHERE `id` = "'.$_SESSION['UserId'].'" LIMIT 1;')->fetch_assoc(); 120 121 return($row['gmlevel']); 121 122 } … … 124 125 { 125 126 $Class = array(1 => 'warrior', 2 => 'paladin', 3 => 'hunter', 4 => 'rogue', 5 => 'priest', 6 => 'death knight', 7 => 'shaman', 8 => 'mage', 9 => 'warlock', 11 => 'druid'); 126 $Result = $Class[$Id];127 if($Result == '')$Result = 'unknown';127 if(array_key_exists($Id, $Class)) $Result = $Class[$Id]; 128 else $Result = 'unknown'; 128 129 return($Result); 129 130 } … … 132 133 { 133 134 $Race = array(1 => 'human', 2 => 'orc', 4 => 'dwarf', 4 => 'nightelf', 5 => 'undead', 6 => 'tauren', 7 => 'gnome', 8 => 'troll', 9 => 'goblin', 10 => 'bloodelf', 11 => 'draenei'); 134 $Result = $Race[$Id];135 if($Result == '')$Result = 'unknown';135 if(array_key_exists($Id, $Race)) $Result = $Race[$Id]; 136 else $Result = 'unknown'; 136 137 return($Result); 137 138 }
Note:
See TracChangeset
for help on using the changeset viewer.