Changeset 307 for minimanager/scripts/get_lib.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/scripts/get_lib.php
r178 r307 24 24 } 25 25 26 //########################################################################################## 27 //get DBC Language from config 28 function get_lang_id() { 29 # DBC Language Settings 30 # 0 = English 31 # 1 = Korean 32 # 2 = French 33 # 3 = German 34 # 4 = Chinese 35 # 5 = Taiwanese 36 # 6 = Spanish 37 # 7 = Russian 38 # 8 = Unknown 39 # 9 = Unknown 40 # 10 = Unknown 41 # 11 = Unknown 42 # 12 = Unknown 43 # 13 = Unknown 44 # 14 = Unknown 45 # 15 = Unknown 46 global $language; 47 if (isset($_COOKIE["lang"])) $language=$_COOKIE["lang"]; 48 49 switch ($language) { 50 case 'frBE': 51 case 'frFR': 52 return 2; 53 break; 54 case 'deDE': 55 return 3; 56 break; 57 case 'esAR': 58 return 6; 59 break; 60 case 'ruRU': 61 return 7; 62 break; 63 default: 64 return 0; 65 break; 66 } 67 } 26 68 27 69 //########################################################################################## … … 33 75 $sql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 34 76 35 $result = $sql_1->query("SELECT name FROM item_template WHERE entry = '$item_id'"); 77 $deplang = get_lang_id(); 78 $result = $sql_1->query("SELECT IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry WHERE item_template.entry = '$item_id'"); 36 79 $item_name = ($sql_1->num_rows($result) == 1) ? $sql_1->result($result, 0,"name") : "ItemID: $item_id Not Found" ; 37 80 … … 45 88 //generate item tooltip from item_template.entry 46 89 function get_item_tooltip($item_id){ 47 global $lang_global, $lang_item, $lang_id_tab, $mangos_db, $realm_id, $itemset_id ;90 global $lang_global, $lang_item, $lang_id_tab, $mangos_db, $realm_id, $itemset_id, $language; 48 91 if($item_id){ 49 92 $sql_1 = new SQL; 50 93 $sql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 51 94 95 $deplang = get_lang_id(); 52 96 $result_1 = $sql_1->query("SELECT stat_type1,stat_value1,stat_type2,stat_value2,stat_type3,stat_value3,stat_type4, 53 97 stat_value4,stat_type5,stat_value5,stat_type6,stat_value6,stat_type7,stat_value7,stat_type8, 54 98 stat_value8,stat_type9,stat_value9,stat_type10,stat_value10,armor,holy_res,fire_res,nature_res, 55 99 frost_res,arcane_res,shadow_res,spellid_1,spellid_2,spellid_3,spellid_4,spellid_5, 56 name,class,subclass,Quality,RequiredLevel,dmg_min1,dmg_max1,dmg_type1,dmg_min2,dmg_max2,dmg_type2,100 IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",name),class,subclass,Quality,RequiredLevel,dmg_min1,dmg_max1,dmg_type1,dmg_min2,dmg_max2,dmg_type2, 57 101 dmg_min3,dmg_max3,dmg_type3,dmg_min4,dmg_max4,dmg_type4,dmg_min5,dmg_max5,dmg_type5,delay,bonding, 58 description,itemset, entry,InventoryType,ItemLevel,displayid,maxcount,spelltrigger_1,spelltrigger_2,102 description,itemset,item_template.entry,InventoryType,ItemLevel,displayid,maxcount,spelltrigger_1,spelltrigger_2, 59 103 spelltrigger_3,spelltrigger_4,spelltrigger_5,ContainerSlots,spellcharges_1,spellcharges_2,spellcharges_3 60 104 spellcharges_4,spellcharges_5,AllowableClass,socketColor_1,socketColor_2,socketColor_3,RandomProperty,RandomSuffix 61 FROM item_template WHEREentry = '$item_id' LIMIT 1");105 FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry WHERE item_template.entry = '$item_id' LIMIT 1"); 62 106 if ($item = $sql_1->fetch_row($result_1)) { 63 107 $tooltip = ""; … … 607 651 //########################################################################################## 608 652 //get item icon - if icon not exists in INV folder D/L it from web. 653 609 654 function get_icon($itemid) { 610 655 global $proxy_cfg, $get_icons_from_web; … … 667 712 } 668 713 714 669 715 //########################################################################################## 670 716 //generate item border from item_template.entry
Note:
See TracChangeset
for help on using the changeset viewer.