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/game_object.php

    r178 r307  
    126126 global $lang_global, $lang_game_object, $output, $mangos_db, $realm_id, $go_datasite, $sql_search_limit,
    127127                $go_type;
     128        require_once("./scripts/get_lib.php");
     129        $deplang = get_lang_id();
    128130
    129131 if((!isset($_POST['entry'])||$_POST['entry'] === '')&&(!isset($_POST['name'])||$_POST['name'] === '')&&(!isset($_POST['ScriptName'])||$_POST['ScriptName'] === '')&&(!isset($_POST['displayId'])||$_POST['displayId'] === '')
     
    146148        else $custom_search = "";
    147149
    148  $where = "WHERE entry > 0 ";
     150 $where = "WHERE gameobject_template.entry > 0 ";
    149151 if($custom_search != "") $where .= " $custom_search ";
    150152 if(isset($entry)) $where .= "AND entry = '$entry' ";
    151  if(isset($name)) $where .= "AND name LIKE '%$name%' ";
     153 if(isset($name)) $where .= "AND IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) LIKE '%$name%' ";
    152154 if(isset($type)) $where .= "AND type = '$type' ";
    153155 if(isset($ScriptName)) $where .= "AND ScriptName LIKE '%$ScriptName%' ";
     
    156158 if(isset($flags)) $where .= "AND flags = '$flags' ";
    157159 
    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");
    161162 $total_found = $sql->num_rows($result);
    162163
     
    368369 
    369370 $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'");
    371374
    372375 if ($go = $sql->fetch_assoc($result)){
     
    587590        $result1 = $sql->query("SELECT quest FROM gameobject_questrelation WHERE id = {$go['entry']}");
    588591        while ($quest = $sql->fetch_row($result1)){
    589                 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$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]'");
    590593                $quest_templ = $sql->fetch_row($query1);
    591594               
     
    602605        $result1 = $sql->query("SELECT quest FROM gameobject_involvedrelation WHERE id = {$go['entry']}");
    603606        while ($quest = $sql->fetch_row($result1)){
    604                 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$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]'");
    605608                $quest_templ = $sql->fetch_row($query1);
    606609               
     
    762765        $sql_query = "UPDATE gameobject_template SET ";
    763766
    764         $result = $sql->query("SELECT * FROM gameobject_template WHERE entry = '$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'");
    765768        if ($go_templ = $sql->fetch_assoc($result)){
    766769                if ($go_templ['type'] != $type) $sql_query .= "type='$type',";
Note: See TracChangeset for help on using the changeset viewer.