Changeset 307 for minimanager/game_object.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/game_object.php
r178 r307 126 126 global $lang_global, $lang_game_object, $output, $mangos_db, $realm_id, $go_datasite, $sql_search_limit, 127 127 $go_type; 128 require_once("./scripts/get_lib.php"); 129 $deplang = get_lang_id(); 128 130 129 131 if((!isset($_POST['entry'])||$_POST['entry'] === '')&&(!isset($_POST['name'])||$_POST['name'] === '')&&(!isset($_POST['ScriptName'])||$_POST['ScriptName'] === '')&&(!isset($_POST['displayId'])||$_POST['displayId'] === '') … … 146 148 else $custom_search = ""; 147 149 148 $where = "WHERE entry > 0 ";150 $where = "WHERE gameobject_template.entry > 0 "; 149 151 if($custom_search != "") $where .= " $custom_search "; 150 152 if(isset($entry)) $where .= "AND entry = '$entry' "; 151 if(isset($name)) $where .= "AND nameLIKE '%$name%' ";153 if(isset($name)) $where .= "AND IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) LIKE '%$name%' "; 152 154 if(isset($type)) $where .= "AND type = '$type' "; 153 155 if(isset($ScriptName)) $where .= "AND ScriptName LIKE '%$ScriptName%' "; … … 156 158 if(isset($flags)) $where .= "AND flags = '$flags' "; 157 159 158 if($where == "WHERE entry > 0 ") redirect("game_object.php?error=1"); 159 160 $result = $sql->query("SELECT entry, type, displayId, name, faction FROM gameobject_template $where ORDER BY entry LIMIT $sql_search_limit"); 160 if($where == "WHERE gameobject_template.entry > 0 ") redirect("game_object.php?error=1"); 161 $result = $sql->query("SELECT gameobject_template.entry, type, displayId, IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name, faction FROM gameobject_template LEFT JOIN locales_gameobject ON gameobject_template.entry = locales_gameobject.entry $where ORDER BY gameobject_template.entry LIMIT $sql_search_limit"); 161 162 $total_found = $sql->num_rows($result); 162 163 … … 368 369 369 370 $entry = $sql->quote_smart($_GET['entry']); 370 $result = $sql->query("SELECT * FROM gameobject_template WHERE entry = '$entry'"); 371 require_once("./scripts/get_lib.php"); 372 $deplang = get_lang_id(); 373 $result = $sql->query("SELECT gameobject_template.`entry`,`type`,`displayId`,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`faction`,`flags`,`size`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`data6`,`data7`,`data8`,`data9`,`data10`,`data11`,`data12`,`data13`,`data14`,`data15`,`data16`,`data17`,`data18`,`data19`,`data20`,`data21`,`data22`,`data23`,`ScriptName` FROM gameobject_template LEFT JOIN locales_gameobject ON gameobject_template.entry = locales_gameobject.entry WHERE gameobject_template.entry = '$entry'"); 371 374 372 375 if ($go = $sql->fetch_assoc($result)){ … … 587 590 $result1 = $sql->query("SELECT quest FROM gameobject_questrelation WHERE id = {$go['entry']}"); 588 591 while ($quest = $sql->fetch_row($result1)){ 589 $query1 = $sql->query("SELECT QuestLevel, Title FROM quest_template WHEREentry ='$quest[0]'");592 $query1 = $sql->query("SELECT QuestLevel, IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as Title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='$quest[0]'"); 590 593 $quest_templ = $sql->fetch_row($query1); 591 594 … … 602 605 $result1 = $sql->query("SELECT quest FROM gameobject_involvedrelation WHERE id = {$go['entry']}"); 603 606 while ($quest = $sql->fetch_row($result1)){ 604 $query1 = $sql->query("SELECT QuestLevel, Title FROM quest_template WHEREentry ='$quest[0]'");607 $query1 = $sql->query("SELECT QuestLevel, IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as Title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='$quest[0]'"); 605 608 $quest_templ = $sql->fetch_row($query1); 606 609 … … 762 765 $sql_query = "UPDATE gameobject_template SET "; 763 766 764 $result = $sql->query("SELECT * FROM gameobject_template WHEREentry = '$entry'");767 $result = $sql->query("SELECT gameobject_template.`entry`,`type`,`displayId`,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`faction`,`flags`,`size`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`data6`,`data7`,`data8`,`data9`,`data10`,`data11`,`data12`,`data13`,`data14`,`data15`,`data16`,`data17`,`data18`,`data19`,`data20`,`data21`,`data22`,`data23`,`ScriptName` FROM gameobject_template LEFT JOIN locales_gameobject ON gameobject_template.entry = locales_gameobject.entry WHERE gameobject_template.entry = '$entry'"); 765 768 if ($go_templ = $sql->fetch_assoc($result)){ 766 769 if ($go_templ['type'] != $type) $sql_query .= "type='$type',";
Note:
See TracChangeset
for help on using the changeset viewer.