Changeset 307 for minimanager/item.php


Ignore:
Timestamp:
Mar 13, 2008, 8:18:42 PM (17 years ago)
Author:
george
Message:

Aktualizace na minimanager 0.1.6g.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/item.php

    r142 r307  
    1010require_once("header.php");
    1111require_once("scripts/itemset_tab.php");
     12require_once("scripts/get_lib.php");
    1213valid_login(1);
    1314
     
    228229function do_search() {
    229230 global $lang_global, $lang_item, $lang_item_edit, $output, $mangos_db, $realm_id, $item_datasite, $sql_search_limit;
    230 
     231 $deplang = get_lang_id();
    231232 if(($_POST['class'] == "-1")&&($_POST['Quality'] == "-1")&&($_POST['InventoryType'] == "-1")&&($_POST['bonding'] == "-1")
    232233        &&(!isset($_POST['entry'])||$_POST['entry'] === '')&&(!isset($_POST['name'])||$_POST['name'] === '')&&(!isset($_POST['displayid'])||$_POST['displayid'] === '')&&(!isset($_POST['RequiredLevel'])||$_POST['RequiredLevel'] === '')
     
    258259        else $custom_search = "";
    259260
    260  $where = "WHERE entry > 0 ";
     261 $where = "WHERE item_template.entry > 0 ";
    261262 if($custom_search) $where .= "AND $custom_search ";
    262263 if($class != "-1") $where .= "AND class = '$class' ";
     
    264265 if($InventoryType != "-1") $where .= "AND InventoryType = '$InventoryType' ";
    265266 if($bonding != "-1") $where .= "AND bonding = '$bonding' ";
    266  if(isset($entry)) $where .= "AND entry = '$entry' ";
    267  if(isset($name)) $where .= "AND name LIKE '%$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%' ";
    268269 if(isset($displayid)) $where .= "AND displayid = '$displayid' ";
    269270 if(isset($RequiredLevel)) $where .= "AND RequiredLevel = '$RequiredLevel' ";
     
    278279 if(isset($Flags)) $where .= "AND Flags = '$Flags' ";
    279280
    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");
    283283 $total_items_found = $sql->num_rows($result);
    284284
     
    299299        <th width=\"10%\">{$lang_item_edit['item_level']}</th>
    300300  </tr>";
    301 
    302   require_once("scripts/get_lib.php");
    303301
    304302 for ($i=1; $i<=$total_items_found; $i++){
     
    11961194 
    11971195 $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'");
    11991198
    12001199 if ($result){
     
    21842183                <th width=\"25%\">{$lang_item_edit['mob_quest_drop_chance']}</th>
    21852184        </tr>";
    2186 
    21872185 $result2 = $sql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5");
    21882186 while ($info = $sql->fetch_row($result2)){
    2189         $result3 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHERE 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");
    21902188        while ($mob = $sql->fetch_row($result3)){
    21912189                $output .= "<tr><td><a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=$mob[0]&amp;error=4\" target=\"_blank\">$mob[1]</a></td>
     
    21962194        }
    21972195
    2198 $result2 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHERE entry 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");
    21992197 if ($sql->num_rows($result2)){
    22002198        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['soled_by']}: {$lang_item_edit['limit_x']}</td></tr>";
     
    22052203}
    22062204
    2207 $result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
     2205        $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
    22082206                                                        ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR
    22092207                                                        RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC");
     
    22172215 }
    22182216
    2219 $result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR
     2217$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
    22202218                                                        RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} )
    22212219                                                        ORDER BY QuestLevel DESC");                                     
     
    26832681        $sql_query = "UPDATE item_template SET  ";
    26842682 
    2685         $result = $sql->query("SELECT * FROM item_template WHERE entry = '$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'");
    26862684        if ($item_templ = $sql->fetch_assoc($result)){
    26872685 
Note: See TracChangeset for help on using the changeset viewer.