Changeset 307 for minimanager/item.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/item.php
r142 r307 10 10 require_once("header.php"); 11 11 require_once("scripts/itemset_tab.php"); 12 require_once("scripts/get_lib.php"); 12 13 valid_login(1); 13 14 … … 228 229 function do_search() { 229 230 global $lang_global, $lang_item, $lang_item_edit, $output, $mangos_db, $realm_id, $item_datasite, $sql_search_limit; 230 231 $deplang = get_lang_id(); 231 232 if(($_POST['class'] == "-1")&&($_POST['Quality'] == "-1")&&($_POST['InventoryType'] == "-1")&&($_POST['bonding'] == "-1") 232 233 &&(!isset($_POST['entry'])||$_POST['entry'] === '')&&(!isset($_POST['name'])||$_POST['name'] === '')&&(!isset($_POST['displayid'])||$_POST['displayid'] === '')&&(!isset($_POST['RequiredLevel'])||$_POST['RequiredLevel'] === '') … … 258 259 else $custom_search = ""; 259 260 260 $where = "WHERE entry > 0 ";261 $where = "WHERE item_template.entry > 0 "; 261 262 if($custom_search) $where .= "AND $custom_search "; 262 263 if($class != "-1") $where .= "AND class = '$class' "; … … 264 265 if($InventoryType != "-1") $where .= "AND InventoryType = '$InventoryType' "; 265 266 if($bonding != "-1") $where .= "AND bonding = '$bonding' "; 266 if(isset($entry)) $where .= "AND entry = '$entry' ";267 if(isset($name)) $where .= "AND nameLIKE '%$name%' ";267 if(isset($entry)) $where .= "AND item_template.entry = '$entry' "; 268 if(isset($name)) $where .= "AND IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) LIKE '%$name%' "; 268 269 if(isset($displayid)) $where .= "AND displayid = '$displayid' "; 269 270 if(isset($RequiredLevel)) $where .= "AND RequiredLevel = '$RequiredLevel' "; … … 278 279 if(isset($Flags)) $where .= "AND Flags = '$Flags' "; 279 280 280 if($where == "WHERE entry > 0 ") redirect("item.php?error=1"); 281 282 $result = $sql->query("SELECT entry,displayid,name,RequiredLevel,ItemLevel FROM item_template $where ORDER BY entry LIMIT $sql_search_limit"); 281 if($where == "WHERE item_template.entry > 0 ") redirect("item.php?error=1"); 282 $result = $sql->query("SELECT item_template.entry,displayid,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,RequiredLevel,ItemLevel FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry $where ORDER BY item_template.entry LIMIT $sql_search_limit"); 283 283 $total_items_found = $sql->num_rows($result); 284 284 … … 299 299 <th width=\"10%\">{$lang_item_edit['item_level']}</th> 300 300 </tr>"; 301 302 require_once("scripts/get_lib.php");303 301 304 302 for ($i=1; $i<=$total_items_found; $i++){ … … 1196 1194 1197 1195 $entry = $sql->quote_smart($_GET['entry']); 1198 $result = $sql->query("SELECT * FROM item_template WHERE entry = '$entry'"); 1196 $deplang = get_lang_id(); 1197 $result = $sql->query("SELECT `item_template`.`entry`,`class`,`subclass`,`unk0`,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`displayid`,`Quality`,`Flags`,`BuyCount`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`requiredhonorrank`,`RequiredCityRank`,`RequiredReputationFaction`,`RequiredReputationRank`,`maxcount`,`stackable`,`ContainerSlots`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`dmg_min3`,`dmg_max3`,`dmg_type3`,`dmg_min4`,`dmg_max4`,`dmg_type4`,`dmg_min5`,`dmg_max5`,`dmg_type5`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`RangedModRange`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellppmRate_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellppmRate_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellppmRate_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellppmRate_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellppmRate_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,`description`,`PageText`,`LanguageID`,`PageMaterial`,`startquest`,`lockid`,`Material`,`sheath`,`RandomProperty`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`area`,`Map`,`BagFamily`,`TotemCategory`,`socketColor_1`,`socketContent_1`,`socketColor_2`,`socketContent_2`,`socketColor_3`,`socketContent_3`,`socketBonus`,`GemProperties`,`ExtendedCost`,`RequiredArenaRank`,`RequiredDisenchantSkill`,`ArmorDamageModifier`,`ScriptName`,`DisenchantID`,`FoodType`,`minMoneyLoot`,`maxMoneyLoot` FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry WHERE item_template.entry = '$entry'"); 1199 1198 1200 1199 if ($result){ … … 2184 2183 <th width=\"25%\">{$lang_item_edit['mob_quest_drop_chance']}</th> 2185 2184 </tr>"; 2186 2187 2185 $result2 = $sql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5"); 2188 2186 while ($info = $sql->fetch_row($result2)){ 2189 $result3 = $sql->query("SELECT entry,name,maxlevel FROM creature_templateWHERE lootid = {$info[0]} LIMIT 1");2187 $result3 = $sql->query("SELECT creature_template.entry,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,maxlevel FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE lootid = {$info[0]} LIMIT 1"); 2190 2188 while ($mob = $sql->fetch_row($result3)){ 2191 2189 $output .= "<tr><td><a class=\"tooltip\" href=\"creature.php?action=edit&entry=$mob[0]&error=4\" target=\"_blank\">$mob[1]</a></td> … … 2196 2194 } 2197 2195 2198 $result2 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHEREentry IN (SELECT entry FROM npc_vendor WHERE item = {$item['entry']}) ORDER BY maxlevel DESC LIMIT 5");2196 $result2 = $sql->query("SELECT creature_template.entry,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,maxlevel FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE creature_template.entry IN (SELECT entry FROM npc_vendor WHERE item = {$item['entry']}) ORDER BY maxlevel DESC LIMIT 5"); 2199 2197 if ($sql->num_rows($result2)){ 2200 2198 $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['soled_by']}: {$lang_item_edit['limit_x']}</td></tr>"; … … 2205 2203 } 2206 2204 2207 $result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_templateWHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR2205 $result2 = $sql->query("SELECT quest_template.entry,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as title,QuestLevel FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR 2208 2206 ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR 2209 2207 RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC"); … … 2217 2215 } 2218 2216 2219 $result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_templateWHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR2217 $result2 = $sql->query("SELECT quest_template.entry,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as title,QuestLevel FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR 2220 2218 RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} ) 2221 2219 ORDER BY QuestLevel DESC"); … … 2683 2681 $sql_query = "UPDATE item_template SET "; 2684 2682 2685 $result = $sql->query("SELECT * FROM item_template WHEREentry = '$entry'");2683 $result = $sql->query("SELECT `item_template`.`entry`,`class`,`subclass`,`unk0`,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`displayid`,`Quality`,`Flags`,`BuyCount`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`requiredhonorrank`,`RequiredCityRank`,`RequiredReputationFaction`,`RequiredReputationRank`,`maxcount`,`stackable`,`ContainerSlots`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`dmg_min3`,`dmg_max3`,`dmg_type3`,`dmg_min4`,`dmg_max4`,`dmg_type4`,`dmg_min5`,`dmg_max5`,`dmg_type5`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`RangedModRange`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellppmRate_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellppmRate_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellppmRate_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellppmRate_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellppmRate_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,`description`,`PageText`,`LanguageID`,`PageMaterial`,`startquest`,`lockid`,`Material`,`sheath`,`RandomProperty`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`area`,`Map`,`BagFamily`,`TotemCategory`,`socketColor_1`,`socketContent_1`,`socketColor_2`,`socketContent_2`,`socketColor_3`,`socketContent_3`,`socketBonus`,`GemProperties`,`ExtendedCost`,`RequiredArenaRank`,`RequiredDisenchantSkill`,`ArmorDamageModifier`,`ScriptName`,`DisenchantID`,`FoodType`,`minMoneyLoot`,`maxMoneyLoot` FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry WHERE item_template.entry = '$entry'"); 2686 2684 if ($item_templ = $sql->fetch_assoc($result)){ 2687 2685
Note:
See TracChangeset
for help on using the changeset viewer.