Index: include/functions.php =================================================================== --- include/functions.php (revision 32) +++ include/functions.php (working copy) @@ -604,45 +604,34 @@ return $name; } -function getCreatureFamilyNames() -{ - global $wDB; - return $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_creature_family`'); -} - function getCreatureFamily($family, $as_ref=1) { - $l = getCreatureFamilyNames(); - $name = isset($l[$family]) ? $l[$family] : 'family_'.$family; + global $gCreatureFamily; if ($as_ref) - return ''.$name.''; - return $name; + return ''.@$gCreatureFamily[$family].''; + return @$gCreatureFamily[$family]; } // Creature type -function getCreatureTypeNames() -{ - global $wDB; - return $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_creature_type`'); -} - function getCreatureType($i, $as_ref=1) { - $t = getCreatureTypeNames(); - $name = isset($t[$i]) ? $t[$i] : 'Type_'.$i; - if ($as_ref) - return ''.$name.''; - return $name; + global $gCreatureType; + $type = @$gCreatureType[$i]; + if ($type!="") + { + if ($as_ref) + return ''.$type.''; + return $type; + } + return 'Type_'.$i; } function getCreatureTypeList($mask, $as_ref=1) { - $t = getCreatureTypeNames(); + global $gCreatureType; if ($as_ref) - return getListFromArray_1($t, $mask, "?s=n&type=%d"); - return getListFromArray_1($t, $mask); + return getListFromArray_1($gCreatureType, $mask, "?s=n&type=%d"); + return getListFromArray_1($gCreatureType, $mask); } function getCreatureCount($creature_id) @@ -824,12 +813,10 @@ return $name; } -function getMapName($id) +function getMapName($map_id) { - global $wDB; - $l = $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_map`'); - return isset($l[$id]) ? $l[$id] : 'map_'.$id; + global $gMapName; + return @$gMapName[$map_id]; } /* FACTION_MASK_PLAYER = 1, // any player @@ -1261,39 +1248,26 @@ return $gGenderType[$gender]; } -function getClassNames() -{ - global $wDB; - return $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_chr_classes`'); -} - function getClass($class) { - $l = getClassNames(); - return isset($l[$class]) ? $l[$class] : 'class_'.$class; + global $gClassType; + return @$gClassType[$class]; } function getAllowableClass($mask) { - $mask&=0x5FF; + global $gClassType; + $mask&=0x5DF; // Return zero if for all class (or for none - if ($mask == 0x5FF OR $mask == 0) + if ($mask == 0x5DF OR $mask == 0) return 0; - return getListFromArray_1(getClassNames(), $mask); + return getListFromArray_1($gClassType, $mask); } -function getRaceNames() -{ - global $wDB; - return $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_chr_races`'); -} - function getRace($race) { - $l = getRaceNames(); - return isset($l[$race]) ? $l[$race] : 'race_'.$race; + global $gRaceType; + return $gRaceType[$race]; } function getAllowableRace($mask) @@ -1315,18 +1289,19 @@ //******************************************************************************** function getPlayerFaction($race) { - global $wDB; - $l = $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `team` FROM `wowd_chr_races`'); - return isset($l[$race]) ? $l[$race] : 2; + if ($race == 2 OR $race == 5 OR $race == 6 OR $race == 8 OR $race == 10) + return 0; + if ($race == 1 OR $race == 3 OR $race == 4 OR $race == 7 OR $race == 11) + return 1; + return 2; } function getFactionImage($race) { $faction = getPlayerFaction($race); if ($faction == 0) + return "images/player_info/factions_img/horde.gif"; + if ($faction == 1) return "images/player_info/factions_img/alliance.gif"; - if ($faction == 1) - return "images/player_info/factions_img/horde.gif"; return 0; } @@ -1342,11 +1317,43 @@ function getFamilyImage($family) { - global $wDB; - $l = $wDB->selectCol('-- CACHE: 1h - SELECT `id` AS ARRAY_KEY, `icon` FROM `wowd_creature_family`'); - if (isset($l[$family])) - return "images/icons/".$l[$family].".jpg"; +$familyIcons = array( + 1=>'ability_hunter_pet_wolf', + 2=>'ability_hunter_pet_cat', + 3=>'ability_hunter_pet_spider', + 4=>'ability_hunter_pet_bear', + 5=>'ability_hunter_pet_boar', + 6=>'ability_hunter_pet_crocolisk', + 7=>'ability_hunter_pet_Vulture', + 8=>'ability_hunter_pet_crab', + 9=>'ability_hunter_pet_gorilla', + 11=>'ability_hunter_pet_raptor', + 12=>'ability_hunter_pet_tallstrider', + 20=>'ability_hunter_pet_scorpid', + 21=>'ability_hunter_pet_turtle', + 24=>'ability_hunter_pet_bat', + 25=>'ability_hunter_pet_hyena', + 26=>'ability_hunter_pet_owl', + 27=>'ability_hunter_pet_windserpent', + 30=>'ability_hunter_pet_dragonhawk', + 31=>'ability_hunter_pet_ravager', + 32=>'ability_hunter_pet_warpstalker', + 33=>'ability_hunter_pet_sporebat', + 34=>'ability_hunter_pet_netherray', + 35=>'spell_nature_guardianward', + 37=>'ability_hunter_pet_Moth', + 38=>'ability_hunter_pet_chimera', + 39=>'ability_hunter_pet_devilsaur', + 40=>'ability_creature_cursed_05', + 41=>'ability_hunter_pet_silithid', + 42=>'ability_hunter_pet_worm', + 43=>'ability_hunter_pet_rhino', + 44=>'ability_hunter_pet_wasp', + 45=>'ability_hunter_pet_corehound', + 46=>'ability_druid_primalprecision', + ); + if (isset($familyIcons[$family])) + return "images/icons/".$familyIcons[$family].".jpg"; return "images/icons/wowunknownitem01.jpg"; } function getStatTypeName($i) Index: lang/lang.en.php =================================================================== --- lang/lang.en.php (revision 32) +++ lang/lang.en.php (working copy) @@ -558,9 +569,18 @@ 'find_faction'=>'Search Faction', 'faction_name'=>'Faction name', +# Fixes +'warrior'=>'Warrior', +'paladin'=>'Paladin', +'hunter'=>'Hunter', +'rogue'=>'Rogue', +'priest'=>'Priest', +'death_knight'=>'Death Knight', +'shaman'=>'Shaman', +'mage'=>'Mage', +'warlock'=>'Warlock', +'druid'=>'Druid', + ); + ?> \ No newline at end of file