Changeset 19


Ignore:
Timestamp:
Aug 13, 2007, 9:05:34 PM (17 years ago)
Author:
george
Message:

Aktualizace MaNGOS Minimanageru na verzi 0.1.4a.

Location:
minimanager
Files:
125 added
9 deleted
62 edited

Legend:

Unmodified
Added
Removed
  • minimanager/README/Changelog.txt

    r5 r19  
     1--------------------------------------------------
     20.1.4a
     3--------------------------------------------------
     4+ PostgreSQL, MySQLi, SQL-Lite support added. Make sure to configure the $db_type variable in config.php.
     5+ Farsi(Pesian) Translation added thanks to Fe3c.
     6+ Russian translation updated thanks to Loosingar.
     7+ Added support for RacialLeader field in creature_template.
     8+ Search options added to Auction House browser.
     9+ The way Terms of Service displayed changed to simpler manner.
     10+ Added the option to make direct links for specific realm. Add "&r_id=RALM_ID" after the url.
     11 This will allow dirct links to characters on different realm.
     12+ Major speed improvment in guild.php/realm.php all the data required selected in single query.
     13+ Total number characters shown in guild list and it is sortable.
     14+ Deletion confirmation boxes added to varius parts.
     15+ The character position system remade using data provided by mangos.
     16+ Code cleanup and optimization.
     17+ Structural changes.
     18
     19- Changes made by Larv. Thanks.
     20+ Spanish translation updated.
     21+ Tiny arrows next to order field added to indicate the ordering direction.
     22+ Icons used instead of plain text for race/class.
     23+ Option to hide/show other commands for levels added to command.php
     24+ Selected text box highlighting added.
     25+ Deletion confirmation boxes added to varius parts.
     26+ Icons used instead of plan text in few places.
     27+ Sorting for character's quests/skills added.
     28+ bbcode based editor added to motd.php
     29+ Option to edit posted motd added.
     30+ Various visual tweaks.
     31
    132--------------------------------------------------
    2330.1.3d
  • minimanager/README/Readme.txt

    r5 r19  
    1 MiniManager for Project MANGOS Server ver 0.1.3d
     1MiniManager for Project MANGOS Server ver 0.1.4a
    22
    33ABOUT:
  • minimanager/ahstats.php

    r5 r19  
    1717//########################################################################################################################
    1818function browse_auctions() {
    19  global $lang_auctionhouse, $lang_global, $output, $mangos_db, $realm_id, $itemperpage, $item_datasite, $server, $user_lvl, $user_id;
     19 global $lang_auctionhouse, $lang_global, $lang_item, $output, $mangos_db, $realm_id,
     20                $itemperpage, $item_datasite, $server, $user_lvl, $user_id;
    2021
    2122 $red = "#DD5047";
     
    2425 $hiddencols = array(1,8,9,10);
    2526
    26  $mysql = new MySQL;
    27  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    28 
    29  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    30  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "time";
    31  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     27 $sql = new SQL;
     28 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     29
     30 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     31 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "time";
     32 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    3233 $order_dir = ($dir) ? "ASC" : "DESC";
    3334 $dir = ($dir) ? 0 : 1;
    3435
    35  $query_1 = $mysql->query("SELECT count(*) FROM auctionhouse");
    36  $all_record = $mysql->result($query_1,0);
     36 $query_1 = $sql->query("SELECT count(*) FROM auctionhouse");
     37 $all_record = $sql->result($query_1,0);
    3738
    3839 if( !$user_lvl && !$server[$realm_id]['both_factions']){
    39         $result = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
    40         if ($mysql->num_rows($result)){
    41                 $order_side = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     40        $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     41        if ($sql->num_rows($result)){
     42                $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
    4243                " AND `character`.`race` IN (2,5,6,8,10) " : " AND `character`.`race` IN (1,3,4,7,11) ";
    4344        } else $order_side = "";
    4445 } else $order_side = "";
    4546 
    46  $result = $mysql->query("SELECT `character`.`name` AS `seller`, `auctionhouse`.`item_template` AS `itemid`, `item_template`.`name` AS `itemname`, `auctionhouse`.`buyoutprice` AS `buyout`,
     47 $result = $sql->query("SELECT `character`.`name` AS `seller`, `auctionhouse`.`item_template` AS `itemid`, `item_template`.`name` AS `itemname`, `auctionhouse`.`buyoutprice` AS `buyout`,
    4748 `auctionhouse`.`time`-unix_timestamp(), `c2`.`name` AS `encherisseur`, `auctionhouse`.`lastbid`, `auctionhouse`.`startbid`, SUBSTRING_INDEX(SUBSTRING_INDEX(`item_instance`.`data`, ' ',15), ' ',-1) AS qty, `character`.`race` AS seller_race, `c2`.`race` AS buyer_race
    4849 FROM `character`, `item_instance`,`item_template`, `auctionhouse` LEFT JOIN `character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid`
    4950 WHERE `auctionhouse`.`itemowner`=`character`.`guid` AND `auctionhouse`.`item_template`=`item_template`.`entry` AND `auctionhouse`.`itemguid`=`item_instance`.`guid`
    5051 $order_side ORDER BY `auctionhouse`.`$order_by` $order_dir LIMIT $start, $itemperpage");
    51  $this_page = $mysql->num_rows($result);
     52 $this_page = $sql->num_rows($result);
    5253
    5354 $output .="<center><table class=\"top_hidden\">
    54           <tr><td width=\"80%\">";
    55 /*               
    56                   <table class=\"hidden\">
    57                         <tr><td>
    58         <form action=\"ahstats.php\" method=\"get\" name=\"form\">
     55      <tr><td width=\"80%\">
     56          <form action=\"ahstats.php\" method=\"get\" name=\"form\">
    5957           <input type=\"hidden\" name=\"action\" value=\"search_auctions\" />
    6058           <input type=\"hidden\" name=\"error\" value=\"2\" />
    61            <input type=\"text\" size=\"30\" name=\"search_value\" />
    62            <select name=\"search_by\">
    63                 <option value=\"item\">{$lang_auctionhouse['item']}</option>
    64            </select></form></td><td>";
     59                <table class=\"hidden\">
     60                <tr><td>
     61          <td><input type=\"text\" size=\"25\" name=\"search_value\" /></td>
     62
     63           <td><select name=\"search_by\">
     64            <option value=\"item_name\">{$lang_auctionhouse['item_name']}</option>
     65                <option value=\"item_id\">{$lang_auctionhouse['item_id']}</option>
     66                <option value=\"seller_name\">{$lang_auctionhouse['seller_name']}</option>
     67                <option value=\"buyer_name\">{$lang_auctionhouse['buyer_name']}</option>
     68           </select></td>
     69           
     70           <td><select name=\"search_class\">
     71            <option value=\"-1\">{$lang_auctionhouse['all']}</option>
     72                <option value=\"0\">{$lang_item['consumable']}</option>
     73                <option value=\"1\">{$lang_item['bag']}</option>
     74                <option value=\"2\">{$lang_item['weapon']}</option>
     75                <option value=\"4\">{$lang_item['armor']}</option>
     76                <option value=\"5\">{$lang_item['reagent']}</option>
     77                <option value=\"7\">{$lang_item['trade_goods']}</option>
     78                <option value=\"9\">{$lang_item['recipe']}</option>
     79                <option value=\"11\">{$lang_item['quiver']}</option>
     80                <option value=\"14\">{$lang_item['permanent']}</option>
     81                <option value=\"15\">{$lang_item['misc_short']}</option>
     82           </select></td>
     83           
     84           <td><select name=\"search_quality\">
     85                <option value=\"-1\">{$lang_auctionhouse['all']}</option>
     86                <option value=\"0\">{$lang_item['poor']}</option>
     87                <option value=\"1\">{$lang_item['common']}</option>
     88                <option value=\"2\">{$lang_item['uncommon']}</option>
     89                <option value=\"3\">{$lang_item['rare']}</option>
     90                <option value=\"4\">{$lang_item['epic']}</option>
     91                <option value=\"5\">{$lang_item['legendary']}</option>
     92                <option value=\"6\">{$lang_item['artifact']}</option>
     93           </select></td>
     94           <td>";
    6595           makebutton($lang_global['search'], "javascript:do_submit()",80);
    66  $output .= "</td></tr></table>
    67  */
    68 
    69  $output .= "<td width=\"20%\" align=\"right\">";
     96 $output .= "</td></tr></table></form>
     97                <td width=\"20%\" align=\"right\">";
    7098 $output .= generate_pagination("ahstats.php?action=browse_auctions&amp;order_by=$order_by&amp;dir=".!$dir, $all_record, $itemperpage, $start);
    7199 $output .= "</td></tr></table>
     
    73101 <table class=\"lined\">
    74102   <tr>
    75         <td width=\"10%\" class=\"head\"><a href=\"ahstats.php?order_by=itemowner&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['seller']}</a></td>
    76         <td width=\"20%\" class=\"head\"><a href=\"ahstats.php?order_by=item_template&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['item']}</a></td>
    77         <td width=\"15%\" class=\"head\"><a href=\"ahstats.php?order_by=buyoutprice&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['buyoutprice']}</a></td>
    78         <td width=\"15%\" class=\"head\"><a href=\"ahstats.php?order_by=time&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['timeleft']}</a></td>
    79         <td width=\"10%\" class=\"head\"><a href=\"ahstats.php?order_by=buyguid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['buyer']}</a></td>
    80         <td width=\"15%\" class=\"head\"><a href=\"ahstats.php?order_by=lastbid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['lastbid']}</a></td>
    81         <td width=\"15%\" class=\"head\"><a href=\"ahstats.php?order_by=startbid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_auctionhouse['firstbid']}</a></td>
     103        <th width=\"10%\"><a href=\"ahstats.php?order_by=itemowner&amp;start=$start&amp;dir=$dir\">".($order_by=='itemowner' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['seller']}</a></th>
     104        <th width=\"20%\"><a href=\"ahstats.php?order_by=item_template&amp;start=$start&amp;dir=$dir\">".($order_by=='item_template' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['item']}</a></th>
     105        <th width=\"15%\"><a href=\"ahstats.php?order_by=buyoutprice&amp;start=$start&amp;dir=$dir\">".($order_by=='buyoutprice' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['buyoutprice']}</a></th>
     106        <th width=\"15%\"><a href=\"ahstats.php?order_by=time&amp;start=$start&amp;dir=$dir\">".($order_by=='time' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['timeleft']}</a></th>
     107        <th width=\"10%\"><a href=\"ahstats.php?order_by=buyguid&amp;start=$start&amp;dir=$dir\">".($order_by=='buyguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['buyer']}</a></th>
     108        <th width=\"15%\"><a href=\"ahstats.php?order_by=lastbid&amp;start=$start&amp;dir=$dir\">".($order_by=='lastbid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['lastbid']}</a></th>
     109        <th width=\"15%\"><a href=\"ahstats.php?order_by=startbid&amp;start=$start&amp;dir=$dir\">".($order_by=='startbid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['firstbid']}</a></th>
    82110   </tr>";
    83111
    84  while ($rows=$mysql->fetch_row($result)) {
     112 while ($rows = $sql->fetch_row($result)) {
    85113        $output .= "<tr>";
    86114        foreach($rows as $row => $value) {
     
    113141        $output .= "</tr>";
    114142 }
    115  $mysql->close();
     143 $sql->close();
    116144 
    117145 $output .= "<tr><td colspan=\"7\" class=\"hidden\" align=\"right\">{$lang_auctionhouse['total_auctions']} : $all_record</td></tr>
     
    124152//########################################################################################################################
    125153function search_auctions() {
    126 //TODO...
     154 global $lang_auctionhouse, $lang_global, $lang_item, $output, $mangos_db, $realm_id,
     155                $itemperpage, $item_datasite, $server, $user_lvl, $user_id, $sql_search_limit;
     156
     157 $red = "#DD5047";
     158 $blue = "#0097CD";
     159 $sidecolor = array(1 => $blue,2 => $red,3 => $blue,4 => $blue,5 => $red,6 => $red,7 => $blue,8 => $red,10 => $red);
     160 $hiddencols = array(1,8,9,10);
     161
     162 $sql = new SQL;
     163 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     164
     165 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "time";
     166 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
     167 $order_dir = ($dir) ? "ASC" : "DESC";
     168 $dir = ($dir) ? 0 : 1;
     169
     170  if( ($_GET['search_class'] == "-1")&&($_GET['search_quality'] == "-1")
     171        &&(!isset($_GET['search_value']))&&(!isset($_GET['search_by'])) )
     172        redirect("ahstats.php?error=1");
     173
     174  $search_class = $sql->quote_smart($_GET['search_class']);
     175  $search_quality = $sql->quote_smart($_GET['search_quality']);
     176  $search_value = $sql->quote_smart($_GET['search_value']);
     177  $search_by = $sql->quote_smart($_GET['search_by']);
     178
     179 if( !$user_lvl && !$server[$realm_id]['both_factions']){
     180        $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     181        if ($sql->num_rows($result)){
     182                $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     183                " AND `character`.`race` IN (2,5,6,8,10) " : " AND `character`.`race` IN (1,3,4,7,11) ";
     184        } else $order_side = "";
     185 } else $order_side = "";
     186 
     187 switch ($search_by) {
     188        case "item_name":
     189       
     190         if(( ($search_class >= 0) || ($search_quality >= 0))&&(!isset($search_value))){
     191                if ($search_class >= 0) $search_filter = " AND item_template.class = '$search_class'";
     192                if ($search_quality >= 0) $search_filter = " AND item_template.Quality = '$search_quality'";
     193        }
     194        else
     195        {
     196                $item_prefix = "";
     197                if ($search_class >= 0) $item_prefix .= "AND class = '$search_class' ";
     198                if ($search_quality >= 0) $item_prefix .= "AND Quality = '$search_quality' ";
     199               
     200                $result = $sql->query("SELECT entry FROM item_template WHERE name LIKE '%$search_value%' $item_prefix");
     201                $search_filter = "AND auctionhouse.item_template IN(0";
     202                while ($item = $sql->fetch_row($result)) $search_filter .= ", $item[0]";
     203                $search_filter .= ")";
     204        }
     205        break;
     206               
     207        case "item_id":
     208                $search_filter = "AND auctionhouse.item_template = '$search_value'";
     209        break;
     210
     211        case "seller_name":
     212                $result = $sql->query("SELECT guid FROM `character` WHERE name LIKE '%$search_value%'");
     213                $search_filter = "AND auctionhouse.itemowner IN(0";
     214                while ($char = $sql->fetch_row($result)) $search_filter .= ", $char[0]";
     215                $search_filter .= ")";
     216        break;
     217        case "buyer_name":
     218                $result = $sql->query("SELECT guid FROM `character` WHERE name LIKE '%$search_value%'");
     219                $search_filter = "AND auctionhouse.buyguid IN(-1";
     220                while ($char = $sql->fetch_row($result)) $search_filter .= ", $char[0]";
     221                $search_filter .= ")";
     222        break;
     223        default:
     224                redirect("ahstats.php?error=1");
     225 }
     226               
     227 $result = $sql->query("SELECT `character`.`name` AS `seller`, `auctionhouse`.`item_template` AS `itemid`, `item_template`.`name` AS `itemname`, `auctionhouse`.`buyoutprice` AS `buyout`,
     228 `auctionhouse`.`time`-unix_timestamp(), `c2`.`name` AS `encherisseur`, `auctionhouse`.`lastbid`, `auctionhouse`.`startbid`, SUBSTRING_INDEX(SUBSTRING_INDEX(`item_instance`.`data`, ' ',15), ' ',-1) AS qty, `character`.`race` AS seller_race, `c2`.`race` AS buyer_race
     229 FROM `character`, `item_instance`,`item_template`, `auctionhouse` LEFT JOIN `character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid`
     230 WHERE `auctionhouse`.`itemowner`=`character`.`guid` AND `auctionhouse`.`item_template`=`item_template`.`entry` AND `auctionhouse`.`itemguid`=`item_instance`.`guid` $search_filter
     231 $order_side ORDER BY `auctionhouse`.`$order_by` $order_dir LIMIT $sql_search_limit");
     232 $tot_found = $sql->num_rows($result);
     233
     234 $output .="<center>
     235                <form action=\"ahstats.php\" method=\"get\" name=\"form\">
     236                        <input type=\"hidden\" name=\"action\" value=\"search_auctions\" />
     237                        <input type=\"hidden\" name=\"error\" value=\"2\" />
     238                <table class=\"top_hidden\">
     239          <tr><td>
     240                <input type=\"text\" size=\"30\" name=\"search_value\" />
     241           
     242          <select name=\"search_by\">
     243            <option value=\"item_name\">{$lang_auctionhouse['item_name']}</option>
     244                <option value=\"item_id\">{$lang_auctionhouse['item_id']}</option>
     245                <option value=\"seller_name\">{$lang_auctionhouse['seller_name']}</option>
     246                <option value=\"buyer_name\">{$lang_auctionhouse['buyer_name']}</option>
     247           </select></form>
     248           
     249           <select name=\"search_class\">
     250            <option value=\"-1\">{$lang_auctionhouse['all']}</option>
     251                <option value=\"0\">{$lang_item['consumable']}</option>
     252                <option value=\"1\">{$lang_item['bag']}</option>
     253                <option value=\"2\">{$lang_item['weapon']}</option>
     254                <option value=\"4\">{$lang_item['armor']}</option>
     255                <option value=\"5\">{$lang_item['reagent']}</option>
     256                <option value=\"7\">{$lang_item['trade_goods']}</option>
     257                <option value=\"9\">{$lang_item['recipe']}</option>
     258                <option value=\"11\">{$lang_item['quiver']}</option>
     259                <option value=\"14\">{$lang_item['permanent']}</option>
     260                <option value=\"15\">{$lang_item['misc_short']}</option>
     261           </select>
     262           
     263          <select name=\"search_quality\">
     264                <option value=\"-1\">{$lang_auctionhouse['all']}</option>
     265                <option value=\"0\">{$lang_item['poor']}</option>
     266                <option value=\"1\">{$lang_item['common']}</option>
     267                <option value=\"2\">{$lang_item['uncommon']}</option>
     268                <option value=\"3\">{$lang_item['rare']}</option>
     269                <option value=\"4\">{$lang_item['epic']}</option>
     270                <option value=\"5\">{$lang_item['legendary']}</option>
     271                <option value=\"6\">{$lang_item['artifact']}</option>
     272           </select>
     273         </td><td>";
     274           makebutton($lang_global['search'], "javascript:do_submit()",80);
     275           makebutton($lang_global['back'], "javascript:window.history.back()",80);
     276 $output .= "</td>
     277  </tr></table></form>
     278 
     279 <table class=\"lined\">
     280   <tr>
     281        <th width=\"10%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=itemowner&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='itemowner' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['seller']}</a></th>
     282        <th width=\"20%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=item_template&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='item_template' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['item']}</a></th>
     283        <th width=\"15%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=buyoutprice&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='buyoutprice' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['buyoutprice']}</a></th>
     284        <th width=\"15%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=time&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='time' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['timeleft']}</a></th>
     285        <th width=\"10%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=buyguid&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='buyguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['buyer']}</a></th>
     286        <th width=\"15%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=lastbid&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='lastbid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['lastbid']}</a></th>
     287        <th width=\"15%\"><a href=\"ahstats.php?action=search_auctions&amp;error=2&amp;order_by=startbid&amp;search_by=$search_by&amp;search_value=$search_value&amp;search_quality=$search_quality&amp;search_class=$search_class&amp;dir=$dir\">".($order_by=='startbid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_auctionhouse['firstbid']}</a></th>
     288   </tr>";
     289
     290 while ($rows = $sql->fetch_row($result)) {
     291        $output .= "<tr>";
     292        foreach($rows as $row => $value) {
     293                switch ($row) {
     294                        case 4:
     295                        $value = ($value >= 0)? (floor($value / 86400).$lang_auctionhouse['dayshortcut']." ". floor(($value % 86400)/3600).$lang_auctionhouse['hourshortcut']." ".floor((($value % 86400)%3600)/60).$lang_auctionhouse['mnshortcut']) : $lang_auctionhouse['auction_over'];
     296                        break;
     297                        case 5:
     298                        $value = "<b>".((!empty($rows[10])) ? "<font color=".$sidecolor[$rows[10]].">$value</font>" : "N/A")."</b>";
     299                        break;
     300                        case 7:                 
     301                        case 6:
     302                        case 3:
     303                        $g = floor($value/10000);
     304                        $value -= $g*10000;
     305                        $s = floor($value/100);
     306                        $value -= $s*100;
     307                        $c = $value;
     308                        $value = $g."<img src=\"./img/gold.gif\" /> ".$s."<img src=\"./img/silver.gif\" /> ".$c."<img src=\"./img/copper.gif\" /> ";           
     309                        break;
     310                        case 2:
     311                        $value = "<a href=\"$item_datasite$rows[1]\" target=\"_blank\" onmouseover=\"toolTip('".addslashes(get_item_tooltip($rows[1]))."','item_tooltip')\" onmouseout=\"toolTip()\"><img src=\"".get_icon($rows[1])."\" class=\"icon_border\" alt=\"$value\"><br/>$value".(($rows[8]>1) ? " (x$rows[8])" : "")."</img></a>";
     312                        break;
     313                        case 0:
     314                        $value = "<b>".((!empty($rows[9])) ? "<font color=".$sidecolor[$rows[9]].">$value</font>" : "N/A")."</b>";
     315                        break;
     316                }
     317                if (!in_array($row,$hiddencols)) $output .= "<td><center>".$value."</center></td>";
     318        }
     319        $output .= "</tr>";
     320 }
     321 $sql->close();
     322 
     323 $output .= "<tr><td colspan=\"7\" class=\"hidden\" align=\"right\">{$lang_auctionhouse['tot_found']} : $tot_found {$lang_global['limit']} : $sql_search_limit</td></tr>
     324   </table></center>";
    127325}
    128326
  • minimanager/backup.php

    r5 r19  
    172172        move_uploaded_file($_FILES["uploaded_file"]["tmp_name"], "$backup_dir/$file_name_new") or die (error("{$lang_backup['upload_err_write_permission']} $backup_dir"));
    173173        if (file_exists("$backup_dir/$file_name_new")){
    174                 require_once("scripts/mysql_lib.php");
     174                require_once("scripts/db_layer/sql_lib.php");
    175175                $use_db = addslashes($_POST['use_db']);
    176176               
    177                 if ($use_db == $realm_db['name']) $queries = mysql_run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'], "$backup_dir/$file_name_new",true);
     177                if ($use_db == $realm_db['name']) $queries = run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'], "$backup_dir/$file_name_new",true);
    178178                        else {
    179179                                foreach ($mangos_db as $db)
    180                                         if ($use_db == $db['name']) $queries = mysql_run_sql_script($db['addr'], $db['user'], $db['pass'], "$backup_dir/$file_name_new",true);
     180                                        if ($use_db == $db['name']) $queries = run_sql_script($db['addr'], $db['user'], $db['pass'], $db['name'], "$backup_dir/$file_name_new",true);
    181181                                }
    182182
     
    191191               
    192192                if (file_exists("$backup_dir/$file_name")){
    193                         require_once("scripts/mysql_lib.php");
     193                        require_once("scripts/db_layer/sql_lib.php");
    194194                        $use_db = addslashes($_POST['use_db']);
    195195                       
    196                         if ($use_db == $realm_db['name']) $queries = mysql_run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'], "$backup_dir/$file_name",false);
     196                        if ($use_db == $realm_db['name']) $queries = run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'], "$backup_dir/$file_name",false);
    197197                        else {
    198198                                foreach ($mangos_db as $db)
    199                                         if ($use_db == $db['name']) $queries = mysql_run_sql_script($db['addr'], $db['user'], $db['pass'], "$backup_dir/$file_name",false);
     199                                        if ($use_db == $db['name']) $queries = run_sql_script($db['addr'], $db['user'], $db['pass'], $db['name'], "$backup_dir/$file_name",false);
    200200                                }
    201201
     
    219219                        fclose($fp);
    220220                       
    221                         require_once("scripts/mysql_lib.php");
     221                        require_once("scripts/db_layer/sql_lib.php");
    222222                       
    223223                        foreach ($tables_backup_realmd as $value) {
    224                                 mysql_table_dump ($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     224                                sql_table_dump ($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    225225                                }
    226226
     
    234234                                       
    235235                                        foreach ($tables_backup_mangos as $value) {
    236                                                 mysql_table_dump ($db['addr'], $db['user'], $db['pass'], $db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     236                                                sql_table_dump ($db['addr'], $db['user'], $db['pass'], $db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    237237                                                }
    238238                                        }
     
    245245                               
    246246                                foreach ($tables_backup_mangos as $value) {
    247                                         mysql_table_dump ($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     247                                        sql_table_dump ($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    248248                                        }
    249249                        }
     
    273273                        fclose($fp);
    274274                       
    275                         require_once("scripts/mysql_lib.php");
     275                        require_once("scripts/db_layer/sql_lib.php");
    276276                       
    277277                        foreach ($tables_backup_realmd as $value) {
    278                                 mysql_table_dump ($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     278                                sql_table_dump ($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    279279                                }
    280280                        fclose($fp);
     
    291291                                       
    292292                                        foreach ($tables_backup_mangos as $value) {
    293                                                 mysql_table_dump ($db['addr'], $db['user'], $db['pass'], $db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     293                                                sql_table_dump ($db['addr'], $db['user'], $db['pass'], $db['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    294294                                                }
    295295                                        fclose($fp);
     
    304304                               
    305305                                foreach ($tables_backup_mangos as $value) {
    306                                         mysql_table_dump ($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
     306                                        sql_table_dump ($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],$value,$struc_backup,"$backup_dir/$file_name_new");
    307307                                        }
    308308                                fclose($fp);
     
    317317                        $save_all_realms = addslashes($_GET['save_all_realms']);
    318318               
    319                         $mysql = new MySQL;
    320                         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    321 
    322                         $query = $mysql->query("SELECT id FROM account");
     319                        $sql = new SQL;
     320                        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     321
     322                        $query = $sql->query("SELECT id FROM account");
    323323                        $subdir = "$backup_dir/accounts/".date("m_d_y_H_i_s");
    324324                        mkdir($subdir, 0750);
    325325
    326326       
    327                         while ($acc = $mysql->fetch_array($query)){
     327                        while ($acc = $sql->fetch_array($query)){
    328328                                        $file_name_new = $acc[0]."_{$realm_db['name']}.sql";
    329329                                        $fp = fopen("$subdir/$file_name_new", 'w') or die (error($lang_backup['file_write_err']));
     
    331331                                        fwrite($fp, "USE {$realm_db['name']};\n\n")or die (error($lang_backup['file_write_err']));
    332332
    333                                         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     333                                        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    334334
    335335                                        foreach ($tab_backup_user_realmd as $value) {
    336                                                 $acc_query = $mysql->query("SELECT * FROM $value[0] WHERE $value[1] = $acc[0]");
    337                                                 $num_fields = $mysql->num_fields($acc_query);
    338                                                 $numrow = $mysql->num_rows($acc_query);
     336                                                $acc_query = $sql->query("SELECT * FROM $value[0] WHERE $value[1] = $acc[0]");
     337                                                $num_fields = $sql->num_fields($acc_query);
     338                                                $numrow = $sql->num_rows($acc_query);
    339339
    340340                                                $result = "-- Dumping data for $value[0] ".date("m.d.y_H.i.s")."\n";
     
    346346                                               
    347347                                                        for($count = 0; $count < $num_fields; $count++) {
    348                                                                 $result .= "`".mysql_field_name($acc_query,$count)."`";
     348                                                                $result .= "`".$sql->field_name($acc_query,$count)."`";
    349349                                                                if ($count < ($num_fields-1)) $result .= ",";
    350350                                                                }
     
    353353                                                        for ($i =0; $i<$numrow; $i++) {
    354354                                                                $result .= "\t(";
    355                                                                 $row = $mysql->fetch_row($acc_query);
     355                                                                $row = $sql->fetch_row($acc_query);
    356356                                                                for($j=0; $j<$num_fields; $j++) {
    357357                                                                        $row[$j] = addslashes($row[$j]);
    358358                                                                        $row[$j] = ereg_replace("\n","\\n",$row[$j]);
    359359                                                                        if (isset($row[$j])) {
    360                                                                                 if (mysql_field_type($acc_query,$j) == "int") $result .= "$row[$j]";
     360                                                                                if ($sql->field_type($acc_query,$j) == "int") $result .= "$row[$j]";
    361361                                                                                        else $result .= "'$row[$j]'" ;
    362362                                                                        }else $result .= "''";
     
    378378                                fwrite($fp, "CREATE DATABASE /*!32312 IF NOT EXISTS*/ {$db['name']};\n")or die (error($lang_backup['file_write_err']));
    379379                                fwrite($fp, "USE {$db['name']};\n\n")or die (error($lang_backup['file_write_err']));
    380                                 $mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    381                                 $all_char_query = $mysql->query("SELECT guid,name FROM `character` WHERE account = $acc[0]");
    382 
    383                                 while ($char = $mysql->fetch_array($all_char_query)){
     380                                $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     381                                $all_char_query = $sql->query("SELECT guid,name FROM `character` WHERE account = $acc[0]");
     382
     383                                while ($char = $sql->fetch_array($all_char_query)){
    384384                                                fwrite($fp, "-- Dumping data for character $char[1]\n")or die (error($lang_backup['file_write_err']));
    385385                                                foreach ($tab_backup_user_mangos as $value) {
    386                                                         $sql = "SELECT * FROM $value[0] WHERE $value[1] = $char[0]";
    387                                                         $char_query = $mysql->query($sql);
    388                                                         $num_fields = $mysql->num_fields($char_query);
    389                                                         $numrow = $mysql->num_rows($char_query);
     386                                                        $char_query = $sql->query("SELECT * FROM $value[0] WHERE $value[1] = $char[0]");
     387                                                        $num_fields = $sql->num_fields($char_query);
     388                                                        $numrow = $sql->num_rows($char_query);
    390389                                                       
    391390                                                        $result = "LOCK TABLES $value[0] WRITE;\n";
     
    394393                                                        if ($numrow){
    395394                                                                $result .= "INSERT INTO $value[0] (";
    396                                                
     395       
    397396                                                                for($count = 0; $count < $num_fields; $count++) {
    398                                                                         $result .= "`".mysql_field_name($char_query,$count)."`";
     397                                                                        $result .= "`".$sql->field_name($char_query,$count)."`";
    399398                                                                        if ($count < ($num_fields-1)) $result .= ",";
    400399                                                                        }
     
    403402                                                                for ($i =0; $i<$numrow; $i++) {
    404403                                                                        $result .= "\t(";
    405                                                                         $row = $mysql->fetch_row($char_query);
     404                                                                        $row = $sql->fetch_row($char_query);
    406405                                                                        for($j=0; $j<$num_fields; $j++) {
    407406                                                                                $row[$j] = addslashes($row[$j]);
    408407                                                                                $row[$j] = ereg_replace("\n","\\n",$row[$j]);
    409408                                                                                if (isset($row[$j])) {
    410                                                                                         if (mysql_field_type($char_query,$j) == "int") $result .= "$row[$j]";
     409                                                                                        if ($sql->field_type($char_query,$j) == "int") $result .= "$row[$j]";
    411410                                                                                                else $result .= "'$row[$j]'" ;
    412411                                                                                }else $result .= "''";
     
    426425                                }
    427426                        }
    428                         $mysql->close();
     427                        $sql->close();
    429428                        redirect("backup.php?error=2");
    430429
     
    441440                $file_tmp = "$backup_dir/accounts/$file_dir/".$file_name."_$use_db.sql";
    442441                if (file_exists($file_tmp)){
    443                         require_once("scripts/mysql_lib.php");
    444 
    445                         if ($use_db == $realm_db['name']) $queries = mysql_run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'], "$backup_dir/accounts/$file_dir/$file_name.sql",true);
     442                        require_once("scripts/db_layer/sql_lib.php");
     443
     444                        if ($use_db == $realm_db['name']) $queries = run_sql_script($realm_db['addr'], $realm_db['user'], $realm_db['pass'],$realm_db['name'], "$backup_dir/accounts/$file_dir/$file_name.sql",true);
    446445                        else {
    447446                                foreach ($mangos_db as $db)
    448                                         if ($use_db == $db['name']) $queries = mysql_run_sql_script($db['addr'], $db['user'], $db['pass'], "$backup_dir/accounts/$file_dir/$file_name.sql",true);
     447                                        if ($use_db == $db['name']) $queries = run_sql_script($db['addr'], $db['user'], $db['pass'],$db['name'], "$backup_dir/accounts/$file_dir/$file_name.sql",true);
    449448                                }
    450449
  • minimanager/banned.php

    r5 r19  
    1818 global  $lang_global, $lang_banned, $output, $realm_db, $itemperpage;
    1919
    20  $mysql = new MySQL;
    21  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    22 
    23  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    24  $ban_type = (isset($_GET['ban_type'])) ? $mysql->quote_smart($_GET['ban_type']) : "account_banned";
     20 $sql = new SQL;
     21 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     22
     23 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     24 $ban_type = (isset($_GET['ban_type'])) ? $sql->quote_smart($_GET['ban_type']) : "account_banned";
    2525 $key_field = ($ban_type == "account_banned") ? "id" :"ip";
    26  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : $key_field;
    27 
    28  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     26 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : $key_field;
     27
     28 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    2929 $order_dir = ($dir) ? "ASC" : "DESC";
    3030 $dir = ($dir) ? 0 : 1;
    3131       
    32  $query_1 = $mysql->query("SELECT count(*) FROM $ban_type");
    33  $all_record = $mysql->result($query_1,0);
    34 
    35  $result = $mysql->query("SELECT $key_field, bandate, unbandate, bannedby, SUBSTRING_INDEX(banreason,' ',3) FROM $ban_type ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    36  $this_page = $mysql->num_rows($result);
     32 $query_1 = $sql->query("SELECT count(*) FROM $ban_type");
     33 $all_record = $sql->result($query_1,0);
     34
     35 $result = $sql->query("SELECT $key_field, bandate, unbandate, bannedby, SUBSTRING_INDEX(banreason,' ',3) FROM $ban_type ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
     36 $this_page = $sql->num_rows($result);
    3737
    3838  $output .= "<center>
     
    4747     <td align=\"right\">".generate_pagination("banned.php?action=show_list&amp;order_by=$order_by&amp;ban_type=$ban_type&amp;dir=".!$dir, $all_record, $itemperpage, $start)."</td>
    4848         </tr></table>
    49    <table class=\"lined\">
     49  <script type=\"text/javascript\">
     50        answerbox.btn_ok='{$lang_global['yes_low']}';
     51        answerbox.btn_cancel='{$lang_global['no']}';
     52        var del_banned = 'banned.php?action=do_delete_entry&amp;ban_type=$ban_type&amp;$key_field=';
     53 </script>
     54 <table class=\"lined\">
    5055   <tr>
    51         <td width=\"5%\" class=\"head\">{$lang_global['delete']}</td>
    52         <td width=\"19%\" class=\"head\"><a href=\"banned.php?order_by=$key_field&amp;ban_type=$ban_type&amp;dir=$dir\" class=\"head_link\">{$lang_banned['ip_acc']}</a></td>
    53         <td width=\"18%\" class=\"head\"><a href=\"banned.php?order_by=bandate&amp;ban_type=$ban_type&amp;dir=$dir\" class=\"head_link\">{$lang_banned['bandate']}</a></td>
    54         <td width=\"18%\" class=\"head\"><a href=\"banned.php?order_by=unbandate&amp;ban_type=$ban_type&amp;dir=$dir\" class=\"head_link\">{$lang_banned['unbandate']}</a></td>
    55         <td width=\"15%\" class=\"head\"><a href=\"banned.php?order_by=bannedby&amp;ban_type=$ban_type&amp;dir=$dir\" class=\"head_link\">{$lang_banned['bannedby']}</a></td>
    56         <td width=\"25%\" class=\"head\"><a href=\"banned.php?order_by=banreason&amp;ban_type=$ban_type&amp;dir=$dir\" class=\"head_link\">{$lang_banned['banreason']}</a></td>
     56        <th width=\"5%\">{$lang_global['delete_short']}</td>
     57        <th width=\"19%\"><a href=\"banned.php?order_by=$key_field&amp;ban_type=$ban_type&amp;dir=$dir\">".($order_by==$key_field ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_banned['ip_acc']}</a></th>
     58        <th width=\"18%\"><a href=\"banned.php?order_by=bandate&amp;ban_type=$ban_type&amp;dir=$dir\">".($order_by=='bandate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_banned['bandate']}</a></th>
     59        <th width=\"18%\"><a href=\"banned.php?order_by=unbandate&amp;ban_type=$ban_type&amp;dir=$dir\">".($order_by=='unbandate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_banned['unbandate']}</a></th>
     60        <th width=\"15%\"><a href=\"banned.php?order_by=bannedby&amp;ban_type=$ban_type&amp;dir=$dir\">".($order_by=='bannedby' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_banned['bannedby']}</a></th>
     61        <th width=\"25%\"><a href=\"banned.php?order_by=banreason&amp;ban_type=$ban_type&amp;dir=$dir\">".($order_by=='banreason' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_banned['banreason']}</a></th>
    5762  </tr>";
    5863
    59  $looping = ($this_page < $itemperpage) ?  $this_page : $itemperpage;
    60  
    61  for ($i=1; $i <= $looping; $i++){
    62   $ban = $mysql->fetch_row($result);
    63  
     64 while ($ban = $sql->fetch_row($result)){
     65
    6466  if ($ban_type === "account_banned"){
    65         $result1 = $mysql->query("SELECT username FROM account WHERE id ='$ban[0]'");
    66         $owner_acc_name = $mysql->result($result1, 0, 'username');
     67        $result1 = $sql->query("SELECT username FROM account WHERE id ='$ban[0]'");
     68        $owner_acc_name = $sql->result($result1, 0, 'username');
    6769        $name_out = "<a href=\"user.php?action=edit_user&amp;error=11&amp;id=$ban[0]\">$owner_acc_name</a>";
    68   } else $name_out = $ban[0];
    69  
     70  } else {
     71                        $name_out = $ban[0];
     72                        $owner_acc_name = $ban[0];
     73                }
     74 
    7075  $output .= "<tr>
    71                         <td><a href=\"banned.php?action=do_delete_entry&amp;$key_field=$ban[0]&amp;ban_type=$ban_type\"><img src=\"img/x.ico\" class=\"no_border\" alt=\"\" /></a></td>
     76                        <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>$owner_acc_name</font><br />{$lang_global['are_you_sure']}', del_banned + '$ban[0]');\" style=\"cursor:pointer;\" /></td>
    7277                        <td>$name_out</td>
    7378                        <td>".date('d-m-Y G:i', $ban[1])."</td>
     
    8186         </tr>
    8287 </table></center><br/>";
    83  $mysql->close();
     88 $sql->close();
    8489}
    8590
     
    9196 global $lang_global, $realm_db;
    9297
    93  $mysql = new MySQL;
    94  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    95  
    96  if(isset($_GET['ban_type'])) $ban_type = $mysql->quote_smart($_GET['ban_type']);
     98 $sql = new SQL;
     99 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     100 
     101 if(isset($_GET['ban_type'])) $ban_type = $sql->quote_smart($_GET['ban_type']);
    97102        else redirect("banned.php?error=1");
    98103
    99104 $key_field = ($ban_type == "account_banned") ? "id" : "ip";
    100105
    101  if(isset($_GET[$key_field])) $entry = $mysql->quote_smart($_GET[$key_field]);
     106 if(isset($_GET[$key_field])) $entry = $sql->quote_smart($_GET[$key_field]);
    102107        else redirect("banned.php?error=1");
    103108
    104  $mysql->query("DELETE FROM $ban_type WHERE $key_field = '$entry'");
    105 
    106  if ($mysql->affected_rows()) {
    107         $mysql->close();
     109 $sql->query("DELETE FROM $ban_type WHERE $key_field = '$entry'");
     110
     111 if ($sql->affected_rows()) {
     112        $sql->close();
    108113        redirect("banned.php?error=3&ban_type=$ban_type");
    109114    } else {
    110          $mysql->close();
     115         $sql->close();
    111116         redirect("banned.php?error=2&ban_type=$ban_type");
    112117        }
     
    166171        redirect("banned.php?error=1&action=add_entry");
    167172
    168  $mysql = new MySQL;
    169  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    170  
    171  $ban_type = $mysql->quote_smart($_GET['ban_type']);
    172 
    173  $entry = $mysql->quote_smart($_GET['entry']);
     173 $sql = new SQL;
     174 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     175 
     176 $ban_type = $sql->quote_smart($_GET['ban_type']);
     177
     178 $entry = $sql->quote_smart($_GET['entry']);
    174179 if ($ban_type == "account_banned") {
    175         $result1 = $mysql->query("SELECT id FROM account WHERE username ='$entry'");
    176         if (!$mysql->num_rows($result1)) redirect("banned.php?error=4&action=add_entry");
    177                 else $entry = $mysql->result($result1, 0, 'id');
     180        $result1 = $sql->query("SELECT id FROM account WHERE username ='$entry'");
     181        if (!$sql->num_rows($result1)) redirect("banned.php?error=4&action=add_entry");
     182                else $entry = $sql->result($result1, 0, 'id');
    178183 }
    179184 
    180  $bantime = time() + (3600 * $mysql->quote_smart($_GET['bantime']));
    181  
    182  $banreason = (isset($_GET['banreason']) && ($_POST['banreason'] != '')) ? $mysql->quote_smart($_GET['banreason']) : "none";
     185 $bantime = time() + (3600 * $sql->quote_smart($_GET['bantime']));
     186 
     187 $banreason = (isset($_GET['banreason']) && ($_POST['banreason'] != '')) ? $sql->quote_smart($_GET['banreason']) : "none";
    183188
    184189 if ($ban_type === "account_banned"){
    185         $result = $mysql->query("SELECT count(*) FROM account_banned WHERE id = '$entry'");
    186         if(!$mysql->result($result, 0))
    187                 $mysql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active)
     190        $result = $sql->query("SELECT count(*) FROM account_banned WHERE id = '$entry'");
     191        if(!$sql->result($result, 0))
     192                $sql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active)
    188193                                           VALUES ('$entry',".time().",$bantime,'$user_name','$banreason', 1)");
    189194
    190195 } else {
    191                 $mysql->query("INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason)
     196                $sql->query("INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason)
    192197                                                VALUES ('$entry',".time().",$bantime,'$user_name','$banreason')");
    193198                }
    194199                       
    195  if ($mysql->affected_rows()) {
    196         $mysql->close();
     200 if ($sql->affected_rows()) {
     201        $sql->close();
    197202        redirect("banned.php?error=3&ban_type=$ban_type");
    198203        } else {
    199                 $mysql->close();
     204                $sql->close();
    200205                redirect("banned.php?error=2&ban_type=$ban_type");
    201206         }
    202  $mysql->close();
     207 $sql->close();
    203208}
    204209
  • minimanager/char.php

    r5 r19  
    2323if (empty($_GET['id'])) error($lang_global['empty_fields']);
    2424
    25 $mysql = new MySQL;
    26 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    27 
    28 $id = $mysql->quote_smart($_GET['id']);
    29 
    30 $result = $mysql->query("SELECT account,race FROM `character` WHERE guid = $id LIMIT 1");
    31 
    32 if ($mysql->num_rows($result)){
     25$sql = new SQL;
     26$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     27
     28$id = $sql->quote_smart($_GET['id']);
     29
     30$result = $sql->query("SELECT account,race FROM `character` WHERE guid = $id LIMIT 1");
     31
     32if ($sql->num_rows($result)){
    3333        //resrict by owner's gmlvl
    34         $owner_acc_id = $mysql->result($result, 0, 'account');
    35         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    36         $query = $mysql->query("SELECT gmlevel,username FROM account WHERE id = $owner_acc_id");
    37         $owner_gmlvl = $mysql->result($query, 0, 'gmlevel');
    38         $owner_name = $mysql->result($query, 0, 'username');
    39 
    40         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     34        $owner_acc_id = $sql->result($result, 0, 'account');
     35        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     36        $query = $sql->query("SELECT gmlevel,username FROM account WHERE id = $owner_acc_id");
     37        $owner_gmlvl = $sql->result($query, 0, 'gmlevel');
     38        $owner_name = $sql->result($query, 0, 'username');
     39
     40        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    4141       
    4242        if( !$user_lvl && !$server[$realm_id]['both_factions']){
    43                 $side_p = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2;
    44                 $result_1 = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' LIMIT 1");
    45                 if ($mysql->num_rows($result)){
    46                         $side_v = (in_array($mysql->result($result_1, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2;
     43                $side_p = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2;
     44                $result_1 = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' LIMIT 1");
     45                if ($sql->num_rows($result)){
     46                        $side_v = (in_array($sql->result($result_1, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2;
    4747                } else $side_v = 0;
    4848                unset($result_1);
     
    5454 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)){
    5555
    56         $result = $mysql->query("SELECT data,name,race,class,position_x,position_y,map,online,totaltime FROM `character` WHERE guid = '$id'");
    57         $char = $mysql->fetch_row($result);
     56        $result = $sql->query("SELECT data,name,race,class,zone,map,online,totaltime FROM `character` WHERE guid = '$id'");
     57        $char = $sql->fetch_row($result);
    5858        $char_data = explode(' ',$char[0]);
    5959
    60         $online = ($char[7]) ? $lang_char['online'] : $lang_char['offline'];
     60        $online = ($char[6]) ? $lang_char['online'] : $lang_char['offline'];
    6161
    6262        if($char_data[CHAR_DATA_OFFSET_GUILD_ID]){
    63                 $query = $mysql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");
    64                 $guild_name = $mysql->result($query, 0, 'name');
     63                $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");
     64                $guild_name = $sql->result($query, 0, 'name');
    6565                if ($user_lvl > 0 ) $guild_name = "<a href=\"guild.php?action=view_guild&amp;error=3&amp;id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>";
    6666                if ($char_data[CHAR_DATA_OFFSET_GUILD_RANK]){
    67                         $guild_rank_query = $mysql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$char_data[CHAR_DATA_OFFSET_GUILD_RANK]}'");
    68                         $guild_rank = $mysql->result($guild_rank_query, 0, 'rname');
     67                        $guild_rank_query = $sql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$char_data[CHAR_DATA_OFFSET_GUILD_RANK]}'");
     68                        $guild_rank = $sql->result($guild_rank_query, 0, 'rname');
    6969                        } else $guild_rank = $lang_char['guild_leader'];
    7070        } else {
     
    128128                else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border\" alt=\"\" />";
    129129$output .= "</td>
    130     <td class=\"half_line\" colspan=\"4\">".get_map_name($char[6])." - ".get_zone_name($char[6], $char[4], $char[5])."</td>
     130    <td class=\"half_line\" colspan=\"4\">".get_map_name($char[5])." - ".get_zone_name($char[4])."</td>
    131131    <td width=\"6%\">";
    132132        if (!empty($equiped_items[10][1])) $output .= maketooltip("<img src=\"{$equiped_items[10][1]}\" class=\"icon_border\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_GLOVES]}", $equiped_items[10][0], "item_tooltip", "target=\"_blank\"");
     
    299299if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
    300300        //total time played
    301         $tot_time = $char[8];
     301        $tot_time = $char[7];
    302302        $tot_days = (int)($tot_time/86400);
    303303        $tot_time = $tot_time - ($tot_days*86400);
     
    333333                        }
    334334 } else {
    335                 $mysql->close();
     335                $sql->close();
    336336                error($lang_char['no_permission']);
    337337                }
    338338
    339339} else error($lang_char['no_char_found']);
    340 $mysql->close();
     340$sql->close();
    341341}
    342342
     
    351351if (empty($_GET['id'])) error($lang_global['empty_fields']);
    352352
    353 $mysql = new MySQL;
    354 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    355 
    356 $id = $mysql->quote_smart($_GET['id']);
    357 
    358 $result = $mysql->query("SELECT account FROM `character` WHERE guid = '$id' LIMIT 1");
    359 
    360 if ($mysql->num_rows($result)){
    361         $owner_acc_id = $mysql->result($result, 0, 'account');
    362         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    363         $query = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
    364         $owner_gmlvl = $mysql->result($query, 0, 'gmlevel');
    365         $owner_name = $mysql->result($query, 0, 'username');
     353$sql = new SQL;
     354$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     355
     356$id = $sql->quote_smart($_GET['id']);
     357
     358$result = $sql->query("SELECT account FROM `character` WHERE guid = '$id' LIMIT 1");
     359
     360if ($sql->num_rows($result)){
     361        $owner_acc_id = $sql->result($result, 0, 'account');
     362        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     363        $query = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
     364        $owner_gmlvl = $sql->result($query, 0, 'gmlevel');
     365        $owner_name = $sql->result($query, 0, 'username');
    366366
    367367if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
    368368
    369         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    370 
    371         $result = $mysql->query("SELECT name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) FROM `character` WHERE guid = '$id'");
    372         $char = $mysql->fetch_row($result);
    373 
    374         $result = $mysql->query("SELECT bag,slot,item,item_template FROM character_inventory WHERE guid = '$id' ORDER BY bag,slot");
     369        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     370
     371        $result = $sql->query("SELECT name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) FROM `character` WHERE guid = '$id'");
     372        $char = $sql->fetch_row($result);
     373
     374        $result = $sql->query("SELECT bag,slot,item,item_template FROM character_inventory WHERE guid = '$id' ORDER BY bag,slot");
    375375        $bag = array(
    376376                0=>array(),
     
    388388                4=>array(),
    389389                5=>array(),
    390                 6=>array()
     390                6=>array(),
     391                7=>array()
    391392                );
    392393       
     
    394395        $bag_id = array();
    395396        $equiped_bag_id = array(0,0,0,0,0);
    396         $equip_bnk_bag_id = array(0,0,0,0,0,0,0);
     397        $equip_bnk_bag_id = array(0,0,0,0,0,0,0,0);
    397398       
    398399
    399         while ($slot = $mysql->fetch_row($result))
     400        while ($slot = $sql->fetch_row($result))
    400401        {
    401402                if ($slot[0] == 0 && $slot[1] > 18)
     
    404405                        {
    405406                                $bag_id[$slot[2]] = ($slot[1]-18);
    406                                 $equiped_bag_id[$slot[1]-18] = array($slot[3], $mysql->result($mysql->query("SELECT ContainerSlots FROM item_template WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));
     407                                $equiped_bag_id[$slot[1]-18] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM item_template WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));
    407408                        }
    408409                        elseif($slot[1] < 39) // SLOT 23 TO 38 (BackPack)
     
    416417                                $bank[0][$slot[1]-39] = $slot[3];
    417418                        }
    418                         elseif($slot[1] < 73) // SLOT 67 TO 72 (Bank Bags)
     419                        elseif($slot[1] < 74) // SLOT 67 TO 73 (Bank Bags)
    419420                        {
    420421                                $bank_bag_id[$slot[2]] = ($slot[1]-66);
    421                                 $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $mysql->result($mysql->query("SELECT ContainerSlots FROM item_template WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));
     422                                $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM item_template WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'));
    422423                        }
    423424                }
     
    455456<table class=\"lined\" style=\"width: 700px;\">
    456457  <tr>
    457     <th><img class=\"bag_icon\" src=\"".get_icon(3960)."\" alt=\"\" />{$lang_char['backpack']}</th>
    458     <th>";
     458   <th>";
    459459        if($equiped_bag_id[1]){
    460460                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[1][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[1][0]}", get_item_name($equiped_bag_id[1][0]), "item_tooltip", "target=\"_blank\"");
    461                 $output .= "{$lang_item['bag']} I ({$equiped_bag_id[1][1]} {$lang_item['slots']})";
    462         }
    463         $output .= "</th><th>";
     461                $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equiped_bag_id[1][1]} {$lang_item['slots']})</font";
     462        }
     463$output .= "</th><th>";
    464464        if($equiped_bag_id[2]){
    465465                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[2][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[2][0]}", get_item_name($equiped_bag_id[2][0]), "item_tooltip", "target=\"_blank\"");
    466                 $output .= "{$lang_item['bag']} II ({$equiped_bag_id[2][1]} {$lang_item['slots']})";
    467         }
    468         $output .= "</th>
     466                $output .= "{$lang_item['bag']} II<br /><font class=\"small\">({$equiped_bag_id[2][1]} {$lang_item['slots']})</font>";
     467        }
     468$output .= "</th><th>";
     469        if($equiped_bag_id[3]){
     470                        $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[3][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[3][0]}", get_item_name($equiped_bag_id[3][0]), "item_tooltip", "target=\"_blank\"");
     471                        $output .= "{$lang_item['bag']} III<br /><font class=\"small\">({$equiped_bag_id[3][1]} {$lang_item['slots']})</font>";
     472                }
     473$output .= "</th><th>";
     474        if($equiped_bag_id[4]){
     475                        $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[4][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[4][0]}", get_item_name($equiped_bag_id[4][0]), "item_tooltip", "target=\"_blank\"");
     476                        $output .= "{$lang_item['bag']} IV<br /><font class=\"small\">({$equiped_bag_id[4][1]} {$lang_item['slots']})</font>";
     477                }
     478$output .= "</th>
    469479  </tr>
    470480  <tr>";
    471481 
    472   $output .= "<td class=\"bag\" align=\"center\"><div style=\"width:".(4*43)."px;height:".(ceil(16/4)*41)."px;\">";
    473   foreach ($bag[0] as $pos => $item){
    474         $output .= "<div style=\"left:".($pos%4*42)."px;top:".(floor($pos/4)*41)."px;\">";
    475         $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />".($item[1] ? ($item[1]+1) : ""), "$item_datasite{$item[0]}", get_item_name($item[0]), "item_tooltip", "target=\"_blank\"");
    476         $output .= "</div>";
    477   }
    478   $output .= "</div></td>";
    479  
    480482  for($t = 1; $t < count($bag); $t++){
    481         if($t == 3){
    482 
    483                 $money_gold = (int)($char[3]/10000);
    484                 $money_silver = (int)(($char[3]-$money_gold*10000)/100);
    485                 $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100);
    486 
    487           $output .= "<tr>
    488                 <td rowspan=\"2\" class=\"hidden\">
    489                         {$lang_char['gold']}:
    490                         $money_gold <img src=\"img/gold.gif\" class=\"no_border\" alt=\"\" />
    491                         $money_silver <img src=\"img/silver.gif\" class=\"no_border\" alt=\"\" />
    492                         $money_cooper <img src=\"img/copper.gif\" class=\"no_border\" alt=\"\" />
    493                 </td>
    494                 <th>";
    495                 if($equiped_bag_id[3]){
    496                         $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[3][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[3][0]}", get_item_name($equiped_bag_id[3][0]), "item_tooltip", "target=\"_blank\"");
    497                         $output .= "{$lang_item['bag']} III ({$equiped_bag_id[3][1]} {$lang_item['slots']})";
    498                 }
    499                 $output .= "</th><th>";
    500                 if($equiped_bag_id[4]){
    501                         $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[4][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[4][0]}", get_item_name($equiped_bag_id[4][0]), "item_tooltip", "target=\"_blank\"");
    502                         $output .= "{$lang_item['bag']} IV ({$equiped_bag_id[4][1]} {$lang_item['slots']})";
    503                 }
    504                 $output .= "</th>
    505           </tr>";
    506         }
     483    $output .= "<td class=\"bag\" valign=\"bottom\" align=\"center\">
     484                <div style=\"width:".(4*43)."px;height:".(ceil($equiped_bag_id[$t][1]/4)*41)."px;\">";
    507485       
    508     $output .= "<td class=\"bag\" align=\"center\"><div style=\"width:".(4*43)."px;height:".(ceil($equiped_bag_id[$t][1]/4)*41)."px;\">";
    509    
    510486        $dsp = $equiped_bag_id[$t][1]%4;
    511487        if ($dsp) $output .= "<div class=\"no_slot\" /></div>";
    512        
    513     foreach ($bag[$t] as $pos => $item){
     488        foreach ($bag[$t] as $pos => $item){
    514489          $output .= "<div style=\"left:".(($pos+$dsp)%4*42)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">";
    515490          $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />".($item[1] ? ($item[1]+1) : ""), "$item_datasite{$item[0]}", get_item_name($item[0]), "item_tooltip", "target=\"_blank\"");
     
    519494  }
    520495
    521 $output .= "</tr></table>
    522 
    523 <table class=\"lined\" style=\"width: 700px;\">
    524                 <tr><th colspan=\"3\">{$lang_char['bank_items']}</th></tr>
    525                 <tr>
    526                         <td colspan=\"3\" width=\"700\" class=\"bag\" align=\"center\">
    527                         <div style=\"width:".(14*43)."px;height:".(ceil(24/14)*41)."px;\">";
    528 
    529   foreach ($bank[0] as $pos => $item){
    530         $output .= "<div style=\"left:".($pos%14*43)."px;top:".(floor($pos/14)*41)."px;\">";
    531         $output .= maketooltip("<img src=\"".get_icon($item)."\" class=\"inv_icon\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\"");
    532         $output .= "</div>";
    533   }
    534   $output .= "</div>
    535                         </td>
    536                 </tr>
    537                 <tr>
    538                         <th>";
    539                         if($equip_bnk_bag_id[1]){
    540                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[1][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[1][0]}", get_item_name($equip_bnk_bag_id[1][0]), "item_tooltip", "target=\"_blank\"");
    541                                 $output .= "{$lang_item['bag']} I<br />({$equip_bnk_bag_id[1][1]} {$lang_item['slots']})";
    542                         }
    543                         $output .= "</th><th>";
    544                         if($equip_bnk_bag_id[2]){
    545                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[2][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[2][0]}", get_item_name($equip_bnk_bag_id[2][0]), "item_tooltip", "target=\"_blank\"");
    546                                 $output .= "{$lang_item['bag']} II<br />({$equip_bnk_bag_id[2][1]} {$lang_item['slots']})";
    547                         }
    548                         $output .= "</th><th>";
    549                         if($equip_bnk_bag_id[3]){
    550                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[3][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[3][0]}", get_item_name($equip_bnk_bag_id[3][0]), "item_tooltip", "target=\"_blank\"");
    551                                 $output .= "{$lang_item['bag']} III<br />({$equip_bnk_bag_id[3][1]} {$lang_item['slots']})";
    552                         }
    553                         $output .= "</th>
    554                 </tr>
    555                 <tr>";
     496$output .= "</tr>
     497        <tr>
     498                <th colspan=\"2\" align=\"left\">
     499                        <img class=\"bag_icon\" src=\"".get_icon(3960)."\" alt=\"\" align=\"absmiddle\" style=\"margin-left:100px;\" />
     500                        <font style=\"margin-left:30px;\">{$lang_char['backpack']}</font>
     501                </th>
     502                <th colspan=\"2\">
     503                        {$lang_char['bank_items']}
     504                </th>
     505        </tr>
     506        <tr>
     507                <td colspan=\"2\" class=\"bag\" align=\"center\" height=\"220px\">
     508                <div style=\"width:".(4*43)."px;height:".(ceil(16/4)*41)."px;\">";
     509
     510                foreach ($bag[0] as $pos => $item){
     511                        $output .= "<div style=\"left:".($pos%4*42)."px;top:".(floor($pos/4)*41)."px;\">";
     512                        $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />".($item[1] ? ($item[1]+1) : ""), "$item_datasite{$item[0]}", get_item_name($item[0]), "item_tooltip", "target=\"_blank\"");
     513                        $output .= "</div>";
     514                }
     515               
     516        $money_gold = (int)($char[3]/10000);
     517        $money_silver = (int)(($char[3]-$money_gold*10000)/100);
     518        $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100);                     
     519
     520$output .= "</div>
     521                        <div style=\"text-align:right;width:168px;background-image:none;background-color:#393936;padding:2px;\">
     522                                <b>
     523                                $money_gold <img src=\"img/gold.gif\" alt=\"\" align=\"absmiddle\" />
     524                                $money_silver <img src=\"img/silver.gif\" alt=\"\" align=\"absmiddle\" />
     525                                $money_cooper <img src=\"img/copper.gif\" alt=\"\" align=\"absmiddle\" />
     526                                </b>
     527                        ";
     528       
     529$output .= "</div>
     530                </td>
     531                <td colspan=\"2\" class=\"bank\" align=\"center\">
     532                <div style=\"width:".(7*43)."px;height:".(ceil(24/7)*41)."px;\">";
     533
     534                foreach ($bank[0] as $pos => $item){
     535                        $output .= "<div style=\"left:".($pos%7*43)."px;top:".(floor($pos/7)*41)."px;\">";
     536                        $output .= maketooltip("<img src=\"".get_icon($item)."\" class=\"inv_icon\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\"");
     537                        $output .= "</div>";
     538                }
     539               
     540$output .= "</div>
     541                </td>
     542        </tr>
     543        <tr>
     544                <th>";
     545        if($equip_bnk_bag_id[1]){
     546                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[1][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[1][0]}", get_item_name($equip_bnk_bag_id[1][0]), "item_tooltip", "target=\"_blank\"");
     547                $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equip_bnk_bag_id[1][1]} {$lang_item['slots']})</font>";
     548        }
     549$output .= "</th><th>";
     550        if($equip_bnk_bag_id[2]){
     551                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[2][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[2][0]}", get_item_name($equip_bnk_bag_id[2][0]), "item_tooltip", "target=\"_blank\"");
     552                $output .= "{$lang_item['bag']} II<br /><font class=\"small\">({$equip_bnk_bag_id[2][1]} {$lang_item['slots']})</font>";
     553        }
     554$output .= "</th><th>";
     555        if($equip_bnk_bag_id[3]){
     556                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[3][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[3][0]}", get_item_name($equip_bnk_bag_id[3][0]), "item_tooltip", "target=\"_blank\"");
     557                $output .= "{$lang_item['bag']} III<br /><font class=\"small\">({$equip_bnk_bag_id[3][1]} {$lang_item['slots']})</font>";
     558        }
     559$output .= "</th><th>";
     560        if($equip_bnk_bag_id[4]){
     561                $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[4][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[4][0]}", get_item_name($equip_bnk_bag_id[4][0]), "item_tooltip", "target=\"_blank\"");
     562                $output .= "{$lang_item['bag']} IV<br /><font class=\"small\">({$equip_bnk_bag_id[4][1]} {$lang_item['slots']})</font>";
     563        }
     564$output .= "</th>
     565        </tr>
     566        <tr>";
     567 
    556568  for($t=1; $t < count($bank); $t++){
    557         if($t==4){
     569        if($t==5){
    558570                $output .= "</tr>
    559571                <tr>
    560572                        <th>";
    561                         if($equip_bnk_bag_id[4]){
    562                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[4][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[4][0]}", get_item_name($equip_bnk_bag_id[4][0]), "item_tooltip", "target=\"_blank\"");
    563                                 $output .= "{$lang_item['bag']} IV<br />({$equip_bnk_bag_id[4][1]} {$lang_item['slots']})";
    564                         }
    565                         $output .= "</th><th>";
    566                         if($equip_bnk_bag_id[5]){
    567                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[5][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[5][0]}", get_item_name($equip_bnk_bag_id[5][0]), "item_tooltip", "target=\"_blank\"");
    568                                 $output .= "{$lang_item['bag']} V<br />({$equip_bnk_bag_id[5][1]} {$lang_item['slots']})";
    569                         }
    570                         $output .= "</th><th>";
    571                         if($equip_bnk_bag_id[6]){
    572                                 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[6][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[6][0]}", get_item_name($equip_bnk_bag_id[6][0]), "item_tooltip", "target=\"_blank\"");
    573                                 $output .= "{$lang_item['bag']} VI<br />({$equip_bnk_bag_id[6][1]} {$lang_item['slots']})";
    574                         }
    575                         $output .= "</th>
     573                if($equip_bnk_bag_id[5]){
     574                        $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[5][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[5][0]}", get_item_name($equip_bnk_bag_id[5][0]), "item_tooltip", "target=\"_blank\"");
     575                        $output .= "{$lang_item['bag']} V<br /><font class=\"small\">({$equip_bnk_bag_id[5][1]} {$lang_item['slots']})</font>";
     576                }
     577                $output .= "</th><th>";
     578                if($equip_bnk_bag_id[6]){
     579                        $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[6][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[6][0]}", get_item_name($equip_bnk_bag_id[6][0]), "item_tooltip", "target=\"_blank\"");
     580                        $output .= "{$lang_item['bag']} VI<br /><font class=\"small\">({$equip_bnk_bag_id[6][1]} {$lang_item['slots']})</font>";
     581                }
     582                $output .= "</th><th>";
     583                if($equip_bnk_bag_id[7]){
     584                        $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equip_bnk_bag_id[7][0])."\" alt=\"\" />", "$item_datasite{$equip_bnk_bag_id[7][0]}", get_item_name($equip_bnk_bag_id[7][0]), "item_tooltip", "target=\"_blank\"");
     585                        $output .= "{$lang_item['bag']} VII<br /><font class=\"small\">({$equip_bnk_bag_id[7][1]} {$lang_item['slots']})</font>";
     586                }
     587                $output .= "</th>
     588                        <th></th>
    576589                </tr>
    577590                <tr>";
    578591        }
    579592       
    580         $output .= "<td class=\"bag\" align=\"center\"><div style=\"width:".(4*43)."px;height:".(ceil($equip_bnk_bag_id[$t][1]/4)*41)."px;\">";
     593        $output .= "<td class=\"bank\" align=\"center\">
     594                <div style=\"width:".(4*43)."px;height:".(ceil($equip_bnk_bag_id[$t][1]/4)*41)."px;\">";
    581595       
    582596        $dsp=$equip_bnk_bag_id[$t][1]%4;
    583597        if ($dsp) $output .= "<div class=\"no_slot\" /></div>";
    584        
    585     foreach ($bank[$t] as $pos => $item){
    586           $output .= "<div style=\"left:".(($pos+$dsp)%4*43)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">";
    587           $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($item)."\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\"");
    588           $output .= "</div>";
    589     }
    590     $output .= "</td>";
     598        foreach ($bank[$t] as $pos => $item){
     599                $output .= "<div style=\"left:".(($pos+$dsp)%4*43)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">";
     600                $output .= maketooltip("<img src=\"".get_icon($item)."\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\"");
     601                $output .= "</div>";
     602        }
     603        $output .= "</td>";
    591604  }
    592605
    593 $output .= "</tr>
     606$output .= "<td class=\"bank\"></td></tr>
    594607                </table>
    595608                </div><br />
     
    609622
    610623 } else {
    611                 $mysql->close();
     624                $sql->close();
    612625                error($lang_char['no_permission']);
    613626                }
    614627
    615628} else error($lang_char['no_char_found']);
    616 $mysql->close();
     629$sql->close();
    617630}
    618631
     
    627640 if (empty($_GET['id'])) error($lang_global['empty_fields']);
    628641
    629  $mysql = new MySQL;
    630  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    631 
    632  $id = $mysql->quote_smart($_GET['id']);
    633  $result = $mysql->query("SELECT account,name,race,class FROM `character` WHERE guid = '$id' LIMIT 1");
    634 
    635  if ($mysql->num_rows($result)){
    636         $char = $mysql->fetch_row($result);
     642 $sql = new SQL;
     643 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     644
     645 $id = $sql->quote_smart($_GET['id']);
     646 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : 1;
     647 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 0;
     648 $dir = ($dir) ? 0 : 1;
     649 $result = $sql->query("SELECT account,name,race,class FROM `character` WHERE guid = '$id' LIMIT 1");
     650
     651 if ($sql->num_rows($result)){
     652        $char = $sql->fetch_row($result);
    637653       
    638         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    639         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'");
    640         $owner_gmlvl  = $mysql->result($result, 0, 'gmlevel');
    641         $owner_name       = $mysql->result($result, 0, 'username');
     654        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     655        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'");
     656        $owner_gmlvl  = $sql->result($result, 0, 'gmlevel');
     657        $owner_name       = $sql->result($result, 0, 'username');
    642658
    643659        if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
    644           $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    645 
    646           $result = $mysql->query("SELECT quest,status FROM character_queststatus WHERE guid ='$id' AND ( status = 3 OR status = 1 ) ORDER BY status DESC");
     660          $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     661
     662          $result = $sql->query("SELECT quest,status FROM character_queststatus WHERE guid ='$id' AND ( status = 3 OR status = 1 ) ORDER BY status DESC");
    647663          $output .= "<center>
    648664                <div id=\"tab\">
     
    660676                <table class=\"lined\" style=\"width: 550px;\">
    661677                <tr>";
    662           if ($user_lvl) $output .= "<th width=\"14%\">{$lang_char['quest_id']}</th>";
    663           $output .= "<th width=\"5%\"></th>
    664                         <th width=\"80%\">{$lang_char['quest_title']}</th>
    665                         <th width=\"1%\"></th>";
    666 
    667           if ($mysql->num_rows($result)){
    668                 while ($quest = $mysql->fetch_row($result)){
    669                   $query1 = $mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
    670                   $quest_templ = $mysql->fetch_row($query1);
    671 
     678          if ($user_lvl) $output .= "<th width=\"10%\"><a href=\"char.php?id=$id&amp;action=char_quest&amp;order_by=0&amp;dir=$dir\">".($order_by==0 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_id']}</a></th>";
     679          $output .= "<th width=\"7%\"><a href=\"char.php?id=$id&amp;action=char_quest&amp;order_by=1&amp;dir=$dir\">".($order_by==1 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_level']}</a></th>
     680                        <th width=\"78%\"><a href=\"char.php?id=$id&amp;action=char_quest&amp;order_by=2&amp;dir=$dir\">".($order_by==2 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_title']}</a></th>
     681                        <th width=\"5%\"><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" border=\"0\" /></a></th>";
     682
     683          $quests_1 = array();
     684          $quests_3 = array();
     685                       
     686          if ($sql->num_rows($result)){
     687                while ($quest = $sql->fetch_row($result)){
     688                  $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
     689                  $quest_info = $sql->fetch_row($query1);
     690                  if($quest[1]==1)
     691                        array_push($quests_1, array($quest[0], $quest_info[0], $quest_info[1]));
     692                  else
     693                        array_push($quests_3, array($quest[0], $quest_info[0], $quest_info[1]));
     694            }
     695                aasort($quests_1, $order_by, $dir);
     696                aasort($quests_3, $order_by, $dir);
     697               
     698                foreach ($quests_3 as $data){
    672699                  $output .= "<tr>";
    673                   if($user_lvl) $output .= "<td>$quest[0]</td>";
    674                   $output .= "<td>($quest_templ[0])</td>
    675                         <td align=\"left\"><a href=\"$quest_datasite$quest[0]\" target=\"_blank\">$quest_templ[1]</a></td>
    676                         <td><img src=\"img/aff_".(($quest[1]==1) ? "tick" : "qst").".png\" width=\"14\" height=\"14\" /></td></tr>";
    677             }
    678           } else $output .= "<tr><td colspan=\"3\"><p>{$lang_char['no_act_quests']}</p></td></tr>";
     700                  if($user_lvl) $output .= "<td>$data[0]</td>";
     701                  $output .= "<td>($data[1])</td>
     702                        <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td>
     703                        <td><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" /></td></tr>";
     704                }
     705               
     706                if(count($quests_1)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "4" : "3")."\" align=\"left\"></th></tr>";
     707                foreach ($quests_1 as $data){
     708                  $output .= "<tr>";
     709                  if($user_lvl) $output .= "<td>$data[0]</td>";
     710                  $output .= "<td>($data[1])</td>
     711                        <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td>
     712                        <td><img src=\"img/aff_tick.png\" width=\"14\" height=\"14\" /></td></tr>";
     713                }
     714               
     715          } else $output .= "<tr><td colspan=\"".($user_lvl ? "4" : "3")."\"><p>{$lang_char['no_act_quests']}</p></td></tr>";
    679716
    680717          $output .= "</table></div><br />
     
    697734        else
    698735        {
    699           $mysql->close();
     736          $sql->close();
    700737          error($lang_char['no_permission']);
    701738        }
    702739 }
    703740 else error($lang_char['no_char_found']);
    704  $mysql->close();
     741 $sql->close();
    705742}
    706743
     
    715752if (empty($_GET['id'])) error($lang_global['empty_fields']);
    716753
    717 $mysql = new MySQL;
    718 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    719 
    720 $id = $mysql->quote_smart($_GET['id']);
    721 $result = $mysql->query("SELECT account,name,race,class FROM `character` WHERE guid = '$id' LIMIT 1");
    722 
    723 if ($mysql->num_rows($result)){
    724         $char = $mysql->fetch_row($result);
    725         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    726         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'");
    727         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    728         $owner_name = $mysql->result($result, 0, 'username');
     754$sql = new SQL;
     755$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     756
     757$id = $sql->quote_smart($_GET['id']);
     758$result = $sql->query("SELECT account,name,race,class FROM `character` WHERE guid = '$id' LIMIT 1");
     759
     760if ($sql->num_rows($result)){
     761        $char = $sql->fetch_row($result);
     762        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     763        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'");
     764        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     765        $owner_name = $sql->result($result, 0, 'username');
    729766
    730767 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
    731768
    732         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    733         $result = $mysql->query("SELECT faction, standing, flags FROM character_reputation WHERE guid ='$id' AND (flags = 1 OR flags = 17)");
     769        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     770        $result = $sql->query("SELECT faction, standing, flags FROM character_reputation WHERE guid ='$id' AND (flags = 1 OR flags = 17)");
    734771
    735772 $output .= "<center>
     
    769806 );
    770807 
    771         if ($mysql->num_rows($result)){
    772                 while ($fact = $mysql->fetch_row($result)){
     808        if ($sql->num_rows($result)){
     809                while ($fact = $sql->fetch_row($result)){
    773810                        $temp_out[get_faction_tree($fact[0])][0] .= "<tr><td width=\"60%\">".get_faction_name($fact[0])."</td>
    774811                                                                                                        <td width=\"40%\">$fact[1]</td></tr>";
     
    795832
    796833 } else {
    797                 $mysql->close();
     834                $sql->close();
    798835                error($lang_char['no_permission']);
    799836                }
    800837
    801838} else error($lang_char['no_char_found']);
    802 $mysql->close();
     839$sql->close();
    803840
    804841}
     
    814851if (empty($_GET['id'])) error($lang_global['empty_fields']);
    815852
    816 $mysql = new MySQL;
    817 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    818 
    819 $id = $mysql->quote_smart($_GET['id']);
    820 $result = $mysql->query("SELECT account FROM `character` WHERE guid = '$id'");
    821 
    822 if ($mysql->num_rows($result) == 1){
    823         $owner_acc_id = $mysql->result($result, 0, 'account');
    824         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    825         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
    826         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    827         $owner_name = $mysql->result($result, 0, 'username');
     853$sql = new SQL;
     854$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     855
     856$id = $sql->quote_smart($_GET['id']);
     857$order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : 1;
     858$dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
     859$dir = ($dir) ? 0 : 1;
     860
     861$result = $sql->query("SELECT account FROM `character` WHERE guid = '$id'");
     862
     863if ($sql->num_rows($result) == 1){
     864        $owner_acc_id = $sql->result($result, 0, 'account');
     865        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     866        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
     867        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     868        $owner_name = $sql->result($result, 0, 'username');
    828869
    829870 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
    830871
    831         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    832 
    833         $result = $mysql->query("SELECT data,name,race,class,CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character` WHERE guid = '$id'");
    834         $char = $mysql->fetch_row($result);
     872        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     873
     874        $result = $sql->query("SELECT data,name,race,class,CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character` WHERE guid = '$id'");
     875        $char = $sql->fetch_row($result);
    835876        $char_data = explode(' ',$char[0]);
    836877
     
    850891        <table class=\"lined\" style=\"width: 550px;\">
    851892        <tr>
    852                 <th colspan=\"3\" align=\"left\">{$lang_char['skills']}</th></tr>";
     893                <th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['skills']}</th></tr>
     894        <tr>"
     895                .($user_lvl ? "<th><a href=\"char.php?id=$id&amp;action=char_skill&amp;order_by=0&amp;dir=$dir\">".($order_by==0 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['skill_id']}</a></th>" : "")
     896                ."<th align=\"right\"><a href=\"char.php?id=$id&amp;action=char_skill&amp;order_by=1&amp;dir=$dir\">".($order_by==1 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\"  /> " : "")."{$lang_char['skill_name']}</a></th>
     897                <th><a href=\"char.php?id=$id&amp;action=char_skill&amp;order_by=2&amp;dir=$dir\">".($order_by==2 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['skill_value']}</a></th>
     898        </tr>";
    853899        require_once("scripts/id_tab.php");
    854900       
     
    858904               
    859905 $skill_rank_array = array(
    860         75 => 'Apprentice',
    861         150 => 'Journeyman',
    862         225 => 'Expert',
    863         300 => 'Artisan',
    864         350 => 'Master',
    865         375 => 'Inherent',
    866         385 => 'Wise'
     906        75 => $lang_char['apprentice'],
     907        150 => $lang_char['journeyman'],
     908        225 => $lang_char['expert'],
     909        300 => $lang_char['artisan'],
     910        350 => $lang_char['master'],
     911        375 => $lang_char['inherent'],
     912        385 => $lang_char['wise']
    867913        );
    868914
     
    870916        if (($char_data[$i])&&(get_skill_name($char_data[$i] & 0x0000FFFF ))){
    871917                $temp = unpack("S", pack("L", $char_data[$i+1]));
    872                 $skill = ($char_data[$i]& 0x0000FFFF);
     918                $skill = ($char_data[$i] & 0x0000FFFF);
    873919               
    874920                if( $skill == 185 || $skill == 129 || $skill == 356 || $skill == 762)
     
    891937 unset($char_data);
    892938
    893  asort($skill_array);
    894  asort($prof_1_array);
    895  asort($prof_2_array);
    896  
     939 aasort($skill_array, $order_by, $dir);
     940 aasort($prof_1_array, $order_by, $dir);
     941 aasort($prof_2_array, $order_by, $dir);
     942  
    897943 foreach ($skill_array as $data){
    898944        $max = ($data[2] < $char[4]*5) ? $char[4]*5 : $data[2];
    899         $output .= "<tr>
    900                                  <td>$data[0]</td>
    901                                  <td align=\"right\">$data[1]</td>
    902                                  <td class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\"><span>$data[2]/$max</span></td>
     945        $output .= "<tr>"
     946                                .($user_lvl ? "<td>$data[0]</td>" : "")
     947                                ."      <td align=\"right\">$data[1]</td>
     948                                        <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\">
     949                                                <span>$data[2]/$max</span>
     950                                        </td>
    903951                                </tr>";
    904952        }
    905953 
    906  if(count($prof_1_array)) $output .= "<tr><th colspan=\"3\" align=\"left\">{$lang_char['professions']} 1º</th></tr>";
     954 if(count($prof_1_array)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['professions']} 1º</th></tr>";
    907955 foreach ($prof_1_array as $data){
    908956        $max = ($data[2]<76 ? 75 : ($data[2]<151 ? 150 : ($data[2]<226 ? 225 : ($data[2]<301 ? 300 : ($data[2]<351 ? 350 : ($data[2]<376 ? 375 : 385))))));
    909         $output .= "<tr>
    910                                         <td>$data[0]</td>
    911                                         <td align=\"right\"><a href=\"{$skill_datasite}11.$data[0]\" target=\"_blank\">$data[1]</a></td>
    912                                         <td class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\">
     957        $output .= "<tr>"
     958                                .($user_lvl ? "<td>$data[0]</td>" : "")
     959                                ."      <td align=\"right\"><a href=\"{$skill_datasite}11.$data[0]\" target=\"_blank\">$data[1]</a></td>
     960                                        <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\">
    913961                                                <span>$data[2]/$max ({$skill_rank_array[$max]})</span>
    914962                                        </td>
    915963                                </tr>";
    916964 }
    917  if(count($prof_2_array)) $output .= "<tr><th colspan=\"3\" align=\"left\">{$lang_char['professions']} 2º</th></tr>";
     965 if(count($prof_2_array)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['professions']} 2º</th></tr>";
    918966 foreach ($prof_2_array as $data){
    919967        $max = ($data[2]<76 ? 75 : ($data[2]<151 ? 150 : ($data[2]<226 ? 225 : ($data[2]<301 ? 300 : ($data[2]<351 ? 350 : ($data[2]<376 ? 375 : 385))))));
    920         $output .= "<tr>
    921                                         <td>$data[0]</td>
    922                                         <td align=\"right\"><a href=\"{$skill_datasite}9.$data[0]\" target=\"_blank\">$data[1]</a></td>
    923                                         <td class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\">
     968        $output .= "<tr>"
     969                                .($user_lvl ? "<td>$data[0]</td>" : "")
     970                                ."      <td align=\"right\"><a href=\"{$skill_datasite}9.$data[0]\" target=\"_blank\">$data[1]</a></td>
     971                                        <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\">
    924972                                                <span>$data[2]/$max ({$skill_rank_array[$max]})</span>
    925973                                        </td>
     
    942990
    943991 } else {
    944                 $mysql->close();
     992                $sql->close();
    945993                error($lang_char['no_permission']);
    946994                }
    947995
    948996} else error($lang_char['no_char_found']);
    949 $mysql->close();
     997$sql->close();
    950998}
    951999
  • minimanager/char_edit.php

    r5 r19  
    2424if (empty($_GET['id'])) error($lang_global['empty_fields']);
    2525
    26 $mysql = new MySQL;
    27 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     26$sql = new SQL;
     27$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    2828 
    29 $id = $mysql->quote_smart($_GET['id']);
    30 
    31 $result = $mysql->query("SELECT account FROM `character` WHERE guid = '$id'");
    32 
    33 if ($mysql->num_rows($result)){
     29$id = $sql->quote_smart($_GET['id']);
     30
     31$result = $sql->query("SELECT account FROM `character` WHERE guid = '$id'");
     32
     33if ($sql->num_rows($result)){
    3434        //resrict by owner's gmlvl
    35         $owner_acc_id = $mysql->result($result, 0, 'account');
    36         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    37         $query = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
    38         $owner_gmlvl = $mysql->result($query, 0, 'gmlevel');
    39         $owner_name = $mysql->result($query, 0, 'username');
     35        $owner_acc_id = $sql->result($result, 0, 'account');
     36        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     37        $query = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
     38        $owner_gmlvl = $sql->result($query, 0, 'gmlevel');
     39        $owner_name = $sql->result($query, 0, 'username');
    4040
    4141 if ($user_lvl >= $owner_gmlvl){
    42         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    43 
    44         $result = $mysql->query("SELECT guid,account,data,name,race,class,position_x,position_y,map,online,totaltime,position_z FROM `character` WHERE guid = '$id'");
    45         $char = $mysql->fetch_row($result);
     42        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     43
     44        $result = $sql->query("SELECT guid,account,data,name,race,class,position_x,position_y,map,online,totaltime,position_z,zone      FROM `character` WHERE guid = '$id'");
     45        $char = $sql->fetch_row($result);
    4646        $char_data = explode(' ',$char[2]);
    4747
     
    5050
    5151        if($char_data[CHAR_DATA_OFFSET_GUILD_ID]){
    52                 $query = $mysql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");
    53                 $guild_name = $mysql->result($query, 0, 'name');
     52                $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");
     53                $guild_name = $sql->result($query, 0, 'name');
    5454                if ($user_lvl > 0 ) $guild_name = "<a href=\"guild.php?action=view_guild&amp;error=3&amp;id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>";
    5555                if ($char_data[CHAR_DATA_OFFSET_GUILD_RANK]){
    56                         $guild_rank_query = $mysql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$char_data[CHAR_DATA_OFFSET_GUILD_RANK]}'");
    57                         $guild_rank = $mysql->result($guild_rank_query, 0, 'rname');
     56                        $guild_rank_query = $sql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$char_data[CHAR_DATA_OFFSET_GUILD_RANK]}'");
     57                        $guild_rank = $sql->result($guild_rank_query, 0, 'rname');
    5858                        } else $guild_rank = $lang_char['guild_leader'];
    5959        } else {
     
    8282</tr>
    8383<tr>
    84  <td colspan=\"8\">".get_map_name($char[9])." - ".get_zone_name($char[8], $char[6], $char[7])."</td>
     84 <td colspan=\"8\">".get_map_name($char[9])." - ".get_zone_name($char[12])."</td>
    8585</tr>
    8686<tr>
     
    169169
    170170//inventory+bank items
    171         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    172         $sql = "SELECT bag,slot,item,item_template FROM character_inventory WHERE guid = '$id' ORDER BY bag,slot";
    173         $query2 = $mysql->query($sql);
     171        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     172        $query2 = $sql->query("SELECT bag,slot,item,item_template FROM character_inventory WHERE guid = '$id' ORDER BY bag,slot");
    174173
    175174        $inv = array();
    176175        $count = 0;
    177176       
    178         while ($slot = $mysql->fetch_row($query2)){
     177        while ($slot = $sql->fetch_row($query2)){
    179178                if ($slot[0] == 0) {
    180179                        if($slot[1] >= 23 && $slot[1] <= 62) {
     
    218217 //case of non auth request
    219218 } else {
    220                 $mysql->close();
     219                $sql->close();
    221220                error($lang_char['no_permission']);
    222221                exit();
     
    224223
    225224} else error($lang_char['no_char_found']);
    226 $mysql->close();
     225$sql->close();
    227226}
    228227
     
    237236if ( empty($_GET['id']) || empty($_GET['name']) ) error($lang_global['empty_fields']);
    238237
    239 $mysql = new MySQL;
    240 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    241 
    242 $id = $mysql->quote_smart($_GET['id']);
    243 
    244 $result = $mysql->query("SELECT account,online FROM `character` WHERE guid = '$id'");
    245 
    246 if ($mysql->num_rows($result)){
     238$sql = new SQL;
     239$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     240
     241$id = $sql->quote_smart($_GET['id']);
     242
     243$result = $sql->query("SELECT account,online FROM `character` WHERE guid = '$id'");
     244
     245if ($sql->num_rows($result)){
    247246//we cannot edit online chars
    248  if(!$mysql->result($result, 0, 'online')){
     247 if(!$sql->result($result, 0, 'online')){
    249248        //resrict by owner's gmlvl
    250         $owner_acc_id = $mysql->result($result, 0, 'account');
    251         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    252         $query = $mysql->query("SELECT gmlevel FROM account WHERE id ='$owner_acc_id'");
    253         $owner_gmlvl = $mysql->result($query, 0, 'gmlevel');
     249        $owner_acc_id = $sql->result($result, 0, 'account');
     250        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     251        $query = $sql->query("SELECT gmlevel FROM account WHERE id ='$owner_acc_id'");
     252        $owner_gmlvl = $sql->result($query, 0, 'gmlevel');
    254253
    255254  if ($user_lvl > $owner_gmlvl){
    256255
    257         if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     256        if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    258257                else $check = NULL;
    259258
    260         $new_name = $mysql->quote_smart($_GET['name']);
     259        $new_name = $sql->quote_smart($_GET['name']);
    261260       
    262         if (isset($_GET['tot_time'])) $new_tot_time = $mysql->quote_smart($_GET['tot_time']);
     261        if (isset($_GET['tot_time'])) $new_tot_time = $sql->quote_smart($_GET['tot_time']);
    263262                else $new_tot_time =  0;
    264         if (isset($_GET['res_holy'])) $new_res_holy = $mysql->quote_smart($_GET['res_holy']);
     263        if (isset($_GET['res_holy'])) $new_res_holy = $sql->quote_smart($_GET['res_holy']);
    265264                else $new_res_holy =  0;
    266         if (isset($_GET['res_arcane'])) $new_res_arcane = $mysql->quote_smart($_GET['res_arcane']);
     265        if (isset($_GET['res_arcane'])) $new_res_arcane = $sql->quote_smart($_GET['res_arcane']);
    267266                else $new_res_arcane =  0;
    268         if (isset($_GET['res_fire'])) $new_res_fire = $mysql->quote_smart($_GET['res_fire']);
     267        if (isset($_GET['res_fire'])) $new_res_fire = $sql->quote_smart($_GET['res_fire']);
    269268                else $new_res_fire =  0;
    270         if (isset($_GET['res_nature'])) $new_res_nature = $mysql->quote_smart($_GET['res_nature']);
     269        if (isset($_GET['res_nature'])) $new_res_nature = $sql->quote_smart($_GET['res_nature']);
    271270                else $new_res_nature =  0;
    272         if (isset($_GET['res_frost'])) $new_res_frost = $mysql->quote_smart($_GET['res_frost']);
     271        if (isset($_GET['res_frost'])) $new_res_frost = $sql->quote_smart($_GET['res_frost']);
    273272                else $new_res_frost =  0;
    274         if (isset($_GET['res_shadow'])) $new_res_shadow = $mysql->quote_smart($_GET['res_shadow']);
     273        if (isset($_GET['res_shadow'])) $new_res_shadow = $sql->quote_smart($_GET['res_shadow']);
    275274                else $new_res_shadow =  0;
    276         if (isset($_GET['attack_power'])) $new_attack_power = $mysql->quote_smart($_GET['attack_power']);
     275        if (isset($_GET['attack_power'])) $new_attack_power = $sql->quote_smart($_GET['attack_power']);
    277276                else $new_attack_power =  0;
    278         if (isset($_GET['range_attack_power'])) $new_range_attack_power = $mysql->quote_smart($_GET['range_attack_power']);
     277        if (isset($_GET['range_attack_power'])) $new_range_attack_power = $sql->quote_smart($_GET['range_attack_power']);
    279278                else $new_range_attack_power =  0;
    280         if (isset($_GET['money'])) $new_money = $mysql->quote_smart($_GET['money']);
     279        if (isset($_GET['money'])) $new_money = $sql->quote_smart($_GET['money']);
    281280                else $new_money =  0;
    282         if (isset($_GET['arena_points'])) $new_arena_points = $mysql->quote_smart($_GET['arena_points']);
     281        if (isset($_GET['arena_points'])) $new_arena_points = $sql->quote_smart($_GET['arena_points']);
    283282                else $new_arena_points =  0;
    284         if (isset($_GET['honor_points'])) $new_honor_points = $mysql->quote_smart($_GET['honor_points']);
     283        if (isset($_GET['honor_points'])) $new_honor_points = $sql->quote_smart($_GET['honor_points']);
    285284                else $new_honor_points =  0;
    286         if (isset($_GET['total_kills'])) $new_total_kills = $mysql->quote_smart($_GET['total_kills']);
     285        if (isset($_GET['total_kills'])) $new_total_kills = $sql->quote_smart($_GET['total_kills']);
    287286                else $new_total_kills =  0;
    288287       
     
    292291                error($lang_char['use_numeric']);
    293292
    294         if (isset($_GET['health'])) $new_health = $mysql->quote_smart($_GET['health']);
     293        if (isset($_GET['health'])) $new_health = $sql->quote_smart($_GET['health']);
    295294                else $new_health =  1;
    296         if (isset($_GET['mana'])) $new_mana = $mysql->quote_smart($_GET['mana']);
     295        if (isset($_GET['mana'])) $new_mana = $sql->quote_smart($_GET['mana']);
    297296                else $new_mana =  0;
    298         if (isset($_GET['str'])) $new_str = $mysql->quote_smart($_GET['str']);
     297        if (isset($_GET['str'])) $new_str = $sql->quote_smart($_GET['str']);
    299298                else $new_str =  1;
    300         if (isset($_GET['agi'])) $new_agi = $mysql->quote_smart($_GET['agi']);
     299        if (isset($_GET['agi'])) $new_agi = $sql->quote_smart($_GET['agi']);
    301300                else $new_agi =  1;
    302         if (isset($_GET['sta'])) $new_sta = $mysql->quote_smart($_GET['sta']);
     301        if (isset($_GET['sta'])) $new_sta = $sql->quote_smart($_GET['sta']);
    303302                else $new_sta =  1;
    304         if (isset($_GET['int'])) $new_int = $mysql->quote_smart($_GET['int']);
     303        if (isset($_GET['int'])) $new_int = $sql->quote_smart($_GET['int']);
    305304                else $new_int =  1;
    306         if (isset($_GET['spi'])) $new_spi = $mysql->quote_smart($_GET['spi']);
     305        if (isset($_GET['spi'])) $new_spi = $sql->quote_smart($_GET['spi']);
    307306                else $new_spi =  1;
    308         if (isset($_GET['exp'])) $new_exp = $mysql->quote_smart($_GET['exp']);
     307        if (isset($_GET['exp'])) $new_exp = $sql->quote_smart($_GET['exp']);
    309308                else $new_exp =  0;
    310         if (isset($_GET['armor'])) $new_armor = $mysql->quote_smart($_GET['armor']);
     309        if (isset($_GET['armor'])) $new_armor = $sql->quote_smart($_GET['armor']);
    311310                else $new_armor =  0;
    312         if (isset($_GET['block'])) $new_block = $mysql->quote_smart($_GET['block']);
     311        if (isset($_GET['block'])) $new_block = $sql->quote_smart($_GET['block']);
    313312                else $new_block =  0;
    314         if (isset($_GET['dodge'])) $new_dodge = $mysql->quote_smart($_GET['dodge']);
     313        if (isset($_GET['dodge'])) $new_dodge = $sql->quote_smart($_GET['dodge']);
    315314                else $new_dodge =  0;
    316         if (isset($_GET['parry'])) $new_parry = $mysql->quote_smart($_GET['parry']);
     315        if (isset($_GET['parry'])) $new_parry = $sql->quote_smart($_GET['parry']);
    317316                else $new_parry =  0;
    318         if (isset($_GET['crit'])) $new_crit = $mysql->quote_smart($_GET['crit']);
     317        if (isset($_GET['crit'])) $new_crit = $sql->quote_smart($_GET['crit']);
    319318                else $new_crit =  0;
    320         if (isset($_GET['range_crit'])) $new_range_crit = $mysql->quote_smart($_GET['range_crit']);
     319        if (isset($_GET['range_crit'])) $new_range_crit = $sql->quote_smart($_GET['range_crit']);
    321320                else $new_range_crit =  0;
    322321
     
    326325        ||(!is_numeric($new_crit))||(!is_numeric($new_range_crit))) error($lang_char['use_numeric']);
    327326
    328         $x = (isset($_GET['x'])) ? $mysql->quote_smart($_GET['x']) : 0;
    329         $y = (isset($_GET['y'])) ? $mysql->quote_smart($_GET['y']) : 0;
    330         $z = (isset($_GET['z'])) ? $mysql->quote_smart($_GET['z']) : 0;
    331         $map = (isset($_GET['map'])) ? $mysql->quote_smart($_GET['map']) : 0;
    332         $tp_to = (isset($_GET['tp_to'])) ? $mysql->quote_smart($_GET['tp_to']) : 0;
    333 
    334         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    335 
    336         $result = $mysql->query("SELECT data FROM `character` WHERE guid = '$id'");
    337         $char = $mysql->fetch_row($result);
     327        $x = (isset($_GET['x'])) ? $sql->quote_smart($_GET['x']) : 0;
     328        $y = (isset($_GET['y'])) ? $sql->quote_smart($_GET['y']) : 0;
     329        $z = (isset($_GET['z'])) ? $sql->quote_smart($_GET['z']) : 0;
     330        $map = (isset($_GET['map'])) ? $sql->quote_smart($_GET['map']) : 0;
     331        $tp_to = (isset($_GET['tp_to'])) ? $sql->quote_smart($_GET['tp_to']) : 0;
     332
     333        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     334
     335        $result = $sql->query("SELECT data FROM `character` WHERE guid = '$id'");
     336        $char = $sql->fetch_row($result);
    338337        $char_data = explode(' ',$char[0]);
    339338
     
    401400
    402401                                        sscanf($item_num, "a%d",$item_num);
    403                                         $result = $mysql->query("SELECT item FROM character_inventory WHERE guid = '$id' AND slot = $item_num AND bag = 0");
    404                                         $item_inst_id = $mysql->result($result, 0, 'item');
    405 
    406                                         $mysql->query("DELETE FROM character_inventory WHERE guid = '$id' AND slot = $item_num AND bag = 0");
    407                                         $mysql->query("DELETE FROM item_instance WHERE guid = '$item_inst_id' AND owner_guid = '$id'");
    408                                         $mysql->query("DELETE FROM item_text WHERE id = '$item_inst_id'");
     402                                        $result = $sql->query("SELECT item FROM character_inventory WHERE guid = '$id' AND slot = $item_num AND bag = 0");
     403                                        $item_inst_id = $sql->result($result, 0, 'item');
     404
     405                                        $sql->query("DELETE FROM character_inventory WHERE guid = '$id' AND slot = $item_num AND bag = 0");
     406                                        $sql->query("DELETE FROM item_instance WHERE guid = '$item_inst_id' AND owner_guid = '$id'");
     407                                        $sql->query("DELETE FROM item_text WHERE id = '$item_inst_id'");
    409408                                        } else { //deleting inv/bank items
    410                                                         $mysql->query("DELETE FROM character_inventory WHERE guid = '$id' AND item = '$item_num'");
    411                                                         $mysql->query("DELETE FROM item_instance WHERE guid = '$item_num' AND owner_guid = '$id'");
    412                                                         $mysql->query("DELETE FROM item_text WHERE id = '$item_num'");
     409                                                        $sql->query("DELETE FROM character_inventory WHERE guid = '$id' AND item = '$item_num'");
     410                                                        $sql->query("DELETE FROM item_instance WHERE guid = '$item_num' AND owner_guid = '$id'");
     411                                                        $sql->query("DELETE FROM item_text WHERE id = '$item_num'");
    413412                                        }
    414413                        }
     
    418417
    419418        if ($tp_to){
    420                 $query = $mysql->query("SELECT map, position_x, position_y, position_z, orientation FROM game_tele WHERE LOWER(name) = '".strtolower($tp_to)."'");
    421                 $tele = $mysql->fetch_row($query);
     419                $query = $sql->query("SELECT map, position_x, position_y, position_z, orientation FROM game_tele WHERE LOWER(name) = '".strtolower($tp_to)."'");
     420                $tele = $sql->fetch_row($query);
    422421                if($tele) $teleport = "map='$tele[0]', position_x='$tele[1]', position_y='$tele[2]', position_z='$tele[3]', orientation='$tele[4]',";
    423422                        else error($lang_char['no_tp_location']);
    424423        } else $teleport = "map='$map', position_x='$x', position_y='$y', position_z='$z',";
    425424
    426         $result = $mysql->query("UPDATE `character` SET data = '$data', name = '$new_name', $teleport totaltime = '$new_tot_time' WHERE guid = '$id'");
    427         $mysql->close();
     425        $result = $sql->query("UPDATE `character` SET data = '$data', name = '$new_name', $teleport totaltime = '$new_tot_time' WHERE guid = '$id'");
     426        $sql->close();
    428427
    429428        if ($result) redirect("char_edit.php?action=edit_char&id=$id&error=3");
    430429                else redirect("char_edit.php?action=edit_char&id=$id&error=4");
    431430  } else {
    432                 $mysql->close();
     431                $sql->close();
    433432                error($lang_char['no_permission']);
    434433                }
    435434 } else {
    436                 $mysql->close();
     435                $sql->close();
    437436                redirect("char_edit.php?action=edit_char&id=$id&error=2");
    438437                }
    439438} else error($lang_char['no_char_found']);
    440 $mysql->close();
     439$sql->close();
    441440}
    442441
  • minimanager/char_list.php

    r5 r19  
    2121                $user_lvl,$user_name;
    2222
    23  $mysql = new MySQL;
    24  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    25 
    26  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    27  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) :"guid";
    28  
    29  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     23 $sql = new SQL;
     24 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     25
     26 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     27 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) :"guid";
     28 
     29 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    3030 $order_dir = ($dir) ? "ASC" : "DESC";
    3131 $dir = ($dir) ? 0 : 1;
    3232
    33  $query_1 = $mysql->query("SELECT count(*) FROM `character`");
    34  $all_record = $mysql->result($query_1,0);
    35 
    36  $query = $mysql->query("SELECT guid,name,account,race,class,position_x,position_y,map,
     33 $query_1 = $sql->query("SELECT count(*) FROM `character`");
     34 $all_record = $sql->result($query_1,0);
     35
     36 $query = $sql->query("SELECT guid,name,account,race,class,zone,map,
    3737                CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,
    3838                online,CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level
    3939                FROM `character` ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    40  $this_page = $mysql->num_rows($query) or die(error($lang_global['err_no_result']));
     40 $this_page = $sql->num_rows($query) or die(error($lang_global['err_no_result']));
    4141
    4242//==========================top tage navigaion starts here========================
     
    5555           <input type=\"text\" size=\"14\" maxlength=\"50\" name=\"search_value\" />
    5656           <select name=\"search_by\">
     57            <option value=\"name\">{$lang_char_list['by_name']}</option>
    5758            <option value=\"guid\">{$lang_char_list['by_id']}</option>
    58                 <option value=\"name\">{$lang_char_list['by_name']}</option>
    5959                <option value=\"account\">{$lang_char_list['by_account']}</option>
    6060                <option value=\"level\">{$lang_char_list['by_level']}</option>
     
    8383  <table class=\"lined\">
    8484   <tr>
    85         <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    86         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=guid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['id']}</a></td>
    87         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=name&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['char_name']}</a></td>
    88         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=account&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['account']}</a></td>
    89     <td width=\"7%\" class=\"head\"><a href=\"char_list.php?order_by=race&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['race']}</a></td>
    90         <td width=\"6%\" class=\"head\"><a href=\"char_list.php?order_by=class&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['class']}</a></td>
    91         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=level&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['level']}</a></td>
    92         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?order_by=map&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['map']}</a></td>
    93         <td width=\"17%\" class=\"head\">{$lang_char_list['zone']}</td>
    94         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=highest_rank&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['honor_kills']}</a></td>
    95         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?order_by=online&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['online']}</a></td>
     85        <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></th>
     86        <th width=\"5%\"><a href=\"char_list.php?order_by=guid&amp;start=$start&amp;dir=$dir\">".($order_by=='guid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['id']}</a></th>
     87        <th width=\"15%\"><a href=\"char_list.php?order_by=name&amp;start=$start&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['char_name']}</a></th>
     88        <th width=\"15%\"><a href=\"char_list.php?order_by=account&amp;start=$start&amp;dir=$dir\">".($order_by=='account' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['account']}</a></th>
     89    <th width=\"7%\"><a href=\"char_list.php?order_by=race&amp;start=$start&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['race']}</a></th>
     90        <th width=\"6%\"><a href=\"char_list.php?order_by=class&amp;start=$start&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['class']}</a></th>
     91        <th width=\"5%\"><a href=\"char_list.php?order_by=level&amp;start=$start&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['level']}</a></th>
     92        <th width=\"15%\"><a href=\"char_list.php?order_by=map&amp;start=$start&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['map']}</a></th>
     93        <th width=\"17%\">{$lang_char_list['zone']}</th>
     94        <th width=\"5%\"><a href=\"char_list.php?order_by=highest_rank&amp;start=$start&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['honor_kills']}</a></th>
     95        <th width=\"5%\"><a href=\"char_list.php?order_by=online&amp;start=$start&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['online']}</a></th>
    9696  </tr>";
    9797
    9898 $looping = ($this_page < $itemperpage) ? $this_page : $itemperpage;
    9999
    100  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     100 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    101101 
    102102 for ($i=1; $i<=$looping; $i++) {
    103     $char = $mysql->fetch_row($query) or die(error($lang_global['err_no_user']));
     103    $char = $sql->fetch_row($query) or die(error($lang_global['err_no_user']));
    104104 //to disalow lower lvl gm to  view accounts of other gms
    105         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
    106         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    107         $owner_acc_name = $mysql->result($result, 0, 'username');
     105        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
     106        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     107        $owner_acc_name = $sql->result($result, 0, 'username');
    108108
    109109        if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
     
    112112                        $output .= "<td><input type=\"checkbox\" name=\"check[]\" value=\"$char[0]\" onclick=\"CheckCheckAll(document.form1);\" /></td>";
    113113                        else $output .= "<td></td>";
    114                         $output .= "
    115                     <td>$char[0]</td>
     114                        $output .= "<td>$char[0]</td>
    116115                        <td><a href=\"char.php?id=$char[0]\">$char[1]</a></td>
    117116                        <td><a href=\"user.php?action=edit_user&amp;error=11&amp;id=$char[2]\">$owner_acc_name</a></td>
    118                         <td>".get_player_race($char[3])."</td>
    119                         <td>".get_player_class($char[4])."</td>
    120                         <td>$char[10]</td>
    121                         <td>".get_map_name($char[7])."</td>
    122                         <td>".get_zone_name($char[7], $char[5], $char[6])."</td>
    123                         <td>$char[8]</td>
    124                         <td>".(($char[9]) ? "ON" : "-")."</td>
     117                        <td><img src='img/c_icons/{$char[3]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     118                        <td><img src='img/c_icons/{$char[4]}.gif' onmousemove='toolTip(\"".get_player_class($char[4])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     119                        <td>$char[9]</td>
     120                        <td>".get_map_name($char[6])."</td>
     121                        <td>".get_zone_name($char[5])."</td>
     122                        <td>$char[7]</td>
     123                        <td>".(($char[8]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    125124            </tr>";
    126125        }else{
     
    140139 </form><br /></center>";
    141140 
    142  $mysql->close();
     141 $sql->close();
    143142}
    144143
     
    153152 if(!isset($_GET['search_value'])) redirect("char_list.php?error=2");
    154153
    155  $mysql = new MySQL;
    156  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
    157  
    158  $search_value = $mysql->quote_smart($_GET['search_value']);
    159  $search_by = (isset($_GET['search_by'])) ? $mysql->quote_smart($_GET['search_by']) : "name";
    160  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "guid";
    161  
    162  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     154 $sql = new SQL;
     155 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     156 
     157 $search_value = $sql->quote_smart($_GET['search_value']);
     158 $search_by = (isset($_GET['search_by'])) ? $sql->quote_smart($_GET['search_by']) : "name";
     159 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "guid";
     160 
     161 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    163162 $order_dir = ($dir) ? "ASC" : "DESC";
    164163 $dir = ($dir) ? 0 : 1;
     
    167166 //need to get the acc id from other table since input comes as name
    168167 case "account":
    169  {
    170         $mysql->db($realm_db['name']);
    171         $result = $mysql->query("SELECT id FROM account WHERE username LIKE '%$search_value%' LIMIT $sql_search_limit");
    172 
    173         //acc = 0 added just in case there will be NO result
    174         $where_out = "account = 0 ";
    175         while ($acc = $mysql->fetch_row($result)){
    176                  $where_out .= "OR account = $acc[0] ";
    177         }
    178 
    179         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     168        $sql->db($realm_db['name']);
     169        $result = $sql->query("SELECT id FROM account WHERE username LIKE '%$search_value%' LIMIT $sql_search_limit");
     170
     171        $where_out = "account IN (0 ";
     172        while ($char = $sql->fetch_row($result)) $where_out .= " ,$acc[0]";
     173        $where_out = ") ";
     174       
     175        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    180176        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    181177        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level
    182178        FROM `character` WHERE $where_out ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    183  }
    184179 break;
    185180
    186181 case "level":
    187  {
    188182        if (!is_numeric($search_value)) $search_value = 1;
    189         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     183        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    190184        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    191185        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
    192186        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) = $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    193  }
    194187 break;
    195188
    196189case "greater_level":
    197190        if (!is_numeric($search_value)) $search_value = 1;
    198         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     191        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    199192        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    200193        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    203196
    204197 case "gold":
    205  {
    206         //used to avoid wrong input - cant use quotes on search value due to mysql bug.
    207198        if (!is_numeric($search_value)) $search_value = 1;
    208         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     199        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    209200        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    210201        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
    211202        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) > $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    212  }
    213203 break;
    214204 
    215205 case "guild":
    216         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    217         $result = $mysql->query("SELECT guildid FROM guild WHERE name LIKE '%$search_value%'");
    218         $guildid = $mysql->result($result, 0, 'guildid');
    219 
    220         $result = $mysql->query("SELECT guid FROM guild_member WHERE guildid = $guildid");
    221 
    222         //guid = 0 added just in case there will be NO result
    223         $where_out = "guid = 0 ";
    224         while ($char = $mysql->fetch_row($result)){
    225                 $where_out .= " OR guid = $char[0]";
    226         }
    227 
    228         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     206        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     207        $result = $sql->query("SELECT guildid FROM guild WHERE name LIKE '%$search_value%'");
     208        $guildid = $sql->result($result, 0, 'guildid');
     209
     210        $result = $sql->query("SELECT guid FROM guild_member WHERE guildid = $guildid");
     211
     212        $where_out = "guid IN (0 ";
     213        while ($char = $sql->fetch_row($result)) $where_out .= " ,$char[0]";
     214        $where_out = ") ";
     215
     216        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    229217        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    230218        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    233221
    234222  case "item":
    235         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    236         $result = $mysql->query("SELECT guid FROM character_inventory WHERE item_template = '$search_value'");
    237 
    238         //guid = 0 added just in case there will be NO result
    239         $where_out = " guid = 0";
    240         while ($char = $mysql->fetch_row($result)){
    241                 $where_out .= " OR guid = $char[0]";
    242         }
    243 
    244         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     223        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     224        $result = $sql->query("SELECT guid FROM character_inventory WHERE item_template = '$search_value'");
     225
     226        $where_out = "guid IN (0 ";
     227        while ($char = $sql->fetch_row($result)) $where_out .= " ,$char[0]";
     228        $where_out = ") ";
     229
     230        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    245231        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    246232        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    250236 case "greater_rank":
    251237        if (!is_numeric($search_value)) $search_value = 0;
    252         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     238        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    253239        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    254240        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    257243  case "highest_rank":
    258244        if (!is_numeric($search_value)) $search_value = 0;
    259         $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     245        $sql_query = "SELECT guid,name,account,race,class,zone,map,
    260246        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    261247        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    264250
    265251 default:
    266     $sql = "SELECT guid,name,account,race,class,position_x,position_y,map,
     252    $sql_query = "SELECT guid,name,account,race,class,zone,map,
    267253        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,online,
    268254        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level FROM `character`
     
    270256 }
    271257
    272  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    273 
    274  $query = $mysql->query($sql);
    275  $total_found = $mysql->num_rows($query);
     258 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     259
     260 $query = $sql->query($sql_query);
     261 $total_found = $sql->num_rows($query);
    276262
    277263//==========================top tage navigaion starts here========================
     
    288274                <input type=\"text\" size=\"17\" maxlength=\"50\" name=\"search_value\" />
    289275                <select name=\"search_by\">
     276                        <option value=\"name\">{$lang_char_list['by_name']}</option>
    290277                        <option value=\"guid\">{$lang_char_list['by_id']}</option>
    291                         <option value=\"name\">{$lang_char_list['by_name']}</option>
    292278                        <option value=\"account\">{$lang_char_list['by_account']}</option>
    293279                        <option value=\"level\">{$lang_char_list['by_level']}</option>
     
    313299   <table class=\"lined\">
    314300   <tr>
    315         <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    316         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=guid&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['id']}</a></td>
    317         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=name&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['char_name']}</a></td>
    318         <td width=\"15%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=account&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['account']}</a></td>
    319     <td width=\"7%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=race&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['race']}</a></td>
    320         <td width=\"6%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=class&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['class']}</a></td>
    321         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=level&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['level']}</a></td>
    322         <td width=\"17%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=map&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['map']}</a></td>
    323         <td width=\"15%\" class=\"head\">{$lang_char_list['zone']}</td>
    324         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=highest_rank&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['honor_kills']}</a></td>
    325         <td width=\"5%\" class=\"head\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\" class=\"head_link\">{$lang_char_list['online']}</a></td>
     301        <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
     302        <th width=\"5%\><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=guid&amp;dir=$dir\">".($order_by=='guid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['id']}</a></th>
     303        <th width=\"15%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=name&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['char_name']}</a></th>
     304        <th width=\"15%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=account&amp;dir=$dir\">".($order_by=='account' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['account']}</a></th>
     305    <th width=\"7%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=race&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['race']}</a></th>
     306        <th width=\"6%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=class&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['class']}</a></th>
     307        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=level&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['level']}</a></th>
     308        <th width=\"17%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=map&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['map']}</a></th>
     309        <th width=\"15%\">{$lang_char_list['zone']}</th>
     310        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=highest_rank&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['honor_kills']}</a></th>
     311        <th width=\"5%\"><a href=\"char_list.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char_list['online']}</a></th>
    326312  </tr>";
    327313
    328  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     314 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    329315 
    330  for ($i=1; $i<=$total_found; $i++){
    331    $char = $mysql->fetch_row($query);
    332  //to disalow lower lvl gm to  view accounts of other gms
    333         $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
    334         $owner_gmlvl = $mysql->result($result, 0, 'gmlevel');
    335         $owner_acc_name = $mysql->result($result, 0, 'username');
     316 while ($char = $sql->fetch_row($query)){
     317
     318        $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[2]'");
     319        $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     320        $owner_acc_name = $sql->result($result, 0, 'username');
    336321       
    337  if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
     322  if (($user_lvl >= $owner_gmlvl)||($owner_acc_name == $user_name)){
    338323                 $output .= "<tr>";
    339324                 if (($user_lvl > $owner_gmlvl)||($owner_acc_name == $user_name))$output .= "
     
    344329        <td><a href=\"char.php?id=$char[0]\">$char[1]</a></td>
    345330                <td><a href=\"user.php?action=edit_user&amp;error=11&amp;id=$char[2]\">$owner_acc_name</a></td>
    346                 <td>".get_player_race($char[3])."</td>
    347                 <td >".get_player_class($char[4])."</td>
    348                 <td>$char[10]</td>
    349                 <td>".get_map_name($char[7])."</td>
    350                 <td>".get_zone_name($char[7], $char[5], $char[6])."</td>
    351                 <td>$char[8]</td>
    352                 <td>".(($char[9]) ? "ON" : "-")."</td>
     331                <td><img src='img/c_icons/{$char[3]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     332                <td><img src='img/c_icons/{$char[4]}.gif' onmousemove='toolTip(\"".get_player_class($char[4])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     333                <td>$char[9]</td>
     334                <td>".get_map_name($char[6])."</td>
     335                <td>".get_zone_name($char[5])."</td>
     336                <td>$char[7]</td>
     337                <td>".(($char[8]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    353338       </tr>";
    354339        }else{
     
    368353 </form><br /></center>";
    369354
    370  $mysql->close();
     355 $sql->close();
    371356}
    372357
     
    376361//########################################################################################################################
    377362function del_char_form() {
    378 global  $lang_global, $lang_char_list, $output;
     363global  $lang_global, $lang_char_list, $output, $realm_id, $mangos_db;
    379364 if(isset($_GET['check'])) $check = $_GET['check'];
    380365        else redirect("char_list.php?error=1");
    381366
    382  $output .= "<center><h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />";
    383  $output .= "<font class=\"bold\">{$lang_char_list['char_ids']}: ";
    384 
    385  //this array needed to pass multiple values from check boxes down to delete by post method
     367 $output .= "<center><img src=\"img/warn_red.gif\" width=\"48\" height=\"48\" alt=\"\" />
     368                        <h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />
     369                        <font class=\"bold\">{$lang_char_list['char_ids']}: ";
     370
    386371 $pass_array = "";
    387372
     373 $sql = new SQL;
     374 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     375
    388376 for ($i=0; $i<count($check); $i++){
    389         $output .= "<a href=\"char.php?id=$check[$i]\" target=\"_blank\">$check[$i], </a>";
     377        $name = $sql->result($sql->query("SELECT name FROM `character` WHERE guid = {$check[$i]}"),0);
     378        $output .= "<a href=\"char.php?id=$check[$i]\" target=\"_blank\">$name, </a>";
    390379        $pass_array .= "&amp;check%5B%5D=$check[$i]";
    391380        }
    392381
    393  $output .= "<br />{$lang_global['will_be_erased']}</font><br /><br />";
    394 
    395  $output .= "<table class=\"hidden\">
     382 $sql->close();
     383 
     384 $output .= "<br />{$lang_global['will_be_erased']}</font><br /><br />
     385                <table class=\"hidden\">
    396386          <tr><td>";
    397387                        makebutton($lang_global['yes'], "char_list.php?action=dodel_char$pass_array",120);
     
    410400                $tab_del_user_mangos, $user_name;
    411401
    412  $mysql = new MySQL;
    413  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    414  
    415  if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     402 $sql = new SQL;
     403 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     404 
     405 if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    416406        else redirect("char_list.php?error=1");
    417407
     
    425415}
    426416
    427  $mysql->close();
     417 $sql->close();
    428418 $output .= "<center>";
    429419 if (!$deleted_chars) $output .= "<h1><font class=\"error\">{$lang_char_list['no_chars_del']}</font></h1>";
  • minimanager/cleanup.php

    r5 r19  
    6666 if( empty($_GET['cleanup_by']) || empty($_GET['cleanup_sign']) ) redirect("cleanup.php?error=1");
    6767
    68  $mysql = new MySQL;
    69  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
    70 
    71  $cleanup_by = $mysql->quote_smart($_GET['cleanup_by']);
    72  $cleanup_sign = $mysql->quote_smart($_GET['cleanup_sign']);
    73  $cleanup_value = $mysql->quote_smart($_GET['cleanup_value']);
     68 $sql = new SQL;
     69 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     70
     71 $cleanup_by = $sql->quote_smart($_GET['cleanup_by']);
     72 $cleanup_sign = $sql->quote_smart($_GET['cleanup_sign']);
     73 $cleanup_value = $sql->quote_smart($_GET['cleanup_value']);
    7474
    7575switch ($cleanup_by) {
    7676 // clean by lvl
    7777 case "char_lvl":
    78  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    79 
    80  $result = $mysql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $cleanup_sign $cleanup_value");
    81  $total_chars = $mysql->num_rows($result);
     78 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     79
     80 $result = $sql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $cleanup_sign $cleanup_value");
     81 $total_chars = $sql->num_rows($result);
    8282
    8383 $output .= "<center>";
     
    9090        $pass_array = "";
    9191
    92          while($char = $mysql->fetch_row($result)){
     92         while($char = $sql->fetch_row($result)){
    9393                $output .= "<a href=\"char.php?id=$char[0]\" target=\"_blank\">$char[0], </a>";
    9494                $pass_array .= "-$char[0]";
     
    117117//last loggin
    118118 case "last_login":
    119   $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    120 
    121   $result = $mysql->query("SELECT id FROM account WHERE last_login $cleanup_sign '$cleanup_value' AND gmlevel < $user_lvl");
    122   $total_accounts = $mysql->num_rows($result);
     119  $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     120
     121  $result = $sql->query("SELECT id FROM account WHERE last_login $cleanup_sign '$cleanup_value' AND gmlevel < $user_lvl");
     122  $total_accounts = $sql->num_rows($result);
    123123
    124124  $output .= "<center>";
     
    131131  $pass_array = "";
    132132
    133   while($acc = $mysql->fetch_row($result)){
     133  while($acc = $sql->fetch_row($result)){
    134134        $output .= "<a href=\"user.php?action=edit_user&amp;id=$acc[0]\" target=\"_blank\">$acc[0], </a>";
    135135        $pass_array .= "-$acc[0]";
     
    158158 //failed loggin attempts
    159159case "failed_login":
    160  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    161 
    162  $result = $mysql->query("SELECT id FROM account WHERE failed_logins $cleanup_sign $cleanup_value AND gmlevel < $user_lvl");
    163  $total_accounts = $mysql->num_rows($result);
     160 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     161
     162 $result = $sql->query("SELECT id FROM account WHERE failed_logins $cleanup_sign $cleanup_value AND gmlevel < $user_lvl");
     163 $total_accounts = $sql->num_rows($result);
    164164
    165165 $output .= "<center>";
     
    172172 $pass_array = "";
    173173
    174  while($acc = $mysql->fetch_row($result)){
     174 while($acc = $sql->fetch_row($result)){
    175175                $output .= "<a href=\"user.php?action=edit_user&amp;id=$acc[0]\" target=\"_blank\">$acc[0], </a>";
    176176                $pass_array .= "-$acc[0]";
     
    200200//clean banned accounts
    201201case "banned":
    202  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    203 
    204  $result = $mysql->query("SELECT id FROM account_banned");
    205  $total_accounts = $mysql->num_rows($result);
     202 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     203
     204 $result = $sql->query("SELECT id FROM account_banned");
     205 $total_accounts = $sql->num_rows($result);
    206206
    207207 $output .= "<center>";
     
    214214        $pass_array = "";
    215215
    216         while($acc = $mysql->fetch_row($result)){
     216        while($acc = $sql->fetch_row($result)){
    217217                $output .= "<a href=\"user.php?action=edit_user&amp;id=$acc[0]\" target=\"_blank\">$acc[0], </a>";
    218218                $pass_array .= "-$acc[0]";
     
    241241//clean chars with given total time played
    242242case "totaltime":
    243  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    244 
    245  $result = $mysql->query("SELECT guid FROM `character` WHERE totaltime $cleanup_sign $cleanup_value");
    246  $total_chars = $mysql->num_rows($result);
     243 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     244
     245 $result = $sql->query("SELECT guid FROM `character` WHERE totaltime $cleanup_sign $cleanup_value");
     246 $total_chars = $sql->num_rows($result);
    247247
    248248 $output .= "<center>";
     
    255255        $pass_array = "";
    256256
    257         while($char = $mysql->fetch_row($result)){
     257        while($char = $sql->fetch_row($result)){
    258258                $output .= "<a href=\"char.php?id=$char[0]\" target=\"_blank\">$char[0], </a>";
    259259                $pass_array .= "-$char[0]";
     
    283283//clean locked acc
    284284case "locked":
    285  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    286 
    287  $result = $mysql->query("SELECT id FROM account WHERE locked $cleanup_sign $cleanup_value AND gmlevel < $user_lvl");
    288  $total_accounts = $mysql->num_rows($result);
     285 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     286
     287 $result = $sql->query("SELECT id FROM account WHERE locked $cleanup_sign $cleanup_value AND gmlevel < $user_lvl");
     288 $total_accounts = $sql->num_rows($result);
    289289
    290290 $output .= "<center>";
     
    297297        $pass_array = "";
    298298
    299         while($acc = $mysql->fetch_row($result)){
     299        while($acc = $sql->fetch_row($result)){
    300300                $output .= "<a href=\"user.php?action=edit_user&amp;id=$acc[0]\" target=\"_blank\">$acc[0], </a>";
    301301                $pass_array .= "-$acc[0]";
     
    325325//accounts without chars or specified number of chars
    326326case "num_of_char_in_acc":
    327  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    328 
    329  $result = $mysql->query("SELECT id FROM account WHERE gmlevel < $user_lvl");
     327 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     328
     329 $result = $sql->query("SELECT id FROM account WHERE gmlevel < $user_lvl");
    330330
    331331 $acc_output_array = array();
    332332
    333  while($acc = $mysql->fetch_row($result)){
     333 while($acc = $sql->fetch_row($result)){
    334334        $total_chars_in_acc = 0;
    335335        foreach ($mangos_db as $db){
    336                 $mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    337 
    338                 $query = $mysql->query("SELECT count(*) FROM `character` WHERE account = '$acc[0]'");
    339                 $total_chars_in_acc = $total_chars_in_acc + $mysql->result($query, 0);
     336                $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     337
     338                $query = $sql->query("SELECT count(*) FROM `character` WHERE account = '$acc[0]'");
     339                $total_chars_in_acc = $total_chars_in_acc + $sql->result($query, 0);
    340340        }
    341341
     
    401401//guild  without chars or specified number of chars
    402402case "num_of_char_in_guild":
    403  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    404 
    405  $result = $mysql->query("SELECT guildid FROM guild");
     403 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     404
     405 $result = $sql->query("SELECT guildid FROM guild");
    406406
    407407 $guild_output_array = array();
    408408
    409  while($guild = $mysql->fetch_row($result)){
    410         $query = $mysql->query("SELECT count(*) FROM guild_member WHERE guildid = '$guild[0]'");
    411         $total_chars_in_guild = $mysql->result($query, 0);
     409 while($guild = $sql->fetch_row($result)){
     410        $query = $sql->query("SELECT count(*) FROM guild_member WHERE guildid = '$guild[0]'");
     411        $total_chars_in_guild = $sql->result($query, 0);
    412412
    413413        switch ($cleanup_sign){
     
    473473}
    474474
    475  $mysql->close();
     475 $sql->close();
    476476}
    477477
     
    486486 if (!isset($_POST['type']) || $_POST['type'] === '') redirect("cleanup.php?error=1");
    487487
    488  $mysql = new MySQL;
    489  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
    490 
    491  $type = $mysql->quote_smart($_POST['type']);
     488 $sql = new SQL;
     489 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     490
     491 $type = $sql->quote_smart($_POST['type']);
    492492 if(isset($_POST['check']) && $_POST['check'] != '') {
    493                 $check = $mysql->quote_smart($_POST['check']);
     493                $check = $sql->quote_smart($_POST['check']);
    494494                $check = explode('-',$check);
    495495        } else redirect("cleanup.php?error=1");
     
    538538}
    539539
    540  $mysql->close();
     540 $sql->close();
    541541
    542542 $output .= "<center>";
  • minimanager/command.php

    r5 r19  
    2525 );
    2626 
    27  $mysql = new MySQL;
    28  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     27 $sql = new SQL;
     28 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    2929
    30  $query = $mysql->query("SELECT name,help,`security` FROM command WHERE `security` <= $user_lvl");
     30 $query = $sql->query("SELECT name,help,`security` FROM command WHERE `security` <= $user_lvl");
    3131
    32  while ($data = $mysql->fetch_row($query)){
     32 while ($data = $sql->fetch_row($query)){
    3333   $tmp_output = "<tr>";
    3434   $tmp_output .= ($user_lvl > 2) ? "<td><input type=\"checkbox\" name=\"check[$data[0]]\" value=\"$data[2]\" /></td>" : "<td></td>";
    35    $tmp_output .= "<td nowrap align=right>.$data[0]</td>";
     35   $tmp_output .= "<td align=\"right\">.$data[0]</td>";
    3636   $comm =  explode("\r\n",$data[1],2);
    3737   $syntax = ereg_replace("[a-zA-Z ]+:* *\.".$data[0]." *", "", str_replace("/", "<br />",$comm[0]));
     
    5252 for ($i=0; $i<=$user_lvl; $i++){
    5353     $output .= "<fieldset style=\"width: 770px;\">
    54                  <legend>{$lang_command[$levels[$i][0]]}</legend>
    55                  <br />
     54                 <legend>".
     55                                (($user_lvl) ? "<a href=\"#\" onclick=\"showHide('{$levels[$i][0]}')\">{$lang_command[$levels[$i][0]]}</a>" : "{$lang_command[$levels[$i][0]]}").
     56                                "</legend>
     57                  <div id=\"{$levels[$i][0]}\">
     58                                  <br />
    5659                 <table class=\"lined\" style=\"width: 720px;text-align: left;\">
    5760                   <tr style=\"text-align: center;\">
    58                      <td width=\"2%\" class=\"head\"></td>
    59                      <td width=\"13%\" class=\"head\">{$lang_command['command']}</td>
    60                      <td width=\"20%\" class=\"head\">{$lang_command['syntax']}</td>                                   
    61                      <td width=\"65%\" class=\"head\">{$lang_command['description']}</td>
     61                     <th width=\"2%\"></th>
     62                     <th width=\"13%\">{$lang_command['command']}</th>
     63                     <th width=\"20%\">{$lang_command['syntax']}</th>                                   
     64                     <th width=\"65%\">{$lang_command['description']}</th>
    6265                   </tr>" . $levels[$i][1];
    6366        if ($user_lvl > 2) {
     
    6568                        makebutton($lang_command['change_level'], "javascript:do_submit()",280);
    6669                }
    67         $output .= "</table></fieldset>";
     70        $output .= "</table></div></fieldset>";
    6871 }
    6972 $output .= "</form><br /></center>";
    7073
    71  $mysql->close();
     74 $sql->close();
    7275}
    7376
     
    7780//#######################################################################################################
    7881function update_commands(){
    79  global  $lang_global, $lang_command, $output;
     82 global  $lang_global, $lang_command, $output, $user_lvl;
    8083 valid_login(3);
    8184
     
    8891             <table class=\"lined\" style=\"width: 720px;\">
    8992               <tr>
    90                  <td width=\"20%\" class=\"head\"></td>
    91                  <td width=\"20%\" class=\"head\">{$lang_command['level0']}</td>
    92                  <td width=\"20%\" class=\"head\">{$lang_command['level1']}</td>                                       
    93                  <td width=\"20%\" class=\"head\">{$lang_command['level2']}</td>
    94                  <td width=\"20%\" class=\"head\">{$lang_command['level3']}</td>
     93                 <th width=\"20%\"></th>
     94                 <th width=\"20%\">{$lang_command['level0']}</th>
     95                 <th width=\"20%\">{$lang_command['level1']}</th>
     96                 <th width=\"20%\">{$lang_command['level2']}</th>
     97                 <th width=\"20%\">{$lang_command['level3']}</th>
    9598               </tr>";
    9699
     
    128131 valid_login(3);
    129132
    130  $mysql = new MySQL;
    131  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    132  if(isset($_GET['change'])) $change = $mysql->quote_smart($_GET['change']);
     133 $sql = new SQL;
     134 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     135 if(isset($_GET['change'])) $change = $sql->quote_smart($_GET['change']);
    133136 else redirect("command.php?error=1");
    134137
     
    142145   
    143146 for ($i=0; $i<count($change); $i++) {
    144    $query = $mysql->query("UPDATE command SET `security` = '".$change[$commands[$i]]."' WHERE name= '$commands[$i]'");
     147   $query = $sql->query("UPDATE command SET `security` = '".$change[$commands[$i]]."' WHERE name= '$commands[$i]'");
    145148 }
    146149
    147  $mysql->close();
     150 $sql->close();
    148151 redirect("command.php");
    149152}
  • minimanager/creature.php

    r5 r19  
    5151 global $lang_global, $lang_creature, $output, $mangos_db, $realm_id, $creature_type;
    5252
    53  $mysql = new MySQL;
    54  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    55 
    56  $result = $mysql->query("SELECT count(*) FROM creature_template");
    57  $tot_items = $mysql->result($result, 0);
    58  $mysql->close();
     53 $sql = new SQL;
     54 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     55
     56 $result = $sql->query("SELECT count(*) FROM creature_template");
     57 $tot_items = $sql->result($result, 0);
     58 $sql->close();
    5959
    6060 $output .= "<center>
     
    195195        }
    196196
    197 $mysql = new MySQL;
    198 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    199 
    200 if ($_POST['npcflag'] != '') $npcflag = $mysql->quote_smart($_POST['npcflag']);
    201 if ($_POST['type'] != '') $type = $mysql->quote_smart($_POST['type']);
    202 if ($_POST['rank'] != '') $rank = $mysql->quote_smart($_POST['rank']);
    203 if ($_POST['family'] != '') $family = $mysql->quote_smart($_POST['family']);
    204 if ($_POST['entry'] != '') $entry = $mysql->quote_smart($_POST['entry']);
    205 if ($_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
    206 if ($_POST['level'] != '') $level = $mysql->quote_smart($_POST['level']);
    207 if ($_POST['health'] != '') $health = $mysql->quote_smart($_POST['health']);
    208 if ($_POST['faction'] != '') $faction = $mysql->quote_smart($_POST['faction']);
    209 if ($_POST['spell'] != '') $spell = $mysql->quote_smart($_POST['spell']);
    210 if ($_POST['lootid'] != '') $lootid = $mysql->quote_smart($_POST['lootid']);
    211 if ($_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
    212 if ($_POST['custom_search'] != '') $custom_search = $mysql->quote_smart($_POST['custom_search']);
     197$sql = new SQL;
     198$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     199
     200if ($_POST['npcflag'] != '') $npcflag = $sql->quote_smart($_POST['npcflag']);
     201if ($_POST['type'] != '') $type = $sql->quote_smart($_POST['type']);
     202if ($_POST['rank'] != '') $rank = $sql->quote_smart($_POST['rank']);
     203if ($_POST['family'] != '') $family = $sql->quote_smart($_POST['family']);
     204if ($_POST['entry'] != '') $entry = $sql->quote_smart($_POST['entry']);
     205if ($_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
     206if ($_POST['level'] != '') $level = $sql->quote_smart($_POST['level']);
     207if ($_POST['health'] != '') $health = $sql->quote_smart($_POST['health']);
     208if ($_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']);
     209if ($_POST['spell'] != '') $spell = $sql->quote_smart($_POST['spell']);
     210if ($_POST['lootid'] != '') $lootid = $sql->quote_smart($_POST['lootid']);
     211if ($_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
     212if ($_POST['custom_search'] != '') $custom_search = $sql->quote_smart($_POST['custom_search']);
    213213        else $custom_search = "";
    214214
     
    230230 if($where == "WHERE entry > 0 ") redirect("creature.php?error=1");
    231231
    232  $result = $mysql->query("SELECT entry,name,maxlevel,maxhealth,rank,npcflag FROM creature_template $where ORDER BY entry LIMIT $sql_search_limit");
    233  $total_found = $mysql->num_rows($result);
     232 $result = $sql->query("SELECT entry,name,maxlevel,maxhealth,rank,npcflag FROM creature_template $where ORDER BY entry LIMIT $sql_search_limit");
     233 $total_found = $sql->num_rows($result);
    234234
    235235  $output .= "<center>
     
    243243  $output .= "<table class=\"lined\">
    244244   <tr>
    245         <td width=\"10%\" class=\"head\">{$lang_creature['entry']}</td>
    246         <td width=\"40%\" class=\"head\">{$lang_creature['name']}</td>
    247         <td width=\"10%\" class=\"head\">{$lang_creature['level']}</td>
    248         <td width=\"10%\" class=\"head\">{$lang_creature['health']}</td>
    249         <td width=\"10%\" class=\"head\">{$lang_creature['rank']}</td>
    250         <td width=\"20%\" class=\"head\">{$lang_creature['npc_flag']}</td>
     245        <th width=\"10%\">{$lang_creature['entry']}</th>
     246        <th width=\"40%\">{$lang_creature['name']}</th>
     247        <th width=\"10%\">{$lang_creature['level']}</th>
     248        <th width=\"10%\">{$lang_creature['health']}</th>
     249        <th width=\"10%\">{$lang_creature['rank']}</th>
     250        <th width=\"20%\">{$lang_creature['npc_flag']}</th>
    251251  </tr>";
    252252
    253253 for ($i=1; $i<=$total_found; $i++){
    254   $creature = $mysql->fetch_row($result);
     254  $creature = $sql->fetch_row($result);
    255255
    256256  $output .= "<tr>
     
    265265  $output .= "</table></center><br />";
    266266
    267  $mysql->close();
     267 $sql->close();
    268268}
    269269
     
    597597       
    598598<td>".makeinfocell($lang_creature['class'],$lang_creature['class_desc'])."</td>
    599            <td colspan=\"2\"><select name=\"class\">
     599           <td><select name=\"class\">
    600600                <option value=\"0\">0 - {$lang_creature['none']}</option>
    601601                <option value=\"1\">1 - {$lang_id_tab['warrior']}</option>
     
    611611
    612612<td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td>
    613            <td colspan=\"2\"><select name=\"race\">
     613           <td><select name=\"race\">
    614614                <option value=\"0\">0 - {$lang_creature['none']}</option>
    615615                <option value=\"1\">1 - {$lang_id_tab['human']}</option>
     
    623623                <option value=\"10\">10 - {$lang_id_tab['bloodelf']}</option>
    624624                <option value=\"11\">11 - {$lang_id_tab['draenei']}</option>
    625            </select></td>   
     625           </select></td>
     626           
     627 <td>".makeinfocell($lang_creature['RacialLeader'],$lang_creature['RacialLeader_desc'])."</td>
     628 <td><input type=\"checkbox\" name=\"RacialLeader\" value=\"1\" /></td>
    626629</tr>
    627630<tr>
     
    681684 if (!isset($_GET['entry'])) redirect("creature.php?error=1");
    682685       
    683  $mysql = new MySQL;
    684  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    685  
    686  $entry = $mysql->quote_smart($_GET['entry']);
    687  $result = $mysql->query("SELECT * FROM creature_template WHERE entry = '$entry'");
    688 
    689  if ($mob = $mysql->fetch_assoc($result)){
     686 $sql = new SQL;
     687 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     688 
     689 $entry = $sql->quote_smart($_GET['entry']);
     690 $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$entry'");
     691
     692 if ($mob = $sql->fetch_assoc($result)){
    690693
    691694  $output .= "<script type=\"text/javascript\" src=\"js/tab.js\"></script>
     
    935938  unset($family);
    936939 
    937 $result1 = $mysql->query("SELECT COUNT(*) FROM creature WHERE id = '{$mob['entry']}'");
    938 $output .= "<tr><td colspan=\"6\">{$lang_creature['creature_swapned']} : ".$mysql->result($result1, 0)." {$lang_creature['times']}.</td></tr>
     940$result1 = $sql->query("SELECT COUNT(*) FROM creature WHERE id = '{$mob['entry']}'");
     941$output .= "<tr><td colspan=\"6\">{$lang_creature['creature_swapned']} : ".$sql->result($result1, 0)." {$lang_creature['times']}.</td></tr>
    939942
    940943</table>
     
    10951098 
    10961099$output .= "<td>".makeinfocell($lang_creature['class'],$lang_creature['class_desc'])."</td>
    1097            <td colspan=\"2\"><select name=\"class\">
     1100           <td><select name=\"class\">
    10981101                <option value=\"0\" {$class[0]}>0 - {$lang_creature['none']}</option>
    10991102                <option value=\"1\" {$class[1]}>1 - {$lang_id_tab['warrior']}</option>
     
    11121115 $race[$mob['race']] = " selected=\"selected\" ";
    11131116 
    1114 $output .= "<td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td>
    1115            <td colspan=\"2\"><select name=\"race\">
     1117 $output .= "<td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td>
     1118           <td><select name=\"race\">
    11161119                <option value=\"0\" {$race[0]}>0 - {$lang_creature['none']}</option>
    11171120                <option value=\"1\" {$race[1]}>1 - {$lang_id_tab['human']}</option>
     
    11251128                <option value=\"10\" {$race[10]}>10 - {$lang_id_tab['bloodelf']}</option>
    11261129                <option value=\"11\" {$race[11]}>11 - {$lang_id_tab['draenei']}</option>
    1127            </select></td>   
     1130           </select></td>";
     1131
     1132 if ($mob['RacialLeader']) $RacialLeader = "checked";
     1133        else $RacialLeader = "";
     1134       
     1135$output .= "<td>".makeinfocell($lang_creature['RacialLeader'],$lang_creature['RacialLeader_desc'])."</td>
     1136        <td><input type=\"checkbox\" name=\"RacialLeader\" value=\"1\" $RacialLeader /></td>
    11281137</tr>
    11291138<tr>
     
    11761185        $row_flag = 0;
    11771186        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    1178         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM creature_loot_template WHERE entry = {$mob['lootid']} ORDER BY ChanceOrRef DESC");
    1179         while ($item = $mysql->fetch_row($result1)){
     1187        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM creature_loot_template WHERE entry = {$mob['lootid']} ORDER BY ChanceOrRef DESC");
     1188        while ($item = $sql->fetch_row($result1)){
    11801189                $cel_counter++;
    11811190                $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]";
     
    12201229        <tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['start_quests']}:</td></tr>";
    12211230
    1222         $result1 = $mysql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}");
    1223         while ($quest = $mysql->fetch_row($result1)){
    1224                 $query1 = $mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
    1225                 $quest_templ = $mysql->fetch_row($query1);
     1231        $result1 = $sql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}");
     1232        while ($quest = $sql->fetch_row($result1)){
     1233                $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
     1234                $quest_templ = $sql->fetch_row($query1);
    12261235               
    12271236                $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_questrelation[]\" value=\"$quest[0]\" /></td>
     
    12351244<tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['ends_quests']}:</td></tr>";
    12361245
    1237         $result1 = $mysql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}");
    1238         while ($quest = $mysql->fetch_row($result1)){
    1239                 $query1 = $mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
    1240                 $quest_templ = $mysql->fetch_row($query1);
     1246        $result1 = $sql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}");
     1247        while ($quest = $sql->fetch_row($result1)){
     1248                $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
     1249                $quest_templ = $sql->fetch_row($query1);
    12411250               
    12421251                $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_involvedrelation[]\" value=\"$quest[0]\" /></td>
     
    12611270        $row_flag = 0;
    12621271        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    1263         $result1 = $mysql->query("SELECT item, maxcount, incrtime FROM npc_vendor WHERE entry = {$mob['entry']}");
    1264         while ($item = $mysql->fetch_row($result1)){
     1272        $result1 = $sql->query("SELECT item, maxcount, incrtime FROM npc_vendor WHERE entry = {$mob['entry']}");
     1273        while ($item = $sql->fetch_row($result1)){
    12651274                $cel_counter++;
    12661275                if (!$item[1]) $count = "{$lang_creature['unlimited']}";
     
    13031312        $row_flag = 0;
    13041313        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    1305         $result1 = $mysql->query("SELECT spell, spellcost, reqskill, reqskillvalue, reqlevel FROM npc_trainer WHERE entry = {$mob['entry']} ORDER BY reqlevel");
    1306         while ($spell = $mysql->fetch_row($result1)){
     1314        $result1 = $sql->query("SELECT spell, spellcost, reqskill, reqskillvalue, reqlevel FROM npc_trainer WHERE entry = {$mob['entry']} ORDER BY reqlevel");
     1315        while ($spell = $sql->fetch_row($result1)){
    13071316                $cel_counter++;
    13081317                $tooltip = "{$lang_creature['spell_id']} : $spell[0]<br />{$lang_creature['cost']} :  $spell[1](c)<br />{$lang_creature['req_skill']} : $spell[2]<br />{$lang_creature['req_skill_lvl']} :  $spell[3]<br />{$lang_creature['req_level']} $spell[4]";
     
    13501359        $row_flag = 0;
    13511360        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    1352         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM skinning_loot_template WHERE entry = {$mob['skinloot']} ORDER BY ChanceOrRef DESC");
    1353         while ($item = $mysql->fetch_row($result1)){
     1361        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM skinning_loot_template WHERE entry = {$mob['skinloot']} ORDER BY ChanceOrRef DESC");
     1362        while ($item = $sql->fetch_row($result1)){
    13541363                $cel_counter++;
    13551364                $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]";
     
    13991408        $row_flag = 0;
    14001409        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    1401         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM pickpocketing_loot_template WHERE entry = {$mob['pickpocketloot']} ORDER BY ChanceOrRef DESC");
    1402         while ($item = $mysql->fetch_row($result1)){
     1410        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM pickpocketing_loot_template WHERE entry = {$mob['pickpocketloot']} ORDER BY ChanceOrRef DESC");
     1411        while ($item = $sql->fetch_row($result1)){
    14031412                $cel_counter++;
    14041413                $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]";
     
    14551464        </table></center>";
    14561465
    1457  $mysql->close();
     1466 $sql->close();
    14581467 } else {
    1459                 $mysql->close();
     1468                $sql->close();
    14601469                error($lang_creature['item_not_found']);
    14611470                exit();
     
    14731482 if (!isset($_POST['entry']) || $_POST['entry'] === '') redirect("creature.php?error=1");
    14741483 
    1475  $mysql = new MySQL;
    1476  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1477 
    1478  $entry = $mysql->quote_smart($_POST['entry']);
    1479  if (isset($_POST['modelid_m']) && $_POST['modelid_m'] != '') $modelid_m = $mysql->quote_smart($_POST['modelid_m']);
     1484 $sql = new SQL;
     1485 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     1486
     1487 $entry = $sql->quote_smart($_POST['entry']);
     1488 if (isset($_POST['modelid_m']) && $_POST['modelid_m'] != '') $modelid_m = $sql->quote_smart($_POST['modelid_m']);
    14801489        else $modelid_m = 0;
    1481  if (isset($_POST['modelid_f']) && $_POST['modelid_f'] != '') $modelid_f = $mysql->quote_smart($_POST['modelid_f']);
     1490 if (isset($_POST['modelid_f']) && $_POST['modelid_f'] != '') $modelid_f = $sql->quote_smart($_POST['modelid_f']);
    14821491        else $modelid_f = 0;
    1483  if (isset($_POST['name']) && $_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
     1492 if (isset($_POST['name']) && $_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
    14841493        else $name = "";
    1485  if (isset($_POST['subname']) && $_POST['subname'] != '') $subname = $mysql->quote_smart($_POST['subname']);
     1494 if (isset($_POST['subname']) && $_POST['subname'] != '') $subname = $sql->quote_smart($_POST['subname']);
    14861495        else $subname = "";
    1487  if (isset($_POST['minlevel']) && $_POST['minlevel'] != '') $minlevel = $mysql->quote_smart($_POST['minlevel']);
     1496 if (isset($_POST['minlevel']) && $_POST['minlevel'] != '') $minlevel = $sql->quote_smart($_POST['minlevel']);
    14881497        else $minlevel = 0;
    1489  if (isset($_POST['maxlevel']) && $_POST['maxlevel'] != '') $maxlevel = $mysql->quote_smart($_POST['maxlevel']);
     1498 if (isset($_POST['maxlevel']) && $_POST['maxlevel'] != '') $maxlevel = $sql->quote_smart($_POST['maxlevel']);
    14901499        else $maxlevel = 0;
    1491  if (isset($_POST['minhealth']) && $_POST['minhealth'] != '') $minhealth = $mysql->quote_smart($_POST['minhealth']);
     1500 if (isset($_POST['minhealth']) && $_POST['minhealth'] != '') $minhealth = $sql->quote_smart($_POST['minhealth']);
    14921501        else $minhealth = 0;
    1493  if (isset($_POST['maxhealth']) && $_POST['maxhealth'] != '') $maxhealth = $mysql->quote_smart($_POST['maxhealth']);
     1502 if (isset($_POST['maxhealth']) && $_POST['maxhealth'] != '') $maxhealth = $sql->quote_smart($_POST['maxhealth']);
    14941503        else $maxhealth = 0;
    1495  if (isset($_POST['minmana']) && $_POST['minmana'] != '') $minmana = $mysql->quote_smart($_POST['minmana']);
     1504 if (isset($_POST['minmana']) && $_POST['minmana'] != '') $minmana = $sql->quote_smart($_POST['minmana']);
    14961505        else $minmana = 0;
    1497  if (isset($_POST['maxmana']) && $_POST['maxmana'] != '') $maxmana = $mysql->quote_smart($_POST['maxmana']);
     1506 if (isset($_POST['maxmana']) && $_POST['maxmana'] != '') $maxmana = $sql->quote_smart($_POST['maxmana']);
    14981507        else $maxmana = 0;
    1499  if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $mysql->quote_smart($_POST['armor']);
     1508 if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $sql->quote_smart($_POST['armor']);
    15001509        else $armor = 0;
    1501  if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $mysql->quote_smart($_POST['faction']);
     1510 if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']);
    15021511        else $faction = 0;
    1503  if (isset($_POST['npcflag'])) $npcflag = $mysql->quote_smart($_POST['npcflag']);
     1512 if (isset($_POST['npcflag'])) $npcflag = $sql->quote_smart($_POST['npcflag']);
    15041513        else $npcflag = 0;
    1505  if (isset($_POST['speed']) && $_POST['speed'] != '') $speed = $mysql->quote_smart($_POST['speed']);
     1514 if (isset($_POST['speed']) && $_POST['speed'] != '') $speed = $sql->quote_smart($_POST['speed']);
    15061515        else $speed = 0;
    1507  if (isset($_POST['rank']) && $_POST['rank'] != '') $rank = $mysql->quote_smart($_POST['rank']);
     1516 if (isset($_POST['rank']) && $_POST['rank'] != '') $rank = $sql->quote_smart($_POST['rank']);
    15081517        else $rank = 0;
    1509  if (isset($_POST['mindmg']) && $_POST['mindmg'] != '') $mindmg = $mysql->quote_smart($_POST['mindmg']);
     1518 if (isset($_POST['mindmg']) && $_POST['mindmg'] != '') $mindmg = $sql->quote_smart($_POST['mindmg']);
    15101519        else $mindmg = 0;
    1511  if (isset($_POST['maxdmg']) && $_POST['maxdmg'] != '') $maxdmg = $mysql->quote_smart($_POST['maxdmg']);
     1520 if (isset($_POST['maxdmg']) && $_POST['maxdmg'] != '') $maxdmg = $sql->quote_smart($_POST['maxdmg']);
    15121521        else $maxdmg = 0;
    1513  if (isset($_POST['attackpower']) && $_POST['attackpower'] != '') $attackpower = $mysql->quote_smart($_POST['attackpower']);
     1522 if (isset($_POST['attackpower']) && $_POST['attackpower'] != '') $attackpower = $sql->quote_smart($_POST['attackpower']);
    15141523        else $attackpower = 0;
    1515  if (isset($_POST['baseattacktime']) && $_POST['baseattacktime'] != '') $baseattacktime = $mysql->quote_smart($_POST['baseattacktime']);
     1524 if (isset($_POST['baseattacktime']) && $_POST['baseattacktime'] != '') $baseattacktime = $sql->quote_smart($_POST['baseattacktime']);
    15161525        else $baseattacktime = 0;
    1517  if (isset($_POST['rangeattacktime']) && $_POST['rangeattacktime'] != '') $rangeattacktime = $mysql->quote_smart($_POST['rangeattacktime']);
     1526 if (isset($_POST['rangeattacktime']) && $_POST['rangeattacktime'] != '') $rangeattacktime = $sql->quote_smart($_POST['rangeattacktime']);
    15181527        else $rangeattacktime = 0;
    1519  if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $mysql->quote_smart($_POST['flags']);
     1528 if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $sql->quote_smart($_POST['flags']);
    15201529        else $flags = 0;
    1521  if (isset($_POST['dynamicflags']) && $_POST['dynamicflags'] != '') $dynamicflags = $mysql->quote_smart($_POST['dynamicflags']);
     1530 if (isset($_POST['dynamicflags']) && $_POST['dynamicflags'] != '') $dynamicflags = $sql->quote_smart($_POST['dynamicflags']);
    15221531        else $dynamicflags = 0;
    1523  if (isset($_POST['size']) && $_POST['size'] != '') $size = $mysql->quote_smart($_POST['size']);
     1532 if (isset($_POST['size']) && $_POST['size'] != '') $size = $sql->quote_smart($_POST['size']);
    15241533        else $size = 0;
    1525  if (isset($_POST['family']) && $_POST['family'] != '') $family = $mysql->quote_smart($_POST['family']);
     1534 if (isset($_POST['family']) && $_POST['family'] != '') $family = $sql->quote_smart($_POST['family']);
    15261535        else $family = 0;
    1527  if (isset($_POST['bounding_radius']) && $_POST['bounding_radius'] != '') $bounding_radius = $mysql->quote_smart($_POST['bounding_radius']);
     1536 if (isset($_POST['bounding_radius']) && $_POST['bounding_radius'] != '') $bounding_radius = $sql->quote_smart($_POST['bounding_radius']);
    15281537        else $bounding_radius = 0;
    1529  if (isset($_POST['trainer_type']) && $_POST['trainer_type'] != '') $trainer_type = $mysql->quote_smart($_POST['trainer_type']);
     1538 if (isset($_POST['trainer_type']) && $_POST['trainer_type'] != '') $trainer_type = $sql->quote_smart($_POST['trainer_type']);
    15301539        else $trainer_type = 0;
    1531  if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $mysql->quote_smart($_POST['trainer_spell']);
     1540 if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $sql->quote_smart($_POST['trainer_spell']);
    15321541        else $trainer_spell = 0;
    1533  if (isset($_POST['class']) && $_POST['class'] != '') $class = $mysql->quote_smart($_POST['class']);
     1542 if (isset($_POST['class']) && $_POST['class'] != '') $class = $sql->quote_smart($_POST['class']);
    15341543        else $class = 0;
    1535  if (isset($_POST['race']) && $_POST['race'] != '') $race = $mysql->quote_smart($_POST['race']);
     1544 if (isset($_POST['race']) && $_POST['race'] != '') $race = $sql->quote_smart($_POST['race']);
    15361545        else $race = 0;
    1537  if (isset($_POST['minrangedmg']) && $_POST['minrangedmg'] != '') $minrangedmg = $mysql->quote_smart($_POST['minrangedmg']);
     1546 if (isset($_POST['minrangedmg']) && $_POST['minrangedmg'] != '') $minrangedmg = $sql->quote_smart($_POST['minrangedmg']);
    15381547        else $minrangedmg = 0;
    1539  if (isset($_POST['maxrangedmg']) && $_POST['maxrangedmg'] != '') $maxrangedmg = $mysql->quote_smart($_POST['maxrangedmg']);
     1548 if (isset($_POST['maxrangedmg']) && $_POST['maxrangedmg'] != '') $maxrangedmg = $sql->quote_smart($_POST['maxrangedmg']);
    15401549        else $maxrangedmg = 0;
    1541  if (isset($_POST['rangedattackpower']) && $_POST['rangedattackpower'] != '') $rangedattackpower = $mysql->quote_smart($_POST['rangedattackpower']);
     1550 if (isset($_POST['rangedattackpower']) && $_POST['rangedattackpower'] != '') $rangedattackpower = $sql->quote_smart($_POST['rangedattackpower']);
    15421551        else $rangedattackpower = 0;
    1543  if (isset($_POST['combat_reach']) && $_POST['combat_reach'] != '') $combat_reach = $mysql->quote_smart($_POST['combat_reach']);
     1552 if (isset($_POST['combat_reach']) && $_POST['combat_reach'] != '') $combat_reach = $sql->quote_smart($_POST['combat_reach']);
    15441553        else $combat_reach = 0;
    1545  if (isset($_POST['type']) && $_POST['type'] != '') $type = $mysql->quote_smart($_POST['type']);
     1554 if (isset($_POST['type']) && $_POST['type'] != '') $type = $sql->quote_smart($_POST['type']);
    15461555        else $type = 0;
    1547  if (isset($_POST['civilian']) && $_POST['civilian'] != '') $civilian = $mysql->quote_smart($_POST['civilian']);
     1556 if (isset($_POST['civilian']) && $_POST['civilian'] != '') $civilian = $sql->quote_smart($_POST['civilian']);
    15481557        else $civilian = 0;
    1549  if (isset($_POST['flag1']) && $_POST['flag1'] != '') $flag1 = $mysql->quote_smart($_POST['flag1']);
     1558 if (isset($_POST['flag1']) && $_POST['flag1'] != '') $flag1 = $sql->quote_smart($_POST['flag1']);
    15501559        else $flag1 = 0;
    1551  if (isset($_POST['equipmodel1']) && $_POST['equipmodel1'] != '') $equipmodel1 = $mysql->quote_smart($_POST['equipmodel1']);
     1560 if (isset($_POST['equipmodel1']) && $_POST['equipmodel1'] != '') $equipmodel1 = $sql->quote_smart($_POST['equipmodel1']);
    15521561        else $equipmodel1 = 0;
    1553  if (isset($_POST['equipmodel2']) && $_POST['equipmodel2'] != '') $equipmodel2 = $mysql->quote_smart($_POST['equipmodel2']);
     1562 if (isset($_POST['equipmodel2']) && $_POST['equipmodel2'] != '') $equipmodel2 = $sql->quote_smart($_POST['equipmodel2']);
    15541563        else $equipmodel2 = 0;
    1555  if (isset($_POST['equipmodel3']) && $_POST['equipmodel3'] != '') $equipmodel3 = $mysql->quote_smart($_POST['equipmodel3']);
     1564 if (isset($_POST['equipmodel3']) && $_POST['equipmodel3'] != '') $equipmodel3 = $sql->quote_smart($_POST['equipmodel3']);
    15561565        else $equipmodel3 = 0;
    1557  if (isset($_POST['equipinfo1']) && $_POST['equipinfo1'] != '') $equipinfo1 = $mysql->quote_smart($_POST['equipinfo1']);
     1566 if (isset($_POST['equipinfo1']) && $_POST['equipinfo1'] != '') $equipinfo1 = $sql->quote_smart($_POST['equipinfo1']);
    15581567        else $equipinfo1 = 0;
    1559  if (isset($_POST['equipinfo2']) && $_POST['equipinfo2'] != '') $equipinfo2 = $mysql->quote_smart($_POST['equipinfo2']);
     1568 if (isset($_POST['equipinfo2']) && $_POST['equipinfo2'] != '') $equipinfo2 = $sql->quote_smart($_POST['equipinfo2']);
    15601569        else $equipinfo2 = 0;
    1561  if (isset($_POST['equipinfo3']) && $_POST['equipinfo3'] != '') $equipinfo3 = $mysql->quote_smart($_POST['equipinfo3']);
     1570 if (isset($_POST['equipinfo3']) && $_POST['equipinfo3'] != '') $equipinfo3 = $sql->quote_smart($_POST['equipinfo3']);
    15621571        else $equipinfo3 = 0;
    1563  if (isset($_POST['equipslot1']) && $_POST['equipslot1'] != '') $equipslot1 = $mysql->quote_smart($_POST['equipslot1']);
     1572 if (isset($_POST['equipslot1']) && $_POST['equipslot1'] != '') $equipslot1 = $sql->quote_smart($_POST['equipslot1']);
    15641573        else $equipslot1 = 0;
    1565  if (isset($_POST['equipslot2']) && $_POST['equipslot2'] != '') $equipslot2 = $mysql->quote_smart($_POST['equipslot2']);
     1574 if (isset($_POST['equipslot2']) && $_POST['equipslot2'] != '') $equipslot2 = $sql->quote_smart($_POST['equipslot2']);
    15661575        else $equipslot2 = 0;
    1567  if (isset($_POST['equipslot3']) && $_POST['equipslot3'] != '') $equipslot3 = $mysql->quote_smart($_POST['equipslot3']);
     1576 if (isset($_POST['equipslot3']) && $_POST['equipslot3'] != '') $equipslot3 = $sql->quote_smart($_POST['equipslot3']);
    15681577        else $equipslot3 = 0;
    1569  if (isset($_POST['lootid']) && $_POST['lootid'] != '') $lootid = $mysql->quote_smart($_POST['lootid']);
     1578 if (isset($_POST['lootid']) && $_POST['lootid'] != '') $lootid = $sql->quote_smart($_POST['lootid']);
    15701579         else $lootid = 0;     
    1571  if (isset($_POST['pickpocketloot']) && $_POST['pickpocketloot'] != '') $pickpocketloot = $mysql->quote_smart($_POST['pickpocketloot']);
     1580 if (isset($_POST['pickpocketloot']) && $_POST['pickpocketloot'] != '') $pickpocketloot = $sql->quote_smart($_POST['pickpocketloot']);
    15721581        else $pickpocketloot = 0;
    1573  if (isset($_POST['skinloot']) && $_POST['skinloot'] != '') $skinloot = $mysql->quote_smart($_POST['skinloot']);
     1582 if (isset($_POST['skinloot']) && $_POST['skinloot'] != '') $skinloot = $sql->quote_smart($_POST['skinloot']);
    15741583        else $skinloot = 0;
    1575  if (isset($_POST['resistance1']) && $_POST['resistance1'] != '') $resistance1 = $mysql->quote_smart($_POST['resistance1']);
     1584 if (isset($_POST['resistance1']) && $_POST['resistance1'] != '') $resistance1 = $sql->quote_smart($_POST['resistance1']);
    15761585        else $resistance1 = 0;
    1577  if (isset($_POST['resistance2']) && $_POST['resistance2'] != '') $resistance2 = $mysql->quote_smart($_POST['resistance2']);
     1586 if (isset($_POST['resistance2']) && $_POST['resistance2'] != '') $resistance2 = $sql->quote_smart($_POST['resistance2']);
    15781587        else $resistance2 = 0;
    1579  if (isset($_POST['resistance3']) && $_POST['resistance3'] != '') $resistance3 = $mysql->quote_smart($_POST['resistance3']);
     1588 if (isset($_POST['resistance3']) && $_POST['resistance3'] != '') $resistance3 = $sql->quote_smart($_POST['resistance3']);
    15801589        else $resistance3 = 0;
    1581  if (isset($_POST['resistance4']) && $_POST['resistance4'] != '') $resistance4 = $mysql->quote_smart($_POST['resistance4']);
     1590 if (isset($_POST['resistance4']) && $_POST['resistance4'] != '') $resistance4 = $sql->quote_smart($_POST['resistance4']);
    15821591        else $resistance4 = 0;
    1583  if (isset($_POST['resistance5']) && $_POST['resistance5'] != '') $resistance5 = $mysql->quote_smart($_POST['resistance5']);
     1592 if (isset($_POST['resistance5']) && $_POST['resistance5'] != '') $resistance5 = $sql->quote_smart($_POST['resistance5']);
    15841593        else $resistance5 = 0;
    1585  if (isset($_POST['resistance6']) && $_POST['resistance6'] != '') $resistance6 = $mysql->quote_smart($_POST['resistance6']);
     1594 if (isset($_POST['resistance6']) && $_POST['resistance6'] != '') $resistance6 = $sql->quote_smart($_POST['resistance6']);
    15861595        else $resistance6 = 0;
    1587  if (isset($_POST['spell1']) && $_POST['spell1'] != '') $spell1 = $mysql->quote_smart($_POST['spell1']);
     1596 if (isset($_POST['spell1']) && $_POST['spell1'] != '') $spell1 = $sql->quote_smart($_POST['spell1']);
    15881597        else $spell1 = 0;
    1589  if (isset($_POST['spell2']) && $_POST['spell2'] != '') $spell2 = $mysql->quote_smart($_POST['spell2']);
     1598 if (isset($_POST['spell2']) && $_POST['spell2'] != '') $spell2 = $sql->quote_smart($_POST['spell2']);
    15901599        else $spell2 = 0;
    1591  if (isset($_POST['spell3']) && $_POST['spell3'] != '') $spell3 = $mysql->quote_smart($_POST['spell3']);
     1600 if (isset($_POST['spell3']) && $_POST['spell3'] != '') $spell3 = $sql->quote_smart($_POST['spell3']);
    15921601        else $spell3 = 0;
    1593  if (isset($_POST['spell4']) && $_POST['spell4'] != '') $spell4 = $mysql->quote_smart($_POST['spell4']);
     1602 if (isset($_POST['spell4']) && $_POST['spell4'] != '') $spell4 = $sql->quote_smart($_POST['spell4']);
    15941603        else $spell4 = 0;
    1595  if (isset($_POST['mingold']) && $_POST['mingold'] != '') $mingold = $mysql->quote_smart($_POST['mingold']);
     1604 if (isset($_POST['mingold']) && $_POST['mingold'] != '') $mingold = $sql->quote_smart($_POST['mingold']);
    15961605        else $mingold = 0;
    1597  if (isset($_POST['maxgold']) && $_POST['maxgold'] != '') $maxgold = $mysql->quote_smart($_POST['maxgold']);
     1606 if (isset($_POST['maxgold']) && $_POST['maxgold'] != '') $maxgold = $sql->quote_smart($_POST['maxgold']);
    15981607        else $maxgold = 0;
    1599  if (isset($_POST['AIName']) && $_POST['AIName'] != '') $AIName = $mysql->quote_smart($_POST['AIName']);
     1608 if (isset($_POST['AIName']) && $_POST['AIName'] != '') $AIName = $sql->quote_smart($_POST['AIName']);
    16001609        else $AIName = "";
    1601  if (isset($_POST['MovementType']) && $_POST['MovementType'] != '') $MovementType = $mysql->quote_smart($_POST['MovementType']);
     1610 if (isset($_POST['MovementType']) && $_POST['MovementType'] != '') $MovementType = $sql->quote_smart($_POST['MovementType']);
    16021611        else $MovementType = 0;
    1603   if (isset($_POST['InhabitType']) && $_POST['InhabitType'] != '') $InhabitType = $mysql->quote_smart($_POST['InhabitType']);
     1612 if (isset($_POST['InhabitType']) && $_POST['InhabitType'] != '') $InhabitType = $sql->quote_smart($_POST['InhabitType']);
    16041613        else $InhabitType = 0;
    1605  if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
     1614 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
    16061615        else $ScriptName = "";
    1607 
    1608         if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $mysql->quote_smart($_POST['ChanceOrRef']);
     1616 if (isset($_POST['RacialLeader']) && $_POST['RacialLeader'] != '') $RacialLeader = $sql->quote_smart($_POST['RacialLeader']);
     1617        else $RacialLeader = 0;
     1618
     1619        if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $sql->quote_smart($_POST['ChanceOrRef']);
    16091620                else $ChanceOrRef = 0;
    1610         if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $mysql->quote_smart($_POST['QuestChanceOrGroup']);
     1621        if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $sql->quote_smart($_POST['QuestChanceOrGroup']);
    16111622                else $QuestChanceOrGroup = 0;
    1612         if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $mysql->quote_smart($_POST['mincount']);
     1623        if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $sql->quote_smart($_POST['mincount']);
    16131624                else $mincount = 0;
    1614         if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $mysql->quote_smart($_POST['maxcount']);
     1625        if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $sql->quote_smart($_POST['maxcount']);
    16151626                else $maxcount = 0;
    1616         if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $mysql->quote_smart($_POST['quest_freeforall']);
     1627        if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $sql->quote_smart($_POST['quest_freeforall']);
    16171628                else $quest_freeforall = 0;
    1618         if (isset($_POST['item']) && $_POST['item'] != '') $item = $mysql->quote_smart($_POST['item']);
     1629        if (isset($_POST['item']) && $_POST['item'] != '') $item = $sql->quote_smart($_POST['item']);
    16191630                else $item = 0;
    1620         if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $mysql->quote_smart($_POST['del_loot_items']);
     1631        if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $sql->quote_smart($_POST['del_loot_items']);
    16211632                else $del_loot_items = NULL;
    16221633       
    1623         if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $mysql->quote_smart($_POST['involvedrelation']);
     1634        if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $sql->quote_smart($_POST['involvedrelation']);
    16241635                else $involvedrelation = 0;
    1625         if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $mysql->quote_smart($_POST['del_involvedrelation']);
     1636        if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $sql->quote_smart($_POST['del_involvedrelation']);
    16261637                else $del_involvedrelation = NULL;
    1627         if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $mysql->quote_smart($_POST['questrelation']);
     1638        if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $sql->quote_smart($_POST['questrelation']);
    16281639                else $questrelation = 0;
    1629         if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $mysql->quote_smart($_POST['del_questrelation']);
     1640        if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $sql->quote_smart($_POST['del_questrelation']);
    16301641                else $del_questrelation = NULL;
    16311642
    1632         if (isset($_POST['del_vendor_item']) && $_POST['del_vendor_item'] != '') $del_vendor_item = $mysql->quote_smart($_POST['del_vendor_item']);
     1643        if (isset($_POST['del_vendor_item']) && $_POST['del_vendor_item'] != '') $del_vendor_item = $sql->quote_smart($_POST['del_vendor_item']);
    16331644                else $del_vendor_item = NULL;
    1634         if (isset($_POST['vendor_item']) && $_POST['vendor_item'] != '') $vendor_item = $mysql->quote_smart($_POST['vendor_item']);
     1645        if (isset($_POST['vendor_item']) && $_POST['vendor_item'] != '') $vendor_item = $sql->quote_smart($_POST['vendor_item']);
    16351646                else $vendor_item = 0;
    1636         if (isset($_POST['vendor_maxcount']) && $_POST['vendor_maxcount'] != '') $vendor_maxcount = $mysql->quote_smart($_POST['vendor_maxcount']);
     1647        if (isset($_POST['vendor_maxcount']) && $_POST['vendor_maxcount'] != '') $vendor_maxcount = $sql->quote_smart($_POST['vendor_maxcount']);
    16371648                else $vendor_maxcount = 0;
    1638         if (isset($_POST['vendor_incrtime']) && $_POST['vendor_incrtime'] != '') $vendor_incrtime = $mysql->quote_smart($_POST['vendor_incrtime']);
     1649        if (isset($_POST['vendor_incrtime']) && $_POST['vendor_incrtime'] != '') $vendor_incrtime = $sql->quote_smart($_POST['vendor_incrtime']);
    16391650                else $vendor_incrtime = 0;
    16401651
    1641         if (isset($_POST['skin_ChanceOrRef']) && $_POST['skin_ChanceOrRef'] != '') $skin_ChanceOrRef = $mysql->quote_smart($_POST['skin_ChanceOrRef']);
     1652        if (isset($_POST['skin_ChanceOrRef']) && $_POST['skin_ChanceOrRef'] != '') $skin_ChanceOrRef = $sql->quote_smart($_POST['skin_ChanceOrRef']);
    16421653                else $skin_ChanceOrRef = 0;
    1643         if (isset($_POST['skin_QuestChanceOrGroup']) && $_POST['skin_QuestChanceOrGroup'] != '') $skin_QuestChanceOrGroup = $mysql->quote_smart($_POST['skin_QuestChanceOrGroup']);
     1654        if (isset($_POST['skin_QuestChanceOrGroup']) && $_POST['skin_QuestChanceOrGroup'] != '') $skin_QuestChanceOrGroup = $sql->quote_smart($_POST['skin_QuestChanceOrGroup']);
    16441655                else $skin_QuestChanceOrGroup = 0;
    1645         if (isset($_POST['skin_mincount']) && $_POST['skin_mincount'] != '') $skin_mincount = $mysql->quote_smart($_POST['skin_mincount']);
     1656        if (isset($_POST['skin_mincount']) && $_POST['skin_mincount'] != '') $skin_mincount = $sql->quote_smart($_POST['skin_mincount']);
    16461657                else $skin_mincount = 0;
    1647         if (isset($_POST['skin_maxcount']) && $_POST['skin_maxcount'] != '') $skin_maxcount = $mysql->quote_smart($_POST['skin_maxcount']);
     1658        if (isset($_POST['skin_maxcount']) && $_POST['skin_maxcount'] != '') $skin_maxcount = $sql->quote_smart($_POST['skin_maxcount']);
    16481659                else $skin_maxcount = 0;
    1649         if (isset($_POST['skin_quest_freeforall']) && $_POST['skin_quest_freeforall'] != '') $skin_quest_freeforall = $mysql->quote_smart($_POST['skin_quest_freeforall']);
     1660        if (isset($_POST['skin_quest_freeforall']) && $_POST['skin_quest_freeforall'] != '') $skin_quest_freeforall = $sql->quote_smart($_POST['skin_quest_freeforall']);
    16501661                else $skin_quest_freeforall = 0;
    1651         if (isset($_POST['skin_item']) && $_POST['skin_item'] != '') $skin_item = $mysql->quote_smart($_POST['skin_item']);
     1662        if (isset($_POST['skin_item']) && $_POST['skin_item'] != '') $skin_item = $sql->quote_smart($_POST['skin_item']);
    16521663                else $skin_item = 0;
    1653         if (isset($_POST['del_skin_items']) && $_POST['del_skin_items'] != '') $del_skin_items = $mysql->quote_smart($_POST['del_skin_items']);
     1664        if (isset($_POST['del_skin_items']) && $_POST['del_skin_items'] != '') $del_skin_items = $sql->quote_smart($_POST['del_skin_items']);
    16541665                else $del_skin_items = NULL;
    16551666
    1656         if (isset($_POST['pp_ChanceOrRef']) && $_POST['pp_ChanceOrRef'] != '') $pp_ChanceOrRef = $mysql->quote_smart($_POST['pp_ChanceOrRef']);
     1667        if (isset($_POST['pp_ChanceOrRef']) && $_POST['pp_ChanceOrRef'] != '') $pp_ChanceOrRef = $sql->quote_smart($_POST['pp_ChanceOrRef']);
    16571668                else $pp_ChanceOrRef = 0;
    1658         if (isset($_POST['pp_QuestChanceOrGroup']) && $_POST['pp_QuestChanceOrGroup'] != '') $pp_QuestChanceOrGroup = $mysql->quote_smart($_POST['pp_QuestChanceOrGroup']);
     1669        if (isset($_POST['pp_QuestChanceOrGroup']) && $_POST['pp_QuestChanceOrGroup'] != '') $pp_QuestChanceOrGroup = $sql->quote_smart($_POST['pp_QuestChanceOrGroup']);
    16591670                else $pp_QuestChanceOrGroup = 0;
    1660         if (isset($_POST['pp_mincount']) && $_POST['pp_mincount'] != '') $pp_mincount = $mysql->quote_smart($_POST['pp_mincount']);
     1671        if (isset($_POST['pp_mincount']) && $_POST['pp_mincount'] != '') $pp_mincount = $sql->quote_smart($_POST['pp_mincount']);
    16611672                else $pp_mincount = 0;
    1662         if (isset($_POST['pp_maxcount']) && $_POST['pp_maxcount'] != '') $pp_maxcount = $mysql->quote_smart($_POST['pp_maxcount']);
     1673        if (isset($_POST['pp_maxcount']) && $_POST['pp_maxcount'] != '') $pp_maxcount = $sql->quote_smart($_POST['pp_maxcount']);
    16631674                else $pp_maxcount = 0;
    1664         if (isset($_POST['pp_quest_freeforall']) && $_POST['pp_quest_freeforall'] != '') $pp_quest_freeforall = $mysql->quote_smart($_POST['pp_quest_freeforall']);
     1675        if (isset($_POST['pp_quest_freeforall']) && $_POST['pp_quest_freeforall'] != '') $pp_quest_freeforall = $sql->quote_smart($_POST['pp_quest_freeforall']);
    16651676                else $pp_quest_freeforall = 0;
    1666         if (isset($_POST['pp_item']) && $_POST['pp_item'] != '') $pp_item = $mysql->quote_smart($_POST['pp_item']);
     1677        if (isset($_POST['pp_item']) && $_POST['pp_item'] != '') $pp_item = $sql->quote_smart($_POST['pp_item']);
    16671678                else $pp_item = 0;
    1668         if (isset($_POST['del_pp_items']) && $_POST['del_pp_items'] != '') $del_pp_items = $mysql->quote_smart($_POST['del_pp_items']);
     1679        if (isset($_POST['del_pp_items']) && $_POST['del_pp_items'] != '') $del_pp_items = $sql->quote_smart($_POST['del_pp_items']);
    16691680                else $del_pp_items = NULL;
    16701681
    1671         if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $mysql->quote_smart($_POST['trainer_spell']);
     1682        if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $sql->quote_smart($_POST['trainer_spell']);
    16721683                else $trainer_spell = 0;
    1673         if (isset($_POST['spellcost']) && $_POST['spellcost'] != '') $spellcost = $mysql->quote_smart($_POST['spellcost']);
     1684        if (isset($_POST['spellcost']) && $_POST['spellcost'] != '') $spellcost = $sql->quote_smart($_POST['spellcost']);
    16741685                else $spellcost = 0;
    1675         if (isset($_POST['reqskill']) && $_POST['reqskill'] != '') $reqskill = $mysql->quote_smart($_POST['reqskill']);
     1686        if (isset($_POST['reqskill']) && $_POST['reqskill'] != '') $reqskill = $sql->quote_smart($_POST['reqskill']);
    16761687                else $reqskill = 0;
    1677         if (isset($_POST['reqskillvalue']) && $_POST['reqskillvalue'] != '') $reqskillvalue = $mysql->quote_smart($_POST['reqskillvalue']);
     1688        if (isset($_POST['reqskillvalue']) && $_POST['reqskillvalue'] != '') $reqskillvalue = $sql->quote_smart($_POST['reqskillvalue']);
    16781689                else $reqskillvalue = 0;
    1679         if (isset($_POST['reqlevel']) && $_POST['reqlevel'] != '') $reqlevel = $mysql->quote_smart($_POST['reqlevel']);
     1690        if (isset($_POST['reqlevel']) && $_POST['reqlevel'] != '') $reqlevel = $sql->quote_smart($_POST['reqlevel']);
    16801691                else $reqlevel = 0;
    1681         if (isset($_POST['del_trainer_spell']) && $_POST['del_trainer_spell'] != '') $del_trainer_spell = $mysql->quote_smart($_POST['del_trainer_spell']);
     1692        if (isset($_POST['del_trainer_spell']) && $_POST['del_trainer_spell'] != '') $del_trainer_spell = $sql->quote_smart($_POST['del_trainer_spell']);
    16821693                else $del_trainer_spell = NULL;
    16831694
     
    17031714
    17041715  if ($_POST['opp_type'] == "add_new"){
    1705         $sql = "INSERT INTO creature_template ( entry, modelid_m, modelid_f, name, subname, minlevel,
     1716        $sql_query = "INSERT INTO creature_template ( entry, modelid_m, modelid_f, name, subname, minlevel,
    17061717        maxlevel, minhealth, maxhealth, minmana, maxmana, armor, faction, npcflag, speed, rank, mindmg,
    17071718        maxdmg, attackpower, baseattacktime, rangeattacktime, flags, dynamicflags, size, family,
     
    17101721        equipinfo3, equipslot1, equipslot2, equipslot3, lootid, pickpocketloot, skinloot, resistance1,
    17111722        resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4,
    1712         mingold, maxgold, AIName, MovementType, InhabitType, ScriptName ) VALUES ( '$entry', '$modelid_m', '$modelid_f', '$name',
     1723        mingold, maxgold, AIName, MovementType, InhabitType, RacialLeader, ScriptName) VALUES ( '$entry', '$modelid_m', '$modelid_f', '$name',
    17131724        '$subname', '$minlevel', '$maxlevel', '$minhealth', '$maxhealth', '$minmana', '$maxmana', '$armor', '$faction', '$npcflag',
    17141725        '$speed', '$rank', '$mindmg', '$maxdmg', '$attackpower', '$baseattacktime', '$rangeattacktime', '$flags',
     
    17181729        '$equipslot2', '$equipslot3', '$lootid', '$pickpocketloot', '$skinloot', '$resistance1', '$resistance2',
    17191730        '$resistance3', '$resistance4', '$resistance5', '$resistance6', '$spell1', '$spell2', '$spell3', '$spell4',
    1720         '$mingold', '$maxgold', '$AIName', '$MovementType', '$InhabitType', '$ScriptName' )";
     1731        '$mingold', '$maxgold', '$AIName', '$MovementType', '$InhabitType', '$RacialLeader', '$ScriptName' )";
    17211732
    17221733 } elseif ($_POST['opp_type'] == "edit"){
    17231734
    1724         $sql = "UPDATE creature_template SET  ";
    1725  
    1726         $result = $mysql->query("SELECT * FROM creature_template WHERE entry = '$entry'");
    1727         if ($mob_templ = $mysql->fetch_assoc($result)){
    1728                 if ($mob_templ['modelid_m'] != $modelid_m) $sql .= "modelid_m='$modelid_m',";
    1729                 if ($mob_templ['modelid_f'] != $modelid_f) $sql .= "modelid_f='$modelid_f',";
    1730                 if ($mob_templ['name'] != $name) $sql .= "name='$name',";
    1731                 if ($mob_templ['subname'] != $subname) $sql .= "subname='$subname',";
    1732                 if ($mob_templ['minlevel'] != $minlevel) $sql .= "minlevel='$minlevel',";
    1733                 if ($mob_templ['maxlevel'] != $maxlevel) $sql .= "maxlevel='$maxlevel',";
    1734                 if ($mob_templ['minhealth'] != $minhealth) $sql .= "minhealth='$minhealth',";
    1735                 if ($mob_templ['maxhealth'] != $maxhealth) $sql .= "maxhealth='$maxhealth',";
    1736                 if ($mob_templ['minmana'] != $minmana) $sql .= "minmana='$minmana',";
    1737                 if ($mob_templ['maxmana'] != $maxmana) $sql .= "maxmana='$maxmana',";
    1738                 if ($mob_templ['armor'] != $armor) $sql .= "armor='$armor',";
    1739                 if ($mob_templ['faction'] != $faction) $sql .= "faction='$faction',";
    1740                 if ($mob_templ['npcflag'] != $npcflag) $sql .= "npcflag='$npcflag',";
    1741                 if ($mob_templ['speed'] != $speed) $sql .= "speed='$speed',";
    1742                 if ($mob_templ['rank'] != $rank) $sql .= "rank='$rank',";
    1743                 if ($mob_templ['mindmg'] != $mindmg) $sql .= "mindmg='$mindmg',";
    1744                 if ($mob_templ['maxdmg'] != $maxdmg) $sql .= "maxdmg='$maxdmg',";
    1745                 if ($mob_templ['attackpower'] != $attackpower) $sql .= "attackpower='$attackpower',";
    1746                 if ($mob_templ['baseattacktime'] != $baseattacktime) $sql .= "baseattacktime='$baseattacktime',";
    1747                 if ($mob_templ['rangeattacktime'] != $rangeattacktime) $sql .= "rangeattacktime='$rangeattacktime',";
    1748                 if ($mob_templ['flags'] != $flags) $sql .= "flags='$flags',";
    1749                 if ($mob_templ['dynamicflags'] != $dynamicflags) $sql .= "dynamicflags='$dynamicflags',";
    1750                 if ($mob_templ['size'] != $size) $sql .= "size='$size',";
    1751                 if ($mob_templ['family'] != $family) $sql .= "family='$family',";
    1752                 if ($mob_templ['bounding_radius'] != $bounding_radius) $sql .= "bounding_radius='$bounding_radius',";
    1753                 if ($mob_templ['trainer_type'] != $trainer_type) $sql .= "trainer_type='$trainer_type',";
    1754                 if ($mob_templ['trainer_spell'] != $trainer_spell) $sql .= "trainer_spell='$trainer_spell',";
    1755                 if ($mob_templ['class'] != $class) $sql .= "class='$class',";
    1756                 if ($mob_templ['race'] != $race) $sql .= "race='$race',";
    1757                 if ($mob_templ['minrangedmg'] != $minrangedmg) $sql .= "minrangedmg='$minrangedmg',";
    1758                 if ($mob_templ['maxrangedmg'] != $maxrangedmg) $sql .= "maxrangedmg='$maxrangedmg',";
    1759                 if ($mob_templ['rangedattackpower'] != $rangedattackpower) $sql .= "rangedattackpower='$rangedattackpower',";
    1760                 if ($mob_templ['combat_reach'] != $combat_reach) $sql .= "combat_reach='$combat_reach',";
    1761                 if ($mob_templ['type'] != $type) $sql .= "type='$type',";
    1762                 if ($mob_templ['civilian'] != $civilian) $sql .= "civilian='$civilian',";
    1763                 if ($mob_templ['flag1'] != $flag1) $sql .= "flag1='$flag1',";
    1764                 if ($mob_templ['equipmodel1'] != $equipmodel1) $sql .= "equipmodel1='$equipmodel1',";
    1765                 if ($mob_templ['equipmodel2'] != $equipmodel2) $sql .= "equipmodel2='$equipmodel2',";
    1766                 if ($mob_templ['equipmodel3'] != $equipmodel3) $sql .= "equipmodel3='$equipmodel3',";
    1767                 if ($mob_templ['equipinfo1'] != $equipinfo1) $sql .= "equipinfo1='$equipinfo1',";
    1768                 if ($mob_templ['equipinfo2'] != $equipinfo2) $sql .= "equipinfo2='$equipinfo2',";
    1769                 if ($mob_templ['equipinfo3'] != $equipinfo3) $sql .= "equipinfo3='$equipinfo3',";
    1770                 if ($mob_templ['equipslot1'] != $equipslot1) $sql .= "equipslot1='$equipslot1',";
    1771                 if ($mob_templ['equipslot2'] != $equipslot2) $sql .= "equipslot2='$equipslot2',";
    1772                 if ($mob_templ['equipslot3'] != $equipslot3) $sql .= "equipslot3='$equipslot3',";
    1773                 if ($mob_templ['lootid'] != $lootid) $sql .= "lootid='$lootid',";
    1774                 if ($mob_templ['pickpocketloot'] != $pickpocketloot) $sql .= "pickpocketloot='$pickpocketloot',";
    1775                 if ($mob_templ['skinloot'] != $skinloot) $sql .= "skinloot='$skinloot',";
    1776                 if ($mob_templ['resistance1'] != $resistance1) $sql .= "resistance1='$resistance1',";
    1777                 if ($mob_templ['resistance2'] != $resistance2) $sql .= "resistance2='$resistance2',";
    1778                 if ($mob_templ['resistance3'] != $resistance3) $sql .= "resistance3='$resistance3',";
    1779                 if ($mob_templ['resistance4'] != $resistance4) $sql .= "resistance4='$resistance4',";
    1780                 if ($mob_templ['resistance5'] != $resistance5) $sql .= "resistance5='$resistance5',";
    1781                 if ($mob_templ['resistance6'] != $resistance6) $sql .= "resistance6='$resistance6',";
    1782                 if ($mob_templ['spell1'] != $spell1) $sql .= "spell1='$spell1',";
    1783                 if ($mob_templ['spell2'] != $spell2) $sql .= "spell2='$spell2',";
    1784                 if ($mob_templ['spell3'] != $spell3) $sql .= "spell3='$spell3',";
    1785                 if ($mob_templ['spell4'] != $spell4) $sql .= "spell4='$spell4',";
    1786                 if ($mob_templ['mingold'] != $mingold) $sql .= "mingold='$mingold',";
    1787                 if ($mob_templ['maxgold'] != $maxgold) $sql .= "maxgold='$maxgold',";
    1788                 if ($mob_templ['AIName'] != $AIName) $sql .= "AIName='$AIName',";
    1789                 if ($mob_templ['MovementType'] != $MovementType) $sql .= "MovementType='$MovementType',";
    1790                 if ($mob_templ['InhabitType'] != $InhabitType) $sql .= "InhabitType='$InhabitType',";
    1791                 if ($mob_templ['ScriptName'] != $ScriptName) $sql .= "ScriptName='$ScriptName',";
    1792 
    1793           $mysql->free_result($result);
     1735        $sql_query = "UPDATE creature_template SET  ";
     1736 
     1737        $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$entry'");
     1738        if ($mob_templ = $sql->fetch_assoc($result)){
     1739                if ($mob_templ['modelid_m'] != $modelid_m) $sql_query .= "modelid_m='$modelid_m',";
     1740                if ($mob_templ['modelid_f'] != $modelid_f) $sql_query .= "modelid_f='$modelid_f',";
     1741                if ($mob_templ['name'] != $name) $sql_query .= "name='$name',";
     1742                if ($mob_templ['subname'] != $subname) $sql_query .= "subname='$subname',";
     1743                if ($mob_templ['minlevel'] != $minlevel) $sql_query .= "minlevel='$minlevel',";
     1744                if ($mob_templ['maxlevel'] != $maxlevel) $sql_query .= "maxlevel='$maxlevel',";
     1745                if ($mob_templ['minhealth'] != $minhealth) $sql_query .= "minhealth='$minhealth',";
     1746                if ($mob_templ['maxhealth'] != $maxhealth) $sql_query .= "maxhealth='$maxhealth',";
     1747                if ($mob_templ['minmana'] != $minmana) $sql_query .= "minmana='$minmana',";
     1748                if ($mob_templ['maxmana'] != $maxmana) $sql_query .= "maxmana='$maxmana',";
     1749                if ($mob_templ['armor'] != $armor) $sql_query .= "armor='$armor',";
     1750                if ($mob_templ['faction'] != $faction) $sql_query .= "faction='$faction',";
     1751                if ($mob_templ['npcflag'] != $npcflag) $sql_query .= "npcflag='$npcflag',";
     1752                if ($mob_templ['speed'] != $speed) $sql_query .= "speed='$speed',";
     1753                if ($mob_templ['rank'] != $rank) $sql_query .= "rank='$rank',";
     1754                if ($mob_templ['mindmg'] != $mindmg) $sql_query .= "mindmg='$mindmg',";
     1755                if ($mob_templ['maxdmg'] != $maxdmg) $sql_query .= "maxdmg='$maxdmg',";
     1756                if ($mob_templ['attackpower'] != $attackpower) $sql_query .= "attackpower='$attackpower',";
     1757                if ($mob_templ['baseattacktime'] != $baseattacktime) $sql_query .= "baseattacktime='$baseattacktime',";
     1758                if ($mob_templ['rangeattacktime'] != $rangeattacktime) $sql_query .= "rangeattacktime='$rangeattacktime',";
     1759                if ($mob_templ['flags'] != $flags) $sql_query .= "flags='$flags',";
     1760                if ($mob_templ['dynamicflags'] != $dynamicflags) $sql_query .= "dynamicflags='$dynamicflags',";
     1761                if ($mob_templ['size'] != $size) $sql_query .= "size='$size',";
     1762                if ($mob_templ['family'] != $family) $sql_query .= "family='$family',";
     1763                if ($mob_templ['bounding_radius'] != $bounding_radius) $sql_query .= "bounding_radius='$bounding_radius',";
     1764                if ($mob_templ['trainer_type'] != $trainer_type) $sql_query .= "trainer_type='$trainer_type',";
     1765                if ($mob_templ['trainer_spell'] != $trainer_spell) $sql_query .= "trainer_spell='$trainer_spell',";
     1766                if ($mob_templ['class'] != $class) $sql_query .= "class='$class',";
     1767                if ($mob_templ['race'] != $race) $sql_query .= "race='$race',";
     1768                if ($mob_templ['minrangedmg'] != $minrangedmg) $sql_query .= "minrangedmg='$minrangedmg',";
     1769                if ($mob_templ['maxrangedmg'] != $maxrangedmg) $sql_query .= "maxrangedmg='$maxrangedmg',";
     1770                if ($mob_templ['rangedattackpower'] != $rangedattackpower) $sql_query .= "rangedattackpower='$rangedattackpower',";
     1771                if ($mob_templ['combat_reach'] != $combat_reach) $sql_query .= "combat_reach='$combat_reach',";
     1772                if ($mob_templ['type'] != $type) $sql_query .= "type='$type',";
     1773                if ($mob_templ['civilian'] != $civilian) $sql_query .= "civilian='$civilian',";
     1774                if ($mob_templ['flag1'] != $flag1) $sql_query .= "flag1='$flag1',";
     1775                if ($mob_templ['equipmodel1'] != $equipmodel1) $sql_query .= "equipmodel1='$equipmodel1',";
     1776                if ($mob_templ['equipmodel2'] != $equipmodel2) $sql_query .= "equipmodel2='$equipmodel2',";
     1777                if ($mob_templ['equipmodel3'] != $equipmodel3) $sql_query .= "equipmodel3='$equipmodel3',";
     1778                if ($mob_templ['equipinfo1'] != $equipinfo1) $sql_query .= "equipinfo1='$equipinfo1',";
     1779                if ($mob_templ['equipinfo2'] != $equipinfo2) $sql_query .= "equipinfo2='$equipinfo2',";
     1780                if ($mob_templ['equipinfo3'] != $equipinfo3) $sql_query .= "equipinfo3='$equipinfo3',";
     1781                if ($mob_templ['equipslot1'] != $equipslot1) $sql_query .= "equipslot1='$equipslot1',";
     1782                if ($mob_templ['equipslot2'] != $equipslot2) $sql_query .= "equipslot2='$equipslot2',";
     1783                if ($mob_templ['equipslot3'] != $equipslot3) $sql_query .= "equipslot3='$equipslot3',";
     1784                if ($mob_templ['lootid'] != $lootid) $sql_query .= "lootid='$lootid',";
     1785                if ($mob_templ['pickpocketloot'] != $pickpocketloot) $sql_query .= "pickpocketloot='$pickpocketloot',";
     1786                if ($mob_templ['skinloot'] != $skinloot) $sql_query .= "skinloot='$skinloot',";
     1787                if ($mob_templ['resistance1'] != $resistance1) $sql_query .= "resistance1='$resistance1',";
     1788                if ($mob_templ['resistance2'] != $resistance2) $sql_query .= "resistance2='$resistance2',";
     1789                if ($mob_templ['resistance3'] != $resistance3) $sql_query .= "resistance3='$resistance3',";
     1790                if ($mob_templ['resistance4'] != $resistance4) $sql_query .= "resistance4='$resistance4',";
     1791                if ($mob_templ['resistance5'] != $resistance5) $sql_query .= "resistance5='$resistance5',";
     1792                if ($mob_templ['resistance6'] != $resistance6) $sql_query .= "resistance6='$resistance6',";
     1793                if ($mob_templ['spell1'] != $spell1) $sql_query .= "spell1='$spell1',";
     1794                if ($mob_templ['spell2'] != $spell2) $sql_query .= "spell2='$spell2',";
     1795                if ($mob_templ['spell3'] != $spell3) $sql_query .= "spell3='$spell3',";
     1796                if ($mob_templ['spell4'] != $spell4) $sql_query .= "spell4='$spell4',";
     1797                if ($mob_templ['mingold'] != $mingold) $sql_query .= "mingold='$mingold',";
     1798                if ($mob_templ['maxgold'] != $maxgold) $sql_query .= "maxgold='$maxgold',";
     1799                if ($mob_templ['AIName'] != $AIName) $sql_query .= "AIName='$AIName',";
     1800                if ($mob_templ['MovementType'] != $MovementType) $sql_query .= "MovementType='$MovementType',";
     1801                if ($mob_templ['InhabitType'] != $InhabitType) $sql_query .= "InhabitType='$InhabitType',";
     1802                if ($mob_templ['ScriptName'] != $ScriptName) $sql_query .= "ScriptName='$ScriptName',";
     1803                if ($mob_templ['RacialLeader'] != $RacialLeader) $sql_query .= "RacialLeader='$RacialLeader',";
     1804
     1805          $sql->free_result($result);
    17941806          unset($mob_templ);
    17951807         
    1796         if (($sql == "UPDATE creature_template SET  ")&&(!$item)&&(!$del_loot_items)
     1808        if (($sql_query == "UPDATE creature_template SET  ")&&(!$item)&&(!$del_loot_items)
    17971809                &&(!$del_questrelation)&&(!$questrelation)&&(!$del_involvedrelation)&&(!$involvedrelation)
    17981810                &&(!$del_vendor_item)&&(!$vendor_item)&&(!$del_skin_items)&&(!$skin_item)
    17991811                &&(!$del_pp_items)&&(!$pp_item)&&(!$trainer_spell)&&(!$del_trainer_spell)){
    1800                 $mysql->close();
     1812                $sql->close();
    18011813                redirect("creature.php?action=edit&entry=$entry&error=6");
    18021814                } else {
    1803                                 if ($sql != "UPDATE creature_template SET  "){
    1804                                         $sql[strlen($sql)-1] = " ";
    1805                                         $sql .= " WHERE entry = '$entry';\n";
    1806                                         } else $sql = "";
     1815                                if ($sql_query != "UPDATE creature_template SET  "){
     1816                                        $sql_query[strlen($sql_query)-1] = " ";
     1817                                        $sql_query .= " WHERE entry = '$entry';\n";
     1818                                        } else $sql_query = "";
    18071819                }
    18081820               
    18091821        if ($trainer_spell){
    1810         $sql .= "INSERT INTO npc_trainer (entry, spell, spellcost, reqskill, reqskillvalue, reqlevel)
     1822        $sql_query .= "INSERT INTO npc_trainer (entry, spell, spellcost, reqskill, reqskillvalue, reqlevel)
    18111823                        VALUES ($entry,$trainer_spell,$spellcost,$reqskill ,$reqskillvalue ,$reqlevel);\n";
    18121824        }
     
    18141826        if ($del_trainer_spell){
    18151827        foreach($del_trainer_spell as $spell_id)
    1816                 $sql .= "DELETE FROM npc_trainer WHERE entry = $entry AND spell = $spell_id;\n";
     1828                $sql_query .= "DELETE FROM npc_trainer WHERE entry = $entry AND spell = $spell_id;\n";
    18171829        }
    18181830
    18191831        if ($item){
    1820         $sql .= "INSERT INTO creature_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     1832        $sql_query .= "INSERT INTO creature_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    18211833                        VALUES ($lootid,$item,'$ChanceOrRef', '$QuestChanceOrGroup' ,$mincount ,$maxcount ,$quest_freeforall);\n";
    18221834        }
     
    18241836        if ($del_loot_items){
    18251837        foreach($del_loot_items as $item_id)
    1826                 $sql .= "DELETE FROM creature_loot_template WHERE entry = $lootid AND item = $item_id;\n";
     1838                $sql_query .= "DELETE FROM creature_loot_template WHERE entry = $lootid AND item = $item_id;\n";
    18271839        }
    18281840
    18291841        if ($skin_item){
    1830         $sql .= "INSERT INTO skinning_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     1842        $sql_query .= "INSERT INTO skinning_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    18311843                        VALUES ($skinloot,$skin_item,'$skin_ChanceOrRef', '$skin_QuestChanceOrGroup' ,$skin_mincount ,$skin_maxcount ,$skin_quest_freeforall);\n";
    18321844        }
     
    18341846        if ($del_skin_items){
    18351847        foreach($del_skin_items as $item_id)
    1836                 $sql .= "DELETE FROM skinning_loot_template WHERE entry = $skinloot AND item = $item_id;\n";
     1848                $sql_query .= "DELETE FROM skinning_loot_template WHERE entry = $skinloot AND item = $item_id;\n";
    18371849        }
    18381850   
    18391851        if ($pp_item){
    1840         $sql .= "INSERT INTO pickpocketing_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     1852        $sql_query .= "INSERT INTO pickpocketing_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    18411853                        VALUES ($pickpocketloot,$pp_item,'$pp_ChanceOrRef', '$pp_QuestChanceOrGroup' ,$pp_mincount ,$pp_maxcount ,$pp_quest_freeforall);\n";
    18421854        }
     
    18441856        if ($del_pp_items){
    18451857        foreach($del_pp_items as $item_id)
    1846                 $sql .= "DELETE FROM pickpocketing_loot_template WHERE entry = $pickpocketloot AND item = $item_id;\n";
     1858                $sql_query .= "DELETE FROM pickpocketing_loot_template WHERE entry = $pickpocketloot AND item = $item_id;\n";
    18471859        }
    18481860
    18491861        if ($questrelation){
    1850         $sql .= "INSERT INTO creature_questrelation (id, quest) VALUES ($entry,$questrelation);\n";
     1862        $sql_query .= "INSERT INTO creature_questrelation (id, quest) VALUES ($entry,$questrelation);\n";
    18511863        }
    18521864       
    18531865        if ($involvedrelation){
    1854         $sql .= "INSERT INTO creature_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n";
     1866        $sql_query .= "INSERT INTO creature_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n";
    18551867        }
    18561868
    18571869        if ($del_questrelation){
    18581870        foreach($del_questrelation as $quest_id)
    1859                 $sql .= "DELETE FROM creature_questrelation WHERE id = $entry AND quest = $quest_id;\n";
     1871                $sql_query .= "DELETE FROM creature_questrelation WHERE id = $entry AND quest = $quest_id;\n";
    18601872        }
    18611873
    18621874        if ($del_involvedrelation){
    18631875        foreach($del_involvedrelation as $quest_id)
    1864                 $sql .= "DELETE FROM creature_involvedrelation WHERE id = $entry AND quest = $quest_id;\n";
     1876                $sql_query .= "DELETE FROM creature_involvedrelation WHERE id = $entry AND quest = $quest_id;\n";
    18651877        }
    18661878       
    18671879        if ($del_vendor_item){
    18681880        foreach($del_vendor_item as $item_id)
    1869                 $sql .= "DELETE FROM npc_vendor WHERE entry = $entry AND item = $item_id;\n";
     1881                $sql_query .= "DELETE FROM npc_vendor WHERE entry = $entry AND item = $item_id;\n";
    18701882        }
    18711883       
    18721884        if ($vendor_item){
    1873         $sql .= "INSERT INTO npc_vendor (entry, item, maxcount, incrtime)
     1885        $sql_query .= "INSERT INTO npc_vendor (entry, item, maxcount, incrtime)
    18741886                        VALUES ($entry,$vendor_item,$vendor_maxcount,$vendor_incrtime);\n";
    18751887        }
    18761888
    18771889 } else {
    1878                 $mysql->close();
     1890                $sql->close();
    18791891                redirect("creature.php?error=5");
    18801892                }
    18811893 } else {
    1882         $mysql->close();
     1894        $sql->close();
    18831895        redirect("creature.php?error=5");
    18841896        }
    18851897
    18861898 if ( isset($_POST['backup_op']) && ($_POST['backup_op'] == 1) ){
    1887         $mysql->close();
     1899        $sql->close();
    18881900        Header("Content-type: application/octet-stream");
    18891901        Header("Content-Disposition: attachment; filename=creatureid_$entry.sql");
    1890         echo $sql;
     1902        echo $sql_query;
    18911903        exit();
    18921904        redirect("creature.php?action=edit&entry=$entry&error=4");
    18931905        } else {
    1894                 $sql = explode(';',$sql);
    1895                 foreach($sql as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $mysql->query($tmp_query);
    1896                 $mysql->close();
     1906                $sql_query = explode(';',$sql_query);
     1907                foreach($sql_query as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $sql->query($tmp_query);
     1908                $sql->close();
    18971909                }
    18981910
     
    19341946        else redirect("creature.php?error=1");
    19351947
    1936  $mysql = new MySQL;
    1937  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1938 
    1939   $result = $mysql->query("SELECT guid FROM creature WHERE id = '$entry'");
    1940   while ($guid = $mysql->fetch_row($result)){
    1941         $mysql->query("DELETE FROM creature_movement WHERE id = '$guid'");
     1948 $sql = new SQL;
     1949 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     1950
     1951  $result = $sql->query("SELECT guid FROM creature WHERE id = '$entry'");
     1952  while ($guid = $sql->fetch_row($result)){
     1953        $sql->query("DELETE FROM creature_movement WHERE id = '$guid'");
    19421954        }
    1943  $mysql->query("DELETE FROM creature WHERE id = '$entry'");
    1944  $mysql->query("DELETE FROM creature_template WHERE entry = '$entry'");
    1945  $mysql->query("DELETE FROM creature_onkill_reputation WHERE creature_id = '$entry'");
    1946  $mysql->query("DELETE FROM creature_involvedrelation WHERE id = '$entry'");
    1947  $mysql->query("DELETE FROM creature_questrelation WHERE id = '$entry'");
    1948  $mysql->query("DELETE FROM npc_vendor WHERE entry = '$entry'");
    1949  $mysql->query("DELETE FROM npc_trainer WHERE entry = '$entry'");
    1950  $mysql->query("DELETE FROM npc_gossip WHERE npc_guid = '$entry'");
    1951          
    1952  $mysql->close();
     1955 $sql->query("DELETE FROM creature WHERE id = '$entry'");
     1956 $sql->query("DELETE FROM creature_template WHERE entry = '$entry'");
     1957 $sql->query("DELETE FROM creature_onkill_reputation WHERE creature_id = '$entry'");
     1958 $sql->query("DELETE FROM creature_involvedrelation WHERE id = '$entry'");
     1959 $sql->query("DELETE FROM creature_questrelation WHERE id = '$entry'");
     1960 $sql->query("DELETE FROM npc_vendor WHERE entry = '$entry'");
     1961 $sql->query("DELETE FROM npc_trainer WHERE entry = '$entry'");
     1962 $sql->query("DELETE FROM npc_gossip WHERE npc_guid = '$entry'");
     1963         
     1964 $sql->close();
    19531965 redirect("creature.php");
    19541966 }
     
    19641976        else redirect("creature.php?error=1");
    19651977
    1966  $mysql = new MySQL;
    1967  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1968 
    1969  $result = $mysql->query("SELECT guid FROM creature WHERE id = '$entry'");
    1970  while ($guid = $mysql->fetch_row($result)){
    1971         $mysql->query("DELETE FROM creature_movement WHERE id = '$guid'");
     1978 $sql = new SQL;
     1979 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     1980
     1981 $result = $sql->query("SELECT guid FROM creature WHERE id = '$entry'");
     1982 while ($guid = $sql->fetch_row($result)){
     1983        $sql->query("DELETE FROM creature_movement WHERE id = '$guid'");
    19721984        }
    19731985
    1974  $mysql->query("DELETE FROM creature WHERE id = '$entry'");
    1975  $mysql->close();
     1986 $sql->query("DELETE FROM creature WHERE id = '$entry'");
     1987 $sql->close();
    19761988 redirect("creature.php?action=edit&entry=$entry&error=4");
    19771989 }
  • minimanager/edit.php

    r5 r19  
    1919                $lang_id_tab, $gm_level_arr;
    2020
    21  $mysql = new MySQL;
    22  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    23 
    24  $result = $mysql->query("SELECT email,gmlevel,joindate,tbc FROM account WHERE username ='$user_name'");
    25 
    26  if ($acc = $mysql->fetch_row($result)) {
     21 $sql = new SQL;
     22 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     23
     24 $result = $sql->query("SELECT email,gmlevel,joindate,tbc FROM account WHERE username ='$user_name'");
     25
     26 if ($acc = $sql->fetch_row($result)) {
    2727  require_once("scripts/id_tab.php");
    2828 
     
    7979      </tr>";
    8080
    81         $result = $mysql->query("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '$user_id'");
     81        $result = $sql->query("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '$user_id'");
    8282        $output .= "<tr>
    8383        <td>{$lang_edit['tot_chars']}</td>
    84         <td>".$mysql->result($result, 0)."</td>
     84        <td>".$sql->result($result, 0)."</td>
    8585      </tr>";
    8686         
    87         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    88         $result = $mysql->query("SELECT guid,name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) FROM `character` WHERE account = $user_id");
    89         $chars_on_realm = $mysql->num_rows($result);
     87        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     88        $result = $sql->query("SELECT guid,name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) FROM `character` WHERE account = $user_id");
    9089
    9190        $output .= "<tr>
    9291        <td>{$lang_edit['characters']}</td>
    93         <td>$chars_on_realm</td>
     92        <td>".$sql->num_rows($result)."</td>
    9493      </tr>";
    9594
    96         while ($char = $mysql->fetch_array($result)){
     95        while ($char = $sql->fetch_array($result)){
    9796                $output .= "<tr>
    9897                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'---></td>
     
    171170 } else error($lang_global['err_no_records_found']);
    172171 
    173  $mysql->close();
     172 $sql->close();
    174173}
    175174
     
    184183        redirect("edit.php?error=1");
    185184
    186  $mysql = new MySQL;
    187  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    188 
    189  $new_pass = ($mysql->quote_smart($_POST['pass']) != sha1(strtoupper($user_name).":******")) ? "I='".$mysql->quote_smart($_POST['pass'])."', " : "";
    190  $new_mail = $mysql->quote_smart(trim($_POST['mail']));
    191  $new_tbc = $mysql->quote_smart(trim($_POST['tbc']));
     185 $sql = new SQL;
     186 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     187
     188 $new_pass = ($sql->quote_smart($_POST['pass']) != sha1(strtoupper($user_name).":******")) ? "I='".$sql->quote_smart($_POST['pass'])."', " : "";
     189 $new_mail = $sql->quote_smart(trim($_POST['mail']));
     190 $new_tbc = $sql->quote_smart(trim($_POST['tbc']));
    192191 
    193192 //make sure the mail is valid mail format
     
    195194 if ((!is_email($new_mail))||(strlen($new_mail)  > 224)) redirect("edit.php?error=2");
    196195
    197  $mysql->query("UPDATE account SET email='$new_mail', $new_pass tbc='$new_tbc' WHERE username = '$user_name'");
    198 
    199  if ($mysql->affected_rows()) {
    200         $mysql->close();
     196 $sql->query("UPDATE account SET email='$new_mail', $new_pass tbc='$new_tbc' WHERE username = '$user_name'");
     197
     198 if ($sql->affected_rows()) {
     199        $sql->close();
    201200        redirect("edit.php?error=3");
    202201    } else {
    203                 $mysql->close();
     202                $sql->close();
    204203                redirect("edit.php?error=4");
    205204        }
  • minimanager/error.php

    r5 r19  
    1515$output .= "<center><br /><table width=\"300\" class=\"flat\">
    1616          <tr>
    17             <td align=\"center\"><h1><font class=\"error\">ERR!</font></h1>
     17            <td align=\"center\"><h1><font class=\"error\"><img src=\"img/warn_red.gif\" width=\"48\" height=\"48\" alt=\"\" /><br />ERR!</font></h1>
    1818            <br />$err<br /><br />
    1919            </td>
  • minimanager/game_object.php

    r5 r19  
    6363 global $lang_global, $lang_game_object, $output, $mangos_db, $realm_id, $go_type;
    6464
    65  $mysql = new MySQL;
    66  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    67 
    68  $result = $mysql->query("SELECT count(*) FROM gameobject_template");
    69  $tot_go = $mysql->result($result, 0);
    70  $mysql->close();
     65 $sql = new SQL;
     66 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     67
     68 $result = $sql->query("SELECT count(*) FROM gameobject_template");
     69 $tot_go = $sql->result($result, 0);
     70 $sql->close();
    7171
    7272 $output .= "<center>
     
    133133        }
    134134
    135 $mysql = new MySQL;
    136 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    137 
    138 if ($_POST['entry'] != '') $entry = $mysql->quote_smart($_POST['entry']);
    139 if ($_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
    140 if ($_POST['type'] != -1) $type = $mysql->quote_smart($_POST['type']);
    141 if ($_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
    142 if ($_POST['displayId'] != '') $displayId = $mysql->quote_smart($_POST['displayId']);
    143 if ($_POST['faction'] != '') $faction = $mysql->quote_smart($_POST['faction']);
    144 if ($_POST['flags'] != '') $flags = $mysql->quote_smart($_POST['flags']);
    145 if ($_POST['custom_search'] != '') $custom_search = $mysql->quote_smart($_POST['custom_search']);
     135$sql = new SQL;
     136$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     137
     138if ($_POST['entry'] != '') $entry = $sql->quote_smart($_POST['entry']);
     139if ($_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
     140if ($_POST['type'] != -1) $type = $sql->quote_smart($_POST['type']);
     141if ($_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
     142if ($_POST['displayId'] != '') $displayId = $sql->quote_smart($_POST['displayId']);
     143if ($_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']);
     144if ($_POST['flags'] != '') $flags = $sql->quote_smart($_POST['flags']);
     145if ($_POST['custom_search'] != '') $custom_search = $sql->quote_smart($_POST['custom_search']);
    146146        else $custom_search = "";
    147147
     
    158158 if($where == "WHERE entry > 0 ") redirect("game_object.php?error=1");
    159159
    160  $result = $mysql->query("SELECT entry, type, displayId, name, faction FROM gameobject_template $where ORDER BY entry LIMIT $sql_search_limit");
    161  $total_found = $mysql->num_rows($result);
     160 $result = $sql->query("SELECT entry, type, displayId, name, faction FROM gameobject_template $where ORDER BY entry LIMIT $sql_search_limit");
     161 $total_found = $sql->num_rows($result);
    162162
    163163  $output .= "<center>
     
    171171  $output .= "<table class=\"lined\">
    172172   <tr>
    173         <td width=\"10%\" class=\"head\">{$lang_game_object['entry']}</td>
    174         <td width=\"40%\" class=\"head\">{$lang_game_object['name']}</td>
    175         <td width=\"20%\" class=\"head\">{$lang_game_object['type']}</td>
    176         <td width=\"15%\" class=\"head\">{$lang_game_object['displayId']}</td>
    177         <td width=\"15%\" class=\"head\">{$lang_game_object['faction']}</td>
     173        <th width=\"10%\">{$lang_game_object['entry']}</th>
     174        <th width=\"40%\">{$lang_game_object['name']}</th>
     175        <th width=\"20%\">{$lang_game_object['type']}</th>
     176        <th width=\"15%\">{$lang_game_object['displayId']}</th>
     177        <th width=\"15%\">{$lang_game_object['faction']}</th>
    178178  </tr>";
    179179
    180180 for ($i=1; $i<=$total_found; $i++){
    181   $go = $mysql->fetch_row($result);
     181  $go = $sql->fetch_row($result);
    182182
    183183  $output .= "<tr>
     
    191191  $output .= "</table></center><br />";
    192192
    193  $mysql->close();
     193 $sql->close();
    194194}
    195195
     
    364364 if (!isset($_GET['entry'])) redirect("game_object.php?error=1");
    365365       
    366  $mysql = new MySQL;
    367  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    368  
    369  $entry = $mysql->quote_smart($_GET['entry']);
    370  $result = $mysql->query("SELECT * FROM gameobject_template WHERE entry = '$entry'");
    371 
    372  if ($go = $mysql->fetch_assoc($result)){
     366 $sql = new SQL;
     367 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     368 
     369 $entry = $sql->quote_smart($_GET['entry']);
     370 $result = $sql->query("SELECT * FROM gameobject_template WHERE entry = '$entry'");
     371
     372 if ($go = $sql->fetch_assoc($result)){
    373373
    374374  $output .= "<script type=\"text/javascript\" src=\"js/tab.js\"></script>
     
    449449</table><br />";
    450450
    451 $result1 = $mysql->query("SELECT COUNT(*) FROM gameobject WHERE id = '{$go['entry']}'");
    452 $output .= "<tr><td colspan=\"6\">{$lang_game_object['go_swapned']} : ".$mysql->result($result1, 0)." {$lang_game_object['times']}.</td></tr>
     451$result1 = $sql->query("SELECT COUNT(*) FROM gameobject WHERE id = '{$go['entry']}'");
     452$output .= "<tr><td colspan=\"6\">{$lang_game_object['go_swapned']} : ".$sql->result($result1, 0)." {$lang_game_object['times']}.</td></tr>
    453453
    454454<br />
     
    534534        $row_flag = 0;
    535535        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    536         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM gameobject_loot_template WHERE entry = {$go['entry']} ORDER BY ChanceOrRef DESC");
    537         while ($item = $mysql->fetch_row($result1)){
     536        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM gameobject_loot_template WHERE entry = {$go['entry']} ORDER BY ChanceOrRef DESC");
     537        while ($item = $sql->fetch_row($result1)){
    538538                $cel_counter++;
    539539                $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_game_object['drop_chance']}: $item[1]%<br />{$lang_game_object['quest_drop_chance']}: $item[2]%<br />{$lang_game_object['drop_chance']}: $item[3]-$item[4]<br />{$lang_game_object['quest_freeforall']}: $item[5]";
     
    577577        <tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_game_object['start_quests']}:</td></tr>";
    578578
    579         $result1 = $mysql->query("SELECT quest FROM gameobject_questrelation WHERE id = {$go['entry']}");
    580         while ($quest = $mysql->fetch_row($result1)){
    581                 $query1 = $mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
    582                 $quest_templ = $mysql->fetch_row($query1);
     579        $result1 = $sql->query("SELECT quest FROM gameobject_questrelation WHERE id = {$go['entry']}");
     580        while ($quest = $sql->fetch_row($result1)){
     581                $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
     582                $quest_templ = $sql->fetch_row($query1);
    583583               
    584584                $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_questrelation[]\" value=\"$quest[0]\" /></td>
     
    592592<tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_game_object['ends_quests']}:</td></tr>";
    593593
    594         $result1 = $mysql->query("SELECT quest FROM gameobject_involvedrelation WHERE id = {$go['entry']}");
    595         while ($quest = $mysql->fetch_row($result1)){
    596                 $query1 = $mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
    597                 $quest_templ = $mysql->fetch_row($query1);
     594        $result1 = $sql->query("SELECT quest FROM gameobject_involvedrelation WHERE id = {$go['entry']}");
     595        while ($quest = $sql->fetch_row($result1)){
     596                $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");
     597                $quest_templ = $sql->fetch_row($query1);
    598598               
    599599                $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_involvedrelation[]\" value=\"$quest[0]\" /></td>
     
    626626        </table></center>";
    627627
    628  $mysql->close();
     628 $sql->close();
    629629 } else {
    630                 $mysql->close();
     630                $sql->close();
    631631                error($lang_game_object['tmpl_not_found']);
    632632                exit();
     
    644644 if (!isset($_POST['entry']) || $_POST['entry'] === '') redirect("game_object.php?error=1");
    645645 
    646  $mysql = new MySQL;
    647  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    648 
    649  $entry = $mysql->quote_smart($_POST['entry']);
    650  if (isset($_POST['type']) && $_POST['type'] != '') $type = $mysql->quote_smart($_POST['type']);
     646 $sql = new SQL;
     647 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     648
     649 $entry = $sql->quote_smart($_POST['entry']);
     650 if (isset($_POST['type']) && $_POST['type'] != '') $type = $sql->quote_smart($_POST['type']);
    651651        else $type = 0;
    652  if (isset($_POST['displayId']) && $_POST['displayId'] != '') $displayId = $mysql->quote_smart($_POST['displayId']);
     652 if (isset($_POST['displayId']) && $_POST['displayId'] != '') $displayId = $sql->quote_smart($_POST['displayId']);
    653653        else $displayId = 0;
    654  if (isset($_POST['name']) && $_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
     654 if (isset($_POST['name']) && $_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
    655655        else $name = "";
    656  if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $mysql->quote_smart($_POST['faction']);
     656 if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']);
    657657        else $faction = 0;
    658  if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $mysql->quote_smart($_POST['flags']);
     658 if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $sql->quote_smart($_POST['flags']);
    659659        else $flags = 0;
    660  if (isset($_POST['size']) && $_POST['size'] != '') $size = $mysql->quote_smart($_POST['size']);
     660 if (isset($_POST['size']) && $_POST['size'] != '') $size = $sql->quote_smart($_POST['size']);
    661661        else $size = 0;
    662  if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
     662 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
    663663        else $ScriptName = "";
    664  if (isset($_POST['sound0']) && $_POST['sound0'] != '') $sound0 = $mysql->quote_smart($_POST['sound0']);
     664 if (isset($_POST['sound0']) && $_POST['sound0'] != '') $sound0 = $sql->quote_smart($_POST['sound0']);
    665665        else $sound0 = 0;
    666  if (isset($_POST['sound1']) && $_POST['sound1'] != '') $sound1 = $mysql->quote_smart($_POST['sound1']);
     666 if (isset($_POST['sound1']) && $_POST['sound1'] != '') $sound1 = $sql->quote_smart($_POST['sound1']);
    667667        else $sound1 = 0;
    668  if (isset($_POST['sound2']) && $_POST['sound2'] != '') $sound2 = $mysql->quote_smart($_POST['sound2']);
     668 if (isset($_POST['sound2']) && $_POST['sound2'] != '') $sound2 = $sql->quote_smart($_POST['sound2']);
    669669        else $sound2 = 0;
    670  if (isset($_POST['sound3']) && $_POST['sound3'] != '') $sound3 = $mysql->quote_smart($_POST['sound3']);
     670 if (isset($_POST['sound3']) && $_POST['sound3'] != '') $sound3 = $sql->quote_smart($_POST['sound3']);
    671671        else $sound3 = 0;
    672  if (isset($_POST['sound4']) && $_POST['sound4'] != '') $sound4 = $mysql->quote_smart($_POST['sound4']);
     672 if (isset($_POST['sound4']) && $_POST['sound4'] != '') $sound4 = $sql->quote_smart($_POST['sound4']);
    673673        else $sound4 = 0;
    674  if (isset($_POST['sound5']) && $_POST['sound5'] != '') $sound5 = $mysql->quote_smart($_POST['sound5']);
     674 if (isset($_POST['sound5']) && $_POST['sound5'] != '') $sound5 = $sql->quote_smart($_POST['sound5']);
    675675        else $sound5 = 0;
    676  if (isset($_POST['sound6']) && $_POST['sound6'] != '') $sound6 = $mysql->quote_smart($_POST['sound6']);
     676 if (isset($_POST['sound6']) && $_POST['sound6'] != '') $sound6 = $sql->quote_smart($_POST['sound6']);
    677677        else $sound6 = 0;
    678  if (isset($_POST['sound7']) && $_POST['sound7'] != '') $sound7 = $mysql->quote_smart($_POST['sound7']);
     678 if (isset($_POST['sound7']) && $_POST['sound7'] != '') $sound7 = $sql->quote_smart($_POST['sound7']);
    679679        else $sound7 = 0;
    680  if (isset($_POST['sound8']) && $_POST['sound8'] != '') $sound8 = $mysql->quote_smart($_POST['sound8']);
     680 if (isset($_POST['sound8']) && $_POST['sound8'] != '') $sound8 = $sql->quote_smart($_POST['sound8']);
    681681        else $sound8 = 0;
    682  if (isset($_POST['sound9']) && $_POST['sound9'] != '') $sound9 = $mysql->quote_smart($_POST['sound9']);
     682 if (isset($_POST['sound9']) && $_POST['sound9'] != '') $sound9 = $sql->quote_smart($_POST['sound9']);
    683683        else $sound9 = 0;
    684  if (isset($_POST['sound10']) && $_POST['sound10'] != '') $sound10 = $mysql->quote_smart($_POST['sound10']);
     684 if (isset($_POST['sound10']) && $_POST['sound10'] != '') $sound10 = $sql->quote_smart($_POST['sound10']);
    685685        else $sound10 = 0;
    686  if (isset($_POST['sound11']) && $_POST['sound11'] != '') $sound11 = $mysql->quote_smart($_POST['sound11']);
     686 if (isset($_POST['sound11']) && $_POST['sound11'] != '') $sound11 = $sql->quote_smart($_POST['sound11']);
    687687        else $sound11 = 0;
    688  if (isset($_POST['sound12']) && $_POST['sound12'] != '') $sound12 = $mysql->quote_smart($_POST['sound12']);
     688 if (isset($_POST['sound12']) && $_POST['sound12'] != '') $sound12 = $sql->quote_smart($_POST['sound12']);
    689689        else $sound12 = 0;
    690  if (isset($_POST['sound13']) && $_POST['sound13'] != '') $sound13 = $mysql->quote_smart($_POST['sound13']);
     690 if (isset($_POST['sound13']) && $_POST['sound13'] != '') $sound13 = $sql->quote_smart($_POST['sound13']);
    691691        else $sound13 = 0;
    692  if (isset($_POST['sound14']) && $_POST['sound14'] != '') $sound14 = $mysql->quote_smart($_POST['sound14']);
     692 if (isset($_POST['sound14']) && $_POST['sound14'] != '') $sound14 = $sql->quote_smart($_POST['sound14']);
    693693        else $sound14 = 0;
    694  if (isset($_POST['sound15']) && $_POST['sound15'] != '') $sound15 = $mysql->quote_smart($_POST['sound15']);
     694 if (isset($_POST['sound15']) && $_POST['sound15'] != '') $sound15 = $sql->quote_smart($_POST['sound15']);
    695695        else $sound15 = 0;
    696  if (isset($_POST['sound16']) && $_POST['sound16'] != '') $sound16 = $mysql->quote_smart($_POST['sound16']);
     696 if (isset($_POST['sound16']) && $_POST['sound16'] != '') $sound16 = $sql->quote_smart($_POST['sound16']);
    697697        else $sound16 = 0;
    698  if (isset($_POST['sound17']) && $_POST['sound17'] != '') $sound17 = $mysql->quote_smart($_POST['sound17']);
     698 if (isset($_POST['sound17']) && $_POST['sound17'] != '') $sound17 = $sql->quote_smart($_POST['sound17']);
    699699        else $sound17 = 0;
    700  if (isset($_POST['sound18']) && $_POST['sound18'] != '') $sound18 = $mysql->quote_smart($_POST['sound18']);
     700 if (isset($_POST['sound18']) && $_POST['sound18'] != '') $sound18 = $sql->quote_smart($_POST['sound18']);
    701701        else $sound18 = 0;
    702  if (isset($_POST['sound19']) && $_POST['sound19'] != '') $sound19 = $mysql->quote_smart($_POST['sound19']);
     702 if (isset($_POST['sound19']) && $_POST['sound19'] != '') $sound19 = $sql->quote_smart($_POST['sound19']);
    703703        else $sound19 = 0;
    704  if (isset($_POST['sound20']) && $_POST['sound20'] != '') $sound20 = $mysql->quote_smart($_POST['sound20']);
     704 if (isset($_POST['sound20']) && $_POST['sound20'] != '') $sound20 = $sql->quote_smart($_POST['sound20']);
    705705        else $sound20 = 0;
    706  if (isset($_POST['sound21']) && $_POST['sound21'] != '') $sound21 = $mysql->quote_smart($_POST['sound21']);
     706 if (isset($_POST['sound21']) && $_POST['sound21'] != '') $sound21 = $sql->quote_smart($_POST['sound21']);
    707707        else $sound21 = 0;
    708  if (isset($_POST['sound22']) && $_POST['sound22'] != '') $sound22 = $mysql->quote_smart($_POST['sound22']);
     708 if (isset($_POST['sound22']) && $_POST['sound22'] != '') $sound22 = $sql->quote_smart($_POST['sound22']);
    709709        else $sound22 = 0;
    710  if (isset($_POST['sound23']) && $_POST['sound23'] != '') $sound23 = $mysql->quote_smart($_POST['sound23']);
     710 if (isset($_POST['sound23']) && $_POST['sound23'] != '') $sound23 = $sql->quote_smart($_POST['sound23']);
    711711        else $sound23 = 0;
    712712
    713         if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $mysql->quote_smart($_POST['ChanceOrRef']);
     713        if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $sql->quote_smart($_POST['ChanceOrRef']);
    714714                else $ChanceOrRef = 0;
    715         if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $mysql->quote_smart($_POST['QuestChanceOrGroup']);
     715        if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $sql->quote_smart($_POST['QuestChanceOrGroup']);
    716716                else $QuestChanceOrGroup = 0;
    717         if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $mysql->quote_smart($_POST['mincount']);
     717        if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $sql->quote_smart($_POST['mincount']);
    718718                else $mincount = 0;
    719         if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $mysql->quote_smart($_POST['maxcount']);
     719        if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $sql->quote_smart($_POST['maxcount']);
    720720                else $maxcount = 0;
    721         if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $mysql->quote_smart($_POST['quest_freeforall']);
     721        if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $sql->quote_smart($_POST['quest_freeforall']);
    722722                else $quest_freeforall = 0;
    723         if (isset($_POST['item']) && $_POST['item'] != '') $item = $mysql->quote_smart($_POST['item']);
     723        if (isset($_POST['item']) && $_POST['item'] != '') $item = $sql->quote_smart($_POST['item']);
    724724                else $item = 0;
    725         if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $mysql->quote_smart($_POST['del_loot_items']);
     725        if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $sql->quote_smart($_POST['del_loot_items']);
    726726                else $del_loot_items = NULL;
    727727       
    728         if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $mysql->quote_smart($_POST['involvedrelation']);
     728        if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $sql->quote_smart($_POST['involvedrelation']);
    729729                else $involvedrelation = 0;
    730         if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $mysql->quote_smart($_POST['del_involvedrelation']);
     730        if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $sql->quote_smart($_POST['del_involvedrelation']);
    731731                else $del_involvedrelation = NULL;
    732         if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $mysql->quote_smart($_POST['questrelation']);
     732        if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $sql->quote_smart($_POST['questrelation']);
    733733                else $questrelation = 0;
    734         if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $mysql->quote_smart($_POST['del_questrelation']);
     734        if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $sql->quote_smart($_POST['del_questrelation']);
    735735                else $del_questrelation = NULL;
    736736       
    737737  if ($_POST['opp_type'] == "add_new"){
    738         $sql = "INSERT INTO gameobject_template ( entry, type, displayId, name, faction, flags, size, sound0, sound1,
     738        $sql_query = "INSERT INTO gameobject_template ( entry, type, displayId, name, faction, flags, size, sound0, sound1,
    739739        sound2, sound3, sound4, sound5, sound6, sound7, sound8, sound9, sound10, sound11, sound12, sound13,
    740740        sound14, sound15, sound16, sound17, sound18, sound19, sound20, sound21, sound22, sound23, ScriptName )
     
    746746 } elseif ($_POST['opp_type'] == "edit"){
    747747
    748         $sql = "UPDATE gameobject_template SET ";
    749 
    750         $result = $mysql->query("SELECT * FROM gameobject_template WHERE entry = '$entry'");
    751         if ($go_templ = $mysql->fetch_assoc($result)){
    752                 if ($go_templ['type'] != $type) $sql .= "type='$type',";
    753                 if ($go_templ['displayId'] != $displayId) $sql .= "displayId='$displayId',";
    754                 if ($go_templ['name'] != $name) $sql .= "name='$name',";
    755                 if ($go_templ['faction'] != $faction) $sql .= "faction='$faction',";
    756                 if ($go_templ['flags'] != $flags) $sql .= "flags='$flags',";
    757                 if ($go_templ['size'] != $size) $sql .= "size='$size',";
    758                 if ($go_templ['sound0'] != $sound0) $sql .= "sound0='$sound0',";
    759                 if ($go_templ['sound1'] != $sound1) $sql .= "sound1='$sound1',";
    760                 if ($go_templ['sound2'] != $sound2) $sql .= "sound2='$sound2',";
    761                 if ($go_templ['sound3'] != $sound3) $sql .= "sound3='$sound3',";
    762                 if ($go_templ['sound4'] != $sound4) $sql .= "sound4='$sound4',";
    763                 if ($go_templ['sound5'] != $sound5) $sql .= "sound5='$sound5',";
    764                 if ($go_templ['sound6'] != $sound6) $sql .= "sound6='$sound6',";
    765                 if ($go_templ['sound7'] != $sound7) $sql .= "sound7='$sound7',";
    766                 if ($go_templ['sound8'] != $sound8) $sql .= "sound8='$sound8',";
    767                 if ($go_templ['sound9'] != $sound9) $sql .= "sound9='$sound9',";
    768                 if ($go_templ['sound10'] != $sound10) $sql .= "sound10='$sound10',";
    769                 if ($go_templ['sound11'] != $sound11) $sql .= "sound11='$sound11',";
    770                 if ($go_templ['sound12'] != $sound12) $sql .= "sound12='$sound12',";
    771                 if ($go_templ['sound13'] != $sound13) $sql .= "sound13='$sound13',";
    772                 if ($go_templ['sound14'] != $sound14) $sql .= "sound14='$sound14',";
    773                 if ($go_templ['sound15'] != $sound15) $sql .= "sound15='$sound15',";
    774                 if ($go_templ['sound16'] != $sound16) $sql .= "sound16='$sound16',";
    775                 if ($go_templ['sound17'] != $sound17) $sql .= "sound17='$sound17',";
    776                 if ($go_templ['sound18'] != $sound18) $sql .= "sound18='$sound18',";
    777                 if ($go_templ['sound19'] != $sound19) $sql .= "sound19='$sound19',";
    778                 if ($go_templ['sound20'] != $sound20) $sql .= "sound20='$sound20',";
    779                 if ($go_templ['sound21'] != $sound21) $sql .= "sound21='$sound21',";
    780                 if ($go_templ['sound22'] != $sound22) $sql .= "sound22='$sound22',";
    781                 if ($go_templ['sound23'] != $sound23) $sql .= "sound23='$sound23',";
    782                 if ($go_templ['ScriptName'] != $ScriptName) $sql .= "ScriptName='$ScriptName',";
    783 
    784           $mysql->free_result($result);
     748        $sql_query = "UPDATE gameobject_template SET ";
     749
     750        $result = $sql->query("SELECT * FROM gameobject_template WHERE entry = '$entry'");
     751        if ($go_templ = $sql->fetch_assoc($result)){
     752                if ($go_templ['type'] != $type) $sql_query .= "type='$type',";
     753                if ($go_templ['displayId'] != $displayId) $sql_query .= "displayId='$displayId',";
     754                if ($go_templ['name'] != $name) $sql_query .= "name='$name',";
     755                if ($go_templ['faction'] != $faction) $sql_query .= "faction='$faction',";
     756                if ($go_templ['flags'] != $flags) $sql_query .= "flags='$flags',";
     757                if ($go_templ['size'] != $size) $sql_query .= "size='$size',";
     758                if ($go_templ['sound0'] != $sound0) $sql_query .= "sound0='$sound0',";
     759                if ($go_templ['sound1'] != $sound1) $sql_query .= "sound1='$sound1',";
     760                if ($go_templ['sound2'] != $sound2) $sql_query .= "sound2='$sound2',";
     761                if ($go_templ['sound3'] != $sound3) $sql_query .= "sound3='$sound3',";
     762                if ($go_templ['sound4'] != $sound4) $sql_query .= "sound4='$sound4',";
     763                if ($go_templ['sound5'] != $sound5) $sql_query .= "sound5='$sound5',";
     764                if ($go_templ['sound6'] != $sound6) $sql_query .= "sound6='$sound6',";
     765                if ($go_templ['sound7'] != $sound7) $sql_query .= "sound7='$sound7',";
     766                if ($go_templ['sound8'] != $sound8) $sql_query .= "sound8='$sound8',";
     767                if ($go_templ['sound9'] != $sound9) $sql_query .= "sound9='$sound9',";
     768                if ($go_templ['sound10'] != $sound10) $sql_query .= "sound10='$sound10',";
     769                if ($go_templ['sound11'] != $sound11) $sql_query .= "sound11='$sound11',";
     770                if ($go_templ['sound12'] != $sound12) $sql_query .= "sound12='$sound12',";
     771                if ($go_templ['sound13'] != $sound13) $sql_query .= "sound13='$sound13',";
     772                if ($go_templ['sound14'] != $sound14) $sql_query .= "sound14='$sound14',";
     773                if ($go_templ['sound15'] != $sound15) $sql_query .= "sound15='$sound15',";
     774                if ($go_templ['sound16'] != $sound16) $sql_query .= "sound16='$sound16',";
     775                if ($go_templ['sound17'] != $sound17) $sql_query .= "sound17='$sound17',";
     776                if ($go_templ['sound18'] != $sound18) $sql_query .= "sound18='$sound18',";
     777                if ($go_templ['sound19'] != $sound19) $sql_query .= "sound19='$sound19',";
     778                if ($go_templ['sound20'] != $sound20) $sql_query .= "sound20='$sound20',";
     779                if ($go_templ['sound21'] != $sound21) $sql_query .= "sound21='$sound21',";
     780                if ($go_templ['sound22'] != $sound22) $sql_query .= "sound22='$sound22',";
     781                if ($go_templ['sound23'] != $sound23) $sql_query .= "sound23='$sound23',";
     782                if ($go_templ['ScriptName'] != $ScriptName) $sql_query .= "ScriptName='$ScriptName',";
     783
     784          $sql->free_result($result);
    785785          unset($go_templ);
    786          
    787         if (($sql == "UPDATE gameobject_template SET ")&&(!$item)&&(!$del_loot_items)
     786
     787        if (($sql_query == "UPDATE gameobject_template SET ")&&(!$item)&&(!$del_loot_items)
    788788                &&(!$del_questrelation)&&(!$questrelation)&&(!$del_involvedrelation)&&(!$involvedrelation)){
    789                 $mysql->close();
     789                $sql->close();
    790790                redirect("game_object.php?action=edit&entry=$entry&error=6");
    791791                } else {
    792                                 if ($sql != "UPDATE gameobject_template SET "){
    793                                         $sql[strlen($sql)-1] = " ";
    794                                         $sql .= " WHERE entry = '$entry';\n";
    795                                         } else $sql = "";
     792                                if ($sql_query != "UPDATE gameobject_template SET "){
     793                                        $sql_query[strlen($sql_query)-1] = " ";
     794                                        $sql_query .= " WHERE entry = '$entry';\n";
     795                                        } else $sql_query = "";
    796796                }
    797797
    798798        if ($item){
    799         $sql .= "INSERT INTO gameobject_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     799        $sql_query .= "INSERT INTO gameobject_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    800800                        VALUES ($entry,$item,'$ChanceOrRef', '$QuestChanceOrGroup' ,$mincount ,$maxcount ,$quest_freeforall);\n";
    801801        }
     
    803803        if ($del_loot_items){
    804804        foreach($del_loot_items as $item_id)
    805                 $sql .= "DELETE FROM gameobject_loot_template WHERE entry = $entry AND item = $item_id;\n";
     805                $sql_query .= "DELETE FROM gameobject_loot_template WHERE entry = $entry AND item = $item_id;\n";
    806806        }
    807807
    808808        if ($questrelation){
    809         $sql .= "INSERT INTO gameobject_questrelation (id, quest) VALUES ($entry,$questrelation);\n";
     809        $sql_query .= "INSERT INTO gameobject_questrelation (id, quest) VALUES ($entry,$questrelation);\n";
    810810        }
    811811       
    812812        if ($involvedrelation){
    813         $sql .= "INSERT INTO gameobject_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n";
     813        $sql_query .= "INSERT INTO gameobject_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n";
    814814        }
    815815
    816816        if ($del_questrelation){
    817817        foreach($del_questrelation as $quest_id)
    818                 $sql .= "DELETE FROM gameobject_questrelation WHERE id = $entry AND quest = $quest_id;\n";
     818                $sql_query .= "DELETE FROM gameobject_questrelation WHERE id = $entry AND quest = $quest_id;\n";
    819819        }
    820820
    821821        if ($del_involvedrelation){
    822822        foreach($del_involvedrelation as $quest_id)
    823                 $sql .= "DELETE FROM gameobject_involvedrelation WHERE id = $entry AND quest = $quest_id;\n";
     823                $sql_query .= "DELETE FROM gameobject_involvedrelation WHERE id = $entry AND quest = $quest_id;\n";
    824824        }
    825825       
    826826
    827827 } else {
    828                 $mysql->close();
     828                $sql->close();
    829829                redirect("game_object.php?error=5");
    830830                }
    831831 } else {
    832         $mysql->close();
     832        $sql->close();
    833833        redirect("game_object.php?error=5");
    834834        }
    835835
    836836 if ( isset($_POST['backup_op']) && ($_POST['backup_op'] == 1) ){
    837         $mysql->close();
     837        $sql->close();
    838838        Header("Content-type: application/octet-stream");
    839839        Header("Content-Disposition: attachment; filename=goid_$entry.sql");
    840         echo $sql;
     840        echo $sql_query;
    841841        exit();
    842842        redirect("game_object.php?action=edit&entry=$entry&error=4");
    843843        } else {
    844                 $sql = explode(';',$sql);
    845                 foreach($sql as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $mysql->query($tmp_query);
    846                 $mysql->close();
     844                $sql_query = explode(';',$sql_query);
     845                foreach($sql_query as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $sql->query($tmp_query);
     846                $sql->close();
    847847                }
    848848
     
    884884        else redirect("game_object.php?error=1");
    885885
    886  $mysql = new MySQL;
    887  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    888 
    889  $result = $mysql->query("SELECT guid FROM gameobject WHERE id = '$entry'");
    890  while ($guid = $mysql->fetch_row($result)){
    891         $result = $mysql->query("DELETE FROM gameobject_respawn WHERE guid = '$guid'");
     886 $sql = new SQL;
     887 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     888
     889 $result = $sql->query("SELECT guid FROM gameobject WHERE id = '$entry'");
     890 while ($guid = $sql->fetch_row($result)){
     891        $result = $sql->query("DELETE FROM gameobject_respawn WHERE guid = '$guid'");
    892892        }
    893  $mysql->query("DELETE FROM gameobject_involvedrelation WHERE id = '$entry'");
    894  $mysql->query("DELETE FROM gameobject_questrelation WHERE id = '$entry'");
    895  $mysql->query("DELETE FROM gameobject_loot_template WHERE entry = '$entry'");
    896  $mysql->query("DELETE FROM gameobject_template WHERE entry = '$entry'");
    897  
    898  $mysql->close();
     893 $sql->query("DELETE FROM gameobject_involvedrelation WHERE id = '$entry'");
     894 $sql->query("DELETE FROM gameobject_questrelation WHERE id = '$entry'");
     895 $sql->query("DELETE FROM gameobject_loot_template WHERE entry = '$entry'");
     896 $sql->query("DELETE FROM gameobject_template WHERE entry = '$entry'");
     897 
     898 $sql->close();
    899899 redirect("game_object.php");
    900900 }
     
    910910        else redirect("game_object.php?error=1");
    911911
    912  $mysql = new MySQL;
    913  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    914  $mysql->query("DELETE FROM gameobject WHERE id = '$entry'");
    915  $mysql->close();
     912 $sql = new SQL;
     913 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     914 $sql->query("DELETE FROM gameobject WHERE id = '$entry'");
     915 $sql->close();
    916916 redirect("game_object.php?action=edit&entry=$entry&error=4");
    917917 }
  • minimanager/guild.php

    r5 r19  
    1818 global $lang_guild, $lang_global, $output, $mangos_db, $realm_id, $itemperpage;
    1919
    20  $mysql = new MySQL;
    21  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    22  
    23  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    24  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "guildid";
    25  
    26  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     20 $sql = new SQL;
     21 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     22 
     23 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     24 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "gid";
     25 
     26 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    2727 $order_dir = ($dir) ? "ASC" : "DESC";
    2828 $dir = ($dir) ? 0 : 1;
    2929 
    30 //get total number of items
    31  $query_1 = $mysql->query("SELECT count(*) FROM guild");
    32  $all_record = $mysql->result($query_1,0);
    33 
    34  $query = $mysql->query("SELECT guildid, name, leaderguid, SUBSTRING_INDEX(MOTD,' ',6), createdate
    35                 FROM guild ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    36  $this_page = $mysql->num_rows($query);
     30 $query_1 = $sql->query("SELECT count(*) FROM guild");
     31 $all_record = $sql->result($query_1,0);
     32
     33 $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS gname,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
     34                                                (SELECT name FROM `character` WHERE guid = lguid) AS l_name,(SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars
     35                                                FROM guild ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
     36 $this_page = $sql->num_rows($query);
    3737
    3838//==========================top tage navigaion starts here========================
     
    4646                        <input type=\"text\" size=\"45\" name=\"search_value\" />
    4747                        <select name=\"search_by\">
    48                                 <option value=\"name\">{$lang_guild['by_name']}</option>
     48                                <option value=\"gname\">{$lang_guild['by_name']}</option>
    4949                                <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option>
    5050                                <option value=\"createdate\">{$lang_guild['by_create_date']}</option>
     
    6060 $output .= "<table class=\"lined\">
    6161   <tr>
    62         <td width=\"5%\" class=\"head\"><a href=\"guild.php?order_by=guildid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_guild['id']}</a></td>
    63         <td width=\"25%\" class=\"head\"><a href=\"guild.php?order_by=name&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_name']}</a></td>
    64         <td width=\"15%\" class=\"head\"><a href=\"guild.php?order_by=leaderguid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_leader']}</a></td>
    65         <td width=\"40%\" class=\"head\"><a href=\"guild.php?order_by=MOTD&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_motd']}</a></td>
    66         <td width=\"15%\" class=\"head\"><a href=\"guild.php?order_by=createdate&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_guild['create_date']}</a></td>
     62        <th width=\"5%\"><a href=\"guild.php?order_by=gid&amp;start=$start&amp;dir=$dir\">".($order_by=='gid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['id']}</a></th>
     63        <th width=\"25%\"><a href=\"guild.php?order_by=gname&amp;start=$start&amp;dir=$dir\">".($order_by=='gname' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
     64        <th width=\"5%\"><a href=\"guild.php?order_by=tot_chars&amp;start=$start&amp;dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th>
     65        <th width=\"15%\"><a href=\"guild.php?order_by=leaderguid&amp;start=$start&amp;dir=$dir\">".($order_by=='leaderguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_leader']}</a></th>
     66        <th width=\"35%\">{$lang_guild['guild_motd']}</th>
     67        <th width=\"15%\"><a href=\"guild.php?order_by=createdate&amp;start=$start&amp;dir=$dir\">".($order_by=='createdate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['create_date']}</a></th>
    6768   </tr>";
    6869
    69 $looping = ($this_page < $itemperpage) ? $this_page : $itemperpage;
    70 
    71 for ($i=1; $i<=$looping; $i++)  {
    72    $data = $mysql->fetch_row($query);
    73 
    74                 $result = $mysql->query("SELECT name FROM `character` WHERE guid ='$data[2]'");
    75                 $guild_leader = ($mysql->num_rows($result)) ? $mysql->result($result, 0, 'name') : "";
    76 
    77                 $output .= "<tr>
    78                         <td>$data[0]</td>
    79                         <td><a href=\"guild.php?action=view_guild&amp;error=3&amp;id=$data[0]\">$data[1]</a></td>
    80                         <td><a href=\"char.php?id=$data[2]\">$guild_leader</a></td>
    81                         <td>$data[3] ...</td>
    82                         <td class=\"small\">$data[4]</td>
     70while ($data = $sql->fetch_row($query)) {
     71        $output .= "<tr>
     72                         <td>$data[0]</td>
     73                         <td><a href=\"guild.php?action=view_guild&amp;error=3&amp;id=$data[0]\">$data[1]</a></td>
     74                         <td>$data[6]</td>
     75                         <td><a href=\"char.php?id=$data[2]\">$data[5]</a></td>
     76                         <td>$data[3] ...</td>
     77                         <td class=\"small\">$data[4]</td>
    8378            </tr>";
    8479}
     
    8782   </table></center>";
    8883
    89  $mysql->close();
     84 $sql->close();
    9085}
    9186
     
    9994 if(!isset($_GET['search_value']) || !isset($_GET['search_by'])) redirect("guild.php?error=2");
    10095
    101  $mysql = new MySQL;
    102  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    103  
    104  $search_value = $mysql->quote_smart($_GET['search_value']);
    105  $search_by = $mysql->quote_smart($_GET['search_by']);
    106 
    107  if(isset($_GET['order_by'])) $order_by = $mysql->quote_smart($_GET['order_by']);
     96 $sql = new SQL;
     97 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     98 
     99 $search_value = $sql->quote_smart($_GET['search_value']);
     100 $search_by = $sql->quote_smart($_GET['search_by']);
     101
     102 if(isset($_GET['order_by'])) $order_by = $sql->quote_smart($_GET['order_by']);
    108103        else $order_by = "guildid";
    109104
    110  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     105 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    111106 $order_dir = ($dir) ? "ASC" : "DESC";
    112107 $dir = ($dir) ? 0 : 1;
    113  
    114 if ($search_by == "leaderguid") {
    115         $temp = $mysql->query("SELECT guid FROM `character` WHERE name ='$search_value'");
    116         $search_value = $mysql->result($temp, 0, 'guid');
    117 }
    118 
    119  $query = $mysql->query("SELECT guildid, name, leaderguid, SUBSTRING_INDEX(MOTD,' ',6), createdate
    120                 FROM guild WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit");
    121  $total_found = $mysql->num_rows($query);
     108
     109if ($search_by == "leaderguid"){
     110        $temp = $sql->query("SELECT guid FROM `character` WHERE name ='$search_value'");
     111        $search_value = $sql->result($temp, 0, 'guid');
     112}
     113
     114 $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS gname,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
     115                                                (SELECT name FROM `character` WHERE guid = lguid) AS l_name, (SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars
     116                                                FROM guild WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit");
     117 $total_found = $sql->num_rows($query);
    122118
    123119//==========================top tage navigaion starts here========================
     
    131127                        <input type=\"text\" size=\"30\" name=\"search_value\" />
    132128                        <select name=\"search_by\">
    133                                 <option value=\"name\">{$lang_guild['by_name']}</option>
     129                                <option value=\"gname\">{$lang_guild['by_name']}</option>
    134130                                <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option>
    135131                                <option value=\"createdate\">{$lang_guild['by_create_date']}</option>
     
    143139 $output .= "<table class=\"lined\">
    144140   <tr>
    145         <td width=\"5%\" class=\"head\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=guildid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_guild['id']}</a></td>
    146         <td width=\"25%\" class=\"head\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=name&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_name']}</a></td>
    147         <td width=\"15%\" class=\"head\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=leaderguid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_leader']}</a></td>
    148         <td width=\"40%\" class=\"head\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=MOTD&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_guild['guild_motd']}</a></td>
    149         <td width=\"15%\" class=\"head\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=createdate&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_guild['create_date']}</a></td>
     141        <th width=\"5%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=guildid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='guildid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['id']}</a></th>
     142        <th width=\"25%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=gname&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='gname' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
     143        <th width=\"5%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=tot_chars&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th>
     144        <th width=\"15%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=leaderguid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='leaderguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_leader']}</a></th>
     145        <th width=\"35%\">{$lang_guild['guild_motd']}</th>
     146        <th width=\"15%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=createdate&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='createdate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['create_date']}</a></th>
    150147   </tr>";
    151148
    152 for ($i=1; $i<=$total_found; $i++){
    153         $data =$mysql->fetch_row($query);
    154        
    155         $result = $mysql->query("SELECT name FROM `character` WHERE guid ='$data[2]'");
    156         $guild_leader = ($mysql->num_rows($result)) ? $mysql->result($result, 0, 'name') : "";
    157        
    158         $output .= "<tr>";
    159         $output .= "<td>$data[0]</td>
    160                         <td><a href=\"guild.php?action=view_guild&amp;error=3&amp;id=$data[0]\">$data[1]</a></td>
    161                         <td><a href=\"char.php?id=$data[2]\">$guild_leader</a></td>
    162                         <td>$data[3] ...</td>
    163                         <td class=\"small\">$data[4]</td>
     149 while ($data =$sql->fetch_row($query)){
     150        $output .= "<tr>
     151                         <td>$data[0]</td>
     152                         <td><a href=\"guild.php?action=view_guild&amp;error=3&amp;id=$data[0]\">$data[1]</a></td>
     153                         <td>$data[6]</td>
     154                         <td><a href=\"char.php?id=$data[2]\">$data[5]</a></td>
     155                         <td>$data[3] ...</td>
     156                         <td class=\"small\">$data[4]</td>
    164157            </tr>";
    165158}
     
    170163   </table></center>";
    171164
    172  $mysql->close();
     165 $sql->close();
    173166}
    174167
     
    182175 if(!isset($_GET['id'])) redirect("guild.php?error=1");
    183176
    184  $mysql = new MySQL;
    185  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    186  
    187  $guild_id = $mysql->quote_smart($_GET['id']);
    188  
    189  $query = $mysql->query("SELECT guildid, name, info, MOTD, createdate FROM guild WHERE guildid = '$guild_id'");
    190  $guild_data = $mysql->fetch_row($query);
    191 
    192  $members = $mysql->query("SELECT guid, rank FROM guild_member WHERE guildid = '$guild_id' ORDER BY rank");
    193  $total_members = $mysql->num_rows($members);
     177 $sql = new SQL;
     178 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     179 
     180 $guild_id = $sql->quote_smart($_GET['id']);
     181 
     182 $query = $sql->query("SELECT guildid, name, info, MOTD, createdate FROM guild WHERE guildid = '$guild_id'");
     183 $guild_data = $sql->fetch_row($query);
     184
     185 $members = $sql->query("SELECT guild_member.guid, guild_member.rank AS mrank,
     186                                                `character`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, ' ', 35), ' ', -1) AS level,
     187                                                (SELECT rname FROM guild_rank WHERE guildid ='$guild_id' AND rid = mrank) AS rname
     188                                                FROM guild_member,`character`
     189                                                LEFT JOIN guild_member k1 ON k1.`guid`=`character`.`guid`
     190                                                WHERE guild_member.guildid = '$guild_id' AND guild_member.guid=`character`.guid
     191                                                ORDER BY mrank");
     192 $total_members = $sql->num_rows($members);
    194193
    195194 if (!$guild_data[2]) $guild_data[2] = $lang_global['none'];
    196195
    197  $output .= "<center>
     196 $output .= "<script type=\"text/javascript\">
     197        answerbox.btn_ok='{$lang_global['yes_low']}';
     198        answerbox.btn_cancel='{$lang_global['no']}';
     199 </script>
     200 <center>
    198201 <fieldset style=\"width: 600px;\">
    199202        <legend>{$lang_guild['guild']}</legend>
     
    215218  </tr>
    216219  <tr>
    217     <td width=\"5%\" class=\"head\">{$lang_guild['remove']}</td>
    218         <td width=\"45%\" class=\"head\">{$lang_guild['name']}</td>
    219         <td width=\"5%\" class=\"head\">{$lang_guild['level']}</td>
    220         <td width=\"45%\" class=\"head\">{$lang_guild['rank']}</td>
     220    <th width=\"5%\">{$lang_guild['remove']}</th>
     221        <th width=\"45%\">{$lang_guild['name']}</th>
     222        <th width=\"5%\">{$lang_guild['level']}</th>
     223        <th width=\"45%\">{$lang_guild['rank']}</th>
    221224  </tr>";
    222  
    223  while ($member = $mysql->fetch_row($members)){
    224         $result = $mysql->query("SELECT name,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) FROM `character` WHERE guid ='$member[0]'");
    225         $member_data = $mysql->fetch_row($result);
    226        
    227         if ($member[1]){
    228                 $result = $mysql->query("SELECT rname FROM guild_rank WHERE guildid ='$guild_data[0]' AND rid='$member[1]'");
    229                 $member_rank = $mysql->result($result, 0, 'rname');
    230         } else $member_rank = $lang_guild['guild_leader'];
    231        
     225
     226 while ($member = $sql->fetch_row($members)){
    232227        $output .= " <tr>
    233         <td><a href=\"guild.php?action=rem_char_from_guild&amp;id=$member[0]&amp;guld_id=$guild_id\"><img src=\"img/x.ico\" class=\"no_border\" alt=\"\" /></a></td>
    234         <td><a href=\"char.php?id=$member[0]\">$member_data[0]</a></td>
    235         <td>$member_data[1]</td>
    236         <td>$member_rank ($member[1])</td>
     228        <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$member[2]}</font><br />{$lang_global['are_you_sure']}', 'guild.php?action=rem_char_from_guild&amp;id=$member[0]&amp;guld_id=$guild_id');\" style=\"cursor:pointer;\" /></td>
     229        <td><a href=\"char.php?id=$member[0]\">$member[2]</a></td>
     230        <td>$member[3]</td>
     231        <td>".($member[4]?$member[4]:$lang_guild['guild_leader'])." ($member[1])</td>
    237232        </tr>";
    238233}
    239234
    240235 $output .= "</table><br />";
    241   $mysql->close();
     236  $sql->close();
    242237 
    243238 $output .= "<table class=\"hidden\">
     
    296291                else redirect("guild.php?error=1");
    297292
    298         $mysql = new MySQL;
    299         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    300 
    301         $char_data = $mysql->query("SELECT data FROM `character` WHERE guid = '$guid' LIMIT 1");
    302         $data = $mysql->result($char_data, 0, 'data');
     293        $sql = new SQL;
     294        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     295
     296        $char_data = $sql->query("SELECT data FROM `character` WHERE guid = '$guid' LIMIT 1");
     297        $data = $sql->result($char_data, 0, 'data');
    303298        $data = explode(' ',$data);
    304299        $data[CHAR_DATA_OFFSET_GUILD_ID] = 0;
    305300        $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0;
    306301        $data = implode(' ',$data);
    307         $mysql->query("UPDATE `character` SET data = '$data' WHERE guid = '$guid'");
    308         $mysql->query("DELETE FROM guild_member WHERE guid = '$guid'");
    309 
    310         $mysql->close();
     302        $sql->query("UPDATE `character` SET data = '$data' WHERE guid = '$guid'");
     303        $sql->query("DELETE FROM guild_member WHERE guid = '$guid'");
     304
     305        $sql->close();
    311306        redirect("guild.php?action=view_guild&id=$guld_id");
    312307}
  • minimanager/header.php

    r5 r19  
    1515require_once("scripts/config.php");
    1616if($debug) $tot_queries = 0;
     17require_once("scripts/db_layer.php");
    1718
    1819if (isset($_COOKIE["lang"])){
     
    2223
    2324if (isset($_COOKIE["css_template"])){
    24         $template = $_COOKIE["css_template"];
    25         if (is_dir("templates/$template")) {
    26                         if (is_file("templates/$template/$template"."_1024.css")) $css_template = $template;
    27                         }
     25        if (is_dir("templates/".$_COOKIE["css_template"]))
     26                if (is_file("templates/".$_COOKIE["css_template"]."/".$_COOKIE["css_template"]."_1024.css")) $css_template = $_COOKIE["css_template"];
    2827        }
    2928
    3029require_once("lang/$lang.php");
    3130require_once("scripts/global_lib.php");
    32 require_once("scripts/mysql.php");
     31
    3332//application/xhtml+xml
    3433$output .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
     
    4443 <script type=\"text/javascript\" src=\"js/general.js\"></script>
    4544 <script type=\"text/javascript\" src=\"js/layout.js\"></script>
    46 
    47  <!--[if lte IE 7]>
     45<!--[if lte IE 7]>
    4846 <style>
    4947        #menuwrapper, #menubar ul a {height: 1%;}
    5048        a:active {width: auto;}
    51  </style>
     49        legend{margin:5px 0px 20px 0px;}
     50        span.button{margin:15px 0px 0px 0px;}
     51</style>
    5252 <![endif]-->
    5353
    5454 </head>
    55         <body onload=\"dynamicLayout(); Menu();\">
     55        <body onload=\"dynamicLayout();\">
    5656                <center>
    5757                <table class=\"table_top\">
     
    6161if ( (isset($_SESSION['user_lvl'])) && (isset($_SESSION['uname'])) && (isset($_SESSION['realm_id']))&& (!isset($_GET['err'])) ){
    6262
    63         if(ini_get('max_execution_time') < 1200 ){
    64                 if(!ini_set('max_execution_time',1200)) error("Error - max_execution_time not set.<br /> Please set it manually to 1200 or more, in php.ini for full functionality.");
     63        if(ini_get('max_execution_time') < 1800){
     64                if(!ini_set('max_execution_time',0))
     65                        error("Error - max_execution_time not set.<br /> Please set it manually to 0, in php.ini for full functionality.");
    6566                }
    6667
     
    7273        $user_lvl = $_SESSION['user_lvl'];
    7374        $user_name = $_SESSION['uname'];
    74         $realm_id = $_SESSION['realm_id'];
    7575        $user_id = $_SESSION['user_id'];
     76        $realm_id = (isset($_GET['r_id'])) ? addslashes($_GET['r_id']) : $_SESSION['realm_id'];
    7677       
    7778        //override PHP error reporting
     
    7980                else error_reporting (E_COMPILE_ERROR);
    8081
    81         $mysql = new MySQL;
    82         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    83         $result = $mysql->query("SELECT id,name FROM `realmlist` LIMIT 10");
     82        $sql = new SQL;
     83        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     84        $result = $sql->query("SELECT id,name FROM `realmlist` LIMIT 10");
    8485
    8586        $output .= "<div id=\"menuwrapper\">
     
    8990
    9091        foreach ($menu_array[$user_lvl][1] as $trunk){
    91                 $output .= "<li><a href=\"{$trunk[0]}\">{$lang_header[$trunk[1]]}</a>";
     92                $output .= "<li><a href=\"{$trunk[0]}\">{$lang_header[$trunk[1]]}<!--[if IE 7]><!--></a><!--<![endif]-->
     93<!--[if lte IE 6]><table><tr><td><![endif]-->";
    9294                if(isset($trunk[2][0])) $output .= "<ul>";
    9395                foreach ($trunk[2] as $branch){
     
    9597                }
    9698                if(isset($trunk[2][0])) $output .= "</ul>";
    97                 $output .= "</li>";
     99                $output .= "<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>";
    98100        }
    99101
    100         $output .= "<li><a class=\"trigger\" href=\"edit.php\">{$lang_header['my_acc']}</a>
     102        $output .= "<li><a class=\"trigger\" href=\"edit.php\">{$lang_header['my_acc']}<!--[if IE 7]><!--></a><!--<![endif]-->
     103<!--[if lte IE 6]><table><tr><td><![endif]-->
    101104                        <ul>";
    102                         if ($mysql->num_rows($result) > 1){
    103                                 while ($realm = $mysql->fetch_row($result)){
     105                        if ($sql->num_rows($result) > 1){
     106                                while ($realm = $sql->fetch_row($result)){
    104107                                        $set = ($realm[0] == $realm_id) ? ">" : "";
    105108                                        $output .= "<li><a href=\"realm.php?action=set_def_realm&amp;id=$realm[0]&amp;url={$_SERVER['PHP_SELF']}\">$set $realm[1]</a></li>";
     
    110113                                <li><a href=\"logout.php\">{$lang_header['logout']}</a></li>
    111114                        </ul>
     115                        <!--[if lte IE 6]></td></tr></table></a><![endif]-->
    112116                        </li>
    113117                        </ul>
     
    120124                </table>";
    121125       
    122   $mysql->close();
     126  $sql->close();
    123127 
    124128 } else {
  • minimanager/index.php

    r5 r19  
    1313
    1414require_once("scripts/get_lib.php");
     15require_once("scripts\bbcode_lib.php");
    1516
    16 $mysql = new MySQL;
    17 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     17$sql = new SQL;
     18$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1819
    1920$output .= "<div class=\"top\">";
    2021if (test_port($server[$realm_id]['addr'],$server[$realm_id]['game_port'])) {
    2122       
    22         $query = $mysql->query("SELECT uptime/60 FROM uptime ORDER BY starttime DESC LIMIT 1");
    23         $uptime = $mysql->result($query, 0);
     23        $query = $sql->query("SELECT uptime/60 FROM uptime ORDER BY starttime DESC LIMIT 1");
     24        $uptime = $sql->result($query, 0);
    2425        $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} : (".(int)($uptime/60).":".(($uptime >= 60 )?(int)($uptime-60*(int)($uptime/60)):(int)$uptime)."h)</font></h1>";
    2526        $online = true;
     
    3031$output .= "Mangos: {$server[$realm_id]['rev']} Using DB: {$mangos_db[$realm_id]['db_rev']}</div>";
    3132
    32 $mysql->db($mangos_db[$realm_id]['name']);
     33$sql->db($mangos_db[$realm_id]['name']);
    3334//MOTD part
    34 $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
     35$start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
    3536
    36 $query_1 = $mysql->query("SELECT count(*) FROM bugreport");
    37 $all_record = $mysql->result($query_1, 0);
     37$query_1 = $sql->query("SELECT count(*) FROM bugreport");
     38$all_record = $sql->result($query_1, 0);
    3839
     40if ($user_lvl > 0) $output .= "<script type=\"text/javascript\">
     41        answerbox.btn_ok='{$lang_global['yes_low']}';
     42        answerbox.btn_cancel='{$lang_global['no']}';
     43        var del_motd = 'motd.php?action=delete_motd&amp;id=';
     44 </script>";
    3945$output .= "<center>
    4046                        <table class=\"lined\">
    4147                        <tr>
    42                         <td class=\"head\" align=\"right\">";
    43 if ($user_lvl) $output .= "<a href=\"motd.php?action=add_motd\" class=\"head_link\">{$lang_index['add_motd']}</a>";
     48                        <th align=\"right\">";
     49if ($user_lvl) $output .= "<a href=\"motd.php?action=add_motd\">{$lang_index['add_motd']}</a>";
    4450$output .= "</td></tr>";
    4551if($all_record){
    46         $result = $mysql->query("SELECT id, type, content FROM bugreport ORDER BY id DESC LIMIT $start, 3");
    47         while($post = $mysql->fetch_row($result)){
    48                 $output .= "<tr><td align=\"left\" class=\"large\"><blockquote>$post[2]</blockquote></td></tr>
     52        $result = $sql->query("SELECT id, type, content FROM bugreport ORDER BY id DESC LIMIT $start, 3");
     53        while($post = $sql->fetch_row($result)){
     54                $output .= "<tr><td align=\"left\" class=\"large\"><blockquote>".bbcode2html($post[2])."</blockquote></td></tr>
    4955                                        <tr><td align=\"right\">$post[1] ";
    50                 if ($user_lvl > 0) $output .= "<a href=\"motd.php?action=delete_motd&amp;id=$post[0]\">{$lang_index['delete']}</a>";                   
    51                 $output .= "</td></tr>
     56                if ($user_lvl > 0) $output .= "<img src=\"img/cross.png\" width=\"12\" height=\"12\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$post[0]}</font><br />{$lang_global['are_you_sure']}', del_motd + $post[0]);\" style=\"cursor:pointer;\" />
     57                        <a href=\"motd.php?action=edit_motd&amp;id=$post[0]\"><img src=\"img/edit.png\" width=\"14\" height=\"14\" /></a>";
     58                $output .= "</th></tr>
    5259                                        <tr><td class=\"hidden\"></td></tr>";
    5360        }
     
    5865//print online chars
    5966if ($online){
    60         $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "name";
     67        $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "name";
    6168
    62         $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     69        $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    6370        $order_dir = ($dir) ? "ASC" : "DESC";
    6471        $dir = ($dir) ? 0 : 1;
    6572       
    66         $result = $mysql->query("SELECT count(*) FROM `character` WHERE `online`= 1");
    67         $total_online = $mysql->result($result, 0);
     73        $result = $sql->query("SELECT count(*) FROM `character` WHERE `online`= 1");
     74        $total_online = $sql->result($result, 0);
    6875
    6976        if( !$user_lvl && !$server[$realm_id]['both_factions']){
    70                 $result = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
    71                 if ($mysql->num_rows($result)){
    72                         $order_side = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     77                $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     78                if ($sql->num_rows($result)){
     79                        $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
    7380                        " AND race IN (2,5,6,8,10) " : " AND race IN (1,3,4,7,11) ";
    7481                } else $order_side = "";
     
    7784        require_once("scripts/defines.php");
    7885       
    79         $result = $mysql->query("SELECT guid,name,race,class,position_x,position_y,map,
     86        $result = $sql->query("SELECT guid,name,race,class,zone,map,
    8087                        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,
    81                         CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account 
     88                        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account
    8289                        FROM `character` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir");
    8390
     
    8693        <table class=\"lined\">
    8794        <tr>
    88         <td width=\"22%\" class=\"head\"><a href=\"index.php?order_by=name&amp;dir=$dir\" class=\"head_link\">{$lang_index['name']}</a></td>
    89         <td width=\"10%\" class=\"head\"><a href=\"index.php?order_by=race&amp;dir=$dir\" class=\"head_link\">{$lang_index['race']}</a></td>
    90         <td width=\"10%\" class=\"head\"><a href=\"index.php?order_by=class&amp;dir=$dir\" class=\"head_link\">{$lang_index['class']}</a></td>
    91         <td width=\"5%\" class=\"head\"><a href=\"index.php?order_by=level&amp;dir=$dir\" class=\"head_link\">{$lang_index['level']}</a></td>
    92         <td width=\"20%\" class=\"head\"><a href=\"index.php?order_by=map&amp;dir=$dir\" class=\"head_link\">{$lang_index['map']}</a></td>
    93         <td width=\"25%\" class=\"head\">{$lang_index['zone']}</td>
    94     <td width=\"8%\" class=\"head\"><a href=\"index.php?order_by=highest_rank&amp;dir=$dir\" class=\"head_link\">{$lang_index['honor_kills']}</a></td>
     95        <th width=\"26%\"><a href=\"index.php?order_by=name&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['name']}</a></th>
     96        <th width=\"7%\"><a href=\"index.php?order_by=race&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['race']}</a></th>
     97        <th width=\"7%\"><a href=\"index.php?order_by=class&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['class']}</a></th>
     98        <th width=\"7%\"><a href=\"index.php?order_by=level&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['level']}</a></th>
     99        <th width=\"20%\"><a href=\"index.php?order_by=map&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['map']}</a></th>
     100        <th width=\"25%\">{$lang_index['zone']}</td>
     101    <th width=\"10%\"><a href=\"index.php?order_by=highest_rank&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['honor_kills']}</a></th>
    95102        </tr>";
    96103
    97104        require_once("scripts/id_tab.php");
    98105
    99         while($char = $mysql->fetch_row($result)){
     106        while($char = $sql->fetch_row($result)){
    100107                $output .= "<tr>
    101108                 <td><a href=\"char.php?id=$char[0]\">$char[1]</a></td>
    102          <td>".get_player_race($char[2])."</td>
    103                  <td>".get_player_class($char[3])."</td>
    104                  <td>$char[8]</td>
    105                  <td>".get_map_name($char[6])."</td>
    106                  <td>".get_zone_name($char[6], $char[4], $char[5])."</td>
     109         <td><img src='img/c_icons/{$char[2]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[2])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     110                 <td><img src='img/c_icons/{$char[3]}.gif' onmousemove='toolTip(\"".get_player_class($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
    107111                 <td>$char[7]</td>
     112                 <td>".get_map_name($char[5])."</td>
     113                 <td>".get_zone_name($char[4])."</td>
     114                 <td>$char[6]</td>
    108115         </tr>";
    109116        }
    110117   $output .= "</table><br /></center>";
    111118}
    112 $mysql->close();
     119$sql->close();
    113120
    114121require_once("footer.php");
  • minimanager/item.php

    r5 r19  
    2222 global $lang_global, $lang_item, $lang_item_edit, $lang_id_tab, $output, $mangos_db, $realm_id, $itemset_id;
    2323
    24  $mysql = new MySQL;
    25  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    26 
    27  $result = $mysql->query("SELECT count(*) FROM item_template");
    28  $tot_items = $mysql->result($result, 0);
    29  $mysql->close();
     24 $sql = new SQL;
     25 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     26
     27 $result = $sql->query("SELECT count(*) FROM item_template");
     28 $tot_items = $sql->result($result, 0);
     29 $sql->close();
    3030 
    3131 $output .= "<center>
     
    170170        &&(!isset($_POST['ItemLevel'])||$_POST['ItemLevel'] === '')&&(!isset($_POST['itemset'])||$_POST['itemset'] === '')&&(!isset($_POST['Flags'])||$_POST['Flags'] === '')
    171171        &&(!isset($_POST['custom_search'])||$_POST['custom_search'] === ''))
    172         {
    173172        redirect("item.php?error=1");
    174         }
    175 
    176 $mysql = new MySQL;
    177 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    178 
    179 $class = $mysql->quote_smart($_POST['class']);
    180 $Quality = $mysql->quote_smart($_POST['Quality']);
    181 $InventoryType = $mysql->quote_smart($_POST['InventoryType']);
    182 $bonding = $mysql->quote_smart($_POST['bonding']);
    183 
    184 if ($_POST['entry'] != '') $entry = $mysql->quote_smart($_POST['entry']);
    185 if ($_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
    186 if ($_POST['displayid'] != '') $displayid = $mysql->quote_smart($_POST['displayid']);
    187 if ($_POST['RequiredLevel'] != '') $RequiredLevel = $mysql->quote_smart($_POST['RequiredLevel']);
    188 if ($_POST['spellid_1'] != '') $spellid_1 = $mysql->quote_smart($_POST['spellid_1']);
    189 if ($_POST['spellid_2'] != '') $spellid_2 = $mysql->quote_smart($_POST['spellid_2']);
    190 if ($_POST['spellid_3'] != '') $spellid_3 = $mysql->quote_smart($_POST['spellid_3']);
    191 if ($_POST['spellid_4'] != '') $spellid_4 = $mysql->quote_smart($_POST['spellid_4']);
    192 if ($_POST['ItemLevel'] != '') $ItemLevel = $mysql->quote_smart($_POST['ItemLevel']);
    193 if ($_POST['itemset'] != '') $itemset = $mysql->quote_smart($_POST['itemset']);
    194 if ($_POST['Flags'] != '') $Flags = $mysql->quote_smart($_POST['Flags']);
    195 if ($_POST['custom_search'] != '') $custom_search = $mysql->quote_smart($_POST['custom_search']);
     173
     174$sql = new SQL;
     175$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     176
     177$class = $sql->quote_smart($_POST['class']);
     178$Quality = $sql->quote_smart($_POST['Quality']);
     179$InventoryType = $sql->quote_smart($_POST['InventoryType']);
     180$bonding = $sql->quote_smart($_POST['bonding']);
     181
     182if ($_POST['entry'] != '') $entry = $sql->quote_smart($_POST['entry']);
     183if ($_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
     184if ($_POST['displayid'] != '') $displayid = $sql->quote_smart($_POST['displayid']);
     185if ($_POST['RequiredLevel'] != '') $RequiredLevel = $sql->quote_smart($_POST['RequiredLevel']);
     186if ($_POST['spellid_1'] != '') $spellid_1 = $sql->quote_smart($_POST['spellid_1']);
     187if ($_POST['spellid_2'] != '') $spellid_2 = $sql->quote_smart($_POST['spellid_2']);
     188if ($_POST['spellid_3'] != '') $spellid_3 = $sql->quote_smart($_POST['spellid_3']);
     189if ($_POST['spellid_4'] != '') $spellid_4 = $sql->quote_smart($_POST['spellid_4']);
     190if ($_POST['ItemLevel'] != '') $ItemLevel = $sql->quote_smart($_POST['ItemLevel']);
     191if ($_POST['itemset'] != '') $itemset = $sql->quote_smart($_POST['itemset']);
     192if ($_POST['Flags'] != '') $Flags = $sql->quote_smart($_POST['Flags']);
     193if ($_POST['custom_search'] != '') $custom_search = $sql->quote_smart($_POST['custom_search']);
    196194        else $custom_search = "";
    197195
     
    218216 if($where == "WHERE entry > 0 ") redirect("item.php?error=1");
    219217
    220  $result = $mysql->query("SELECT entry,displayid,name,RequiredLevel,ItemLevel FROM item_template $where ORDER BY entry LIMIT $sql_search_limit");
    221  $total_items_found = $mysql->num_rows($result);
     218 $result = $sql->query("SELECT entry,displayid,name,RequiredLevel,ItemLevel FROM item_template $where ORDER BY entry LIMIT $sql_search_limit");
     219 $total_items_found = $sql->num_rows($result);
    222220
    223221  $output .= "<center>
     
    231229  $output .= "<table class=\"lined\">
    232230   <tr>
    233         <td width=\"15%\" class=\"head\">{$lang_item_edit['entry']}</td>
    234         <td width=\"10%\" class=\"head\">{$lang_item_edit['display_id']}</td>
    235         <td width=\"55%\" class=\"head\">{$lang_item_edit['item_name']}</td>
    236         <td width=\"10%\" class=\"head\">{$lang_item_edit['req_level']}</td>
    237         <td width=\"10%\" class=\"head\">{$lang_item_edit['item_level']}</td>
     231        <th width=\"15%\">{$lang_item_edit['entry']}</th>
     232        <th width=\"10%\">{$lang_item_edit['display_id']}</th>
     233        <th width=\"55%\">{$lang_item_edit['item_name']}</th>
     234        <th width=\"10%\">{$lang_item_edit['req_level']}</th>
     235        <th width=\"10%\">{$lang_item_edit['item_level']}</th>
    238236  </tr>";
    239237
     
    241239
    242240 for ($i=1; $i<=$total_items_found; $i++){
    243   $item = $mysql->fetch_row($result);
     241  $item = $sql->fetch_row($result);
    244242 
    245243  $tooltip = get_item_tooltip($item[0]);
     
    257255  $output .= "</table></center><br />";
    258256
    259  $mysql->close();
     257 $sql->close();
    260258}
    261259
     
    14481446 if (!isset($_GET['entry'])) redirect("item.php?error=1");
    14491447
    1450  $mysql = new MySQL;
    1451  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1452  
    1453  $entry = $mysql->quote_smart($_GET['entry']);
    1454  $result = $mysql->query("SELECT * FROM item_template WHERE entry = '$entry'");
     1448 $sql = new SQL;
     1449 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     1450 
     1451 $entry = $sql->quote_smart($_GET['entry']);
     1452 $result = $sql->query("SELECT * FROM item_template WHERE entry = '$entry'");
    14551453
    14561454 if ($result){
    1457         $item = $mysql->fetch_assoc($result);
     1455        $item = $sql->fetch_assoc($result);
    14581456        require_once("scripts/get_lib.php");
    14591457        $tooltip = get_item_tooltip($entry);
     
    28562854        <tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['dropped_by']}: {$lang_item_edit['top_x']}</td></tr>
    28572855        <tr>
    2858                 <td width=\"35%\" class=\"head\">{$lang_item_edit['mob_name']}</td>
    2859                 <td width=\"15%\" class=\"head\">{$lang_item_edit['mob_level']}</td>
    2860                 <td width=\"25%\" class=\"head\">{$lang_item_edit['mob_drop_chance']}</td>
    2861                 <td width=\"25%\" class=\"head\">{$lang_item_edit['mob_quest_drop_chance']}</td>
     2856                <th width=\"35%\">{$lang_item_edit['mob_name']}</th>
     2857                <th width=\"15%\">{$lang_item_edit['mob_level']}</th>
     2858                <th width=\"25%\">{$lang_item_edit['mob_drop_chance']}</th>
     2859                <th width=\"25%\">{$lang_item_edit['mob_quest_drop_chance']}</th>
    28622860        </tr>";
    28632861
    2864  $result2 = $mysql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5");
    2865  while ($info = $mysql->fetch_row($result2)){
    2866         $result3 = $mysql->query("SELECT entry,name,maxlevel FROM creature_template WHERE lootid = {$info[0]} LIMIT 1");
    2867         while ($mob = $mysql->fetch_row($result3)){
     2862 $result2 = $sql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5");
     2863 while ($info = $sql->fetch_row($result2)){
     2864        $result3 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHERE lootid = {$info[0]} LIMIT 1");
     2865        while ($mob = $sql->fetch_row($result3)){
    28682866                $output .= "<tr><td><a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=$mob[0]&amp;error=4\" target=\"_blank\">$mob[1]</a></td>
    28692867                                        <td>$mob[2]</td>
     
    28732871        }
    28742872
    2875 $result2 = $mysql->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");
    2876  if ($mysql->num_rows($result2)){
     2873$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");
     2874 if ($sql->num_rows($result2)){
    28772875        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['soled_by']}: {$lang_item_edit['limit_x']}</td></tr>";
    2878         while ($mob = $mysql->fetch_row($result2)){
     2876        while ($mob = $sql->fetch_row($result2)){
    28792877                $output .= "<tr><td width=\"20%\">$mob[2]</td>
    28802878                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=$mob[0]&amp;error=4\" target=\"_blank\">$mob[1]</a></td></tr>";
     
    28822880}
    28832881
    2884 $result2 = $mysql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
     2882$result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
    28852883                                                        ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR
    28862884                                                        RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC");
    2887  if ($mysql->num_rows($result2)){
     2885 if ($sql->num_rows($result2)){
    28882886        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['involved_in_quests']}:</td></tr>";
    2889         while ($quest = $mysql->fetch_row($result2)){
     2887        while ($quest = $sql->fetch_row($result2)){
    28902888                $output .= "<tr><td width=\"20%\">id: $quest[0]</td>
    28912889                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"$quest_datasite$quest[0]\" target=\"_blank\">($quest[2]) $quest[1]</a></td></tr>";
     
    28942892 }
    28952893
    2896 $result2 = $mysql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR
     2894$result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR
    28972895                                                        RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} )
    28982896                                                        ORDER BY QuestLevel DESC");                                     
    2899  if ($mysql->num_rows($result2)){
     2897 if ($sql->num_rows($result2)){
    29002898        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['reward_from_quest']}:</td></tr>";
    2901         while ($quest = $mysql->fetch_row($result2)){
     2899        while ($quest = $sql->fetch_row($result2)){
    29022900                $output .= "<tr><td width=\"20%\">id: $quest[0]</td>
    29032901                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"$quest_datasite$quest[0]\" target=\"_blank\">($quest[2]) $quest[1]</a></td></tr>";
     
    29162914        $row_flag = 0;
    29172915        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    2918         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrRef DESC");
    2919         while ($item = $mysql->fetch_row($result1)){
     2916        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrRef DESC");
     2917        while ($item = $sql->fetch_row($result1)){
    29202918                $cel_counter++;
    29212919                $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_item_edit['drop_chance']}: $item[1]%<br />{$lang_item_edit['quest_drop_chance']}: $item[2]%<br />{$lang_item_edit['drop_chance']}: $item[3]-$item[4]<br />{$lang_item_edit['quest_freeforall']}: $item[5]";
     
    29732971 
    29742972
    2975  $mysql->close();
     2973 $sql->close();
    29762974 } else {
    2977                 $mysql->close();
     2975                $sql->close();
    29782976                error($lang_item_edit['item_not_found']);
    29792977                exit();
     
    29912989 if (!isset($_POST['entry']) || $_POST['entry'] === '') redirect("item.php?error=1");
    29922990 
    2993  $mysql = new MySQL;
    2994  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    2995 
    2996  $entry = $mysql->quote_smart($_POST['entry']);
    2997  if (isset($_POST['class']) && $_POST['class'] != '') $class = $mysql->quote_smart($_POST['class']);
     2991 $sql = new SQL;
     2992 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     2993
     2994 $entry = $sql->quote_smart($_POST['entry']);
     2995 if (isset($_POST['class']) && $_POST['class'] != '') $class = $sql->quote_smart($_POST['class']);
    29982996        else $class = 0;
    2999  if (isset($_POST['subclass']) && $_POST['subclass'] != '') $subclass = $mysql->quote_smart($_POST['subclass']);
     2997 if (isset($_POST['subclass']) && $_POST['subclass'] != '') $subclass = $sql->quote_smart($_POST['subclass']);
    30002998        else $subclass = 0;
    3001  if (isset($_POST['name']) && $_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
     2999 if (isset($_POST['name']) && $_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
    30023000        else $name = 0;
    3003  if (isset($_POST['displayid']) && $_POST['displayid'] != '') $displayid = $mysql->quote_smart($_POST['displayid']);
     3001 if (isset($_POST['displayid']) && $_POST['displayid'] != '') $displayid = $sql->quote_smart($_POST['displayid']);
    30043002        else $displayid = 0;
    3005  if (isset($_POST['Quality']) && $_POST['Quality'] != '') $Quality = $mysql->quote_smart($_POST['Quality']);
     3003 if (isset($_POST['Quality']) && $_POST['Quality'] != '') $Quality = $sql->quote_smart($_POST['Quality']);
    30063004        else $Quality = 0;
    3007  if (isset($_POST['Flags']) && $_POST['Flags'] != '') $Flags = $mysql->quote_smart($_POST['Flags']);
     3005 if (isset($_POST['Flags']) && $_POST['Flags'] != '') $Flags = $sql->quote_smart($_POST['Flags']);
    30083006        else $Flags = 0;
    3009  if (isset($_POST['BuyCount']) && $_POST['BuyCount'] != '') $BuyCount = $mysql->quote_smart($_POST['BuyCount']);
     3007 if (isset($_POST['BuyCount']) && $_POST['BuyCount'] != '') $BuyCount = $sql->quote_smart($_POST['BuyCount']);
    30103008        else $BuyCount = 0;
    3011  if (isset($_POST['BuyPrice']) && $_POST['BuyPrice'] != '') $BuyPrice = $mysql->quote_smart($_POST['BuyPrice']);
     3009 if (isset($_POST['BuyPrice']) && $_POST['BuyPrice'] != '') $BuyPrice = $sql->quote_smart($_POST['BuyPrice']);
    30123010        else $BuyPrice = 0;
    3013  if (isset($_POST['SellPrice']) && $_POST['SellPrice'] != '') $SellPrice = $mysql->quote_smart($_POST['SellPrice']);
     3011 if (isset($_POST['SellPrice']) && $_POST['SellPrice'] != '') $SellPrice = $sql->quote_smart($_POST['SellPrice']);
    30143012        else $SellPrice = 0;
    3015  if (isset($_POST['InventoryType']) && $_POST['InventoryType'] != '') $InventoryType = $mysql->quote_smart($_POST['InventoryType']);
     3013 if (isset($_POST['InventoryType']) && $_POST['InventoryType'] != '') $InventoryType = $sql->quote_smart($_POST['InventoryType']);
    30163014        else $AllowableClass = 0;
    3017  if (isset($_POST['AllowableClass'])) $AllowableClass = $mysql->quote_smart($_POST['AllowableClass']);
     3015 if (isset($_POST['AllowableClass'])) $AllowableClass = $sql->quote_smart($_POST['AllowableClass']);
    30183016        else $AllowableClass = -1;
    3019  if (isset($_POST['AllowableRace'])) $AllowableRace = $mysql->quote_smart($_POST['AllowableRace']);
     3017 if (isset($_POST['AllowableRace'])) $AllowableRace = $sql->quote_smart($_POST['AllowableRace']);
    30203018        else $AllowableRace = -1;
    3021  if (isset($_POST['ItemLevel']) && $_POST['ItemLevel'] != '') $ItemLevel = $mysql->quote_smart($_POST['ItemLevel']);
     3019 if (isset($_POST['ItemLevel']) && $_POST['ItemLevel'] != '') $ItemLevel = $sql->quote_smart($_POST['ItemLevel']);
    30223020        else $ItemLevel = 1;
    3023  if (isset($_POST['RequiredLevel']) && $_POST['RequiredLevel'] != '') $RequiredLevel = $mysql->quote_smart($_POST['RequiredLevel']);
     3021 if (isset($_POST['RequiredLevel']) && $_POST['RequiredLevel'] != '') $RequiredLevel = $sql->quote_smart($_POST['RequiredLevel']);
    30243022        else $RequiredLevel = 0;
    3025  if (isset($_POST['RequiredSkill']) && $_POST['RequiredSkill'] != '') $RequiredSkill = $mysql->quote_smart($_POST['RequiredSkill']);
     3023 if (isset($_POST['RequiredSkill']) && $_POST['RequiredSkill'] != '') $RequiredSkill = $sql->quote_smart($_POST['RequiredSkill']);
    30263024        else $RequiredSkill = 0;
    3027  if (isset($_POST['RequiredSkillRank']) && $_POST['RequiredSkillRank'] != '') $RequiredSkillRank = $mysql->quote_smart($_POST['RequiredSkillRank']);
     3025 if (isset($_POST['RequiredSkillRank']) && $_POST['RequiredSkillRank'] != '') $RequiredSkillRank = $sql->quote_smart($_POST['RequiredSkillRank']);
    30283026        else $RequiredSkillRank = 0;
    3029  if (isset($_POST['requiredspell']) && $_POST['requiredspell'] != '') $requiredspell = $mysql->quote_smart($_POST['requiredspell']);
     3027 if (isset($_POST['requiredspell']) && $_POST['requiredspell'] != '') $requiredspell = $sql->quote_smart($_POST['requiredspell']);
    30303028        else $requiredspell = 0;
    3031  if (isset($_POST['requiredhonorrank']) && $_POST['requiredhonorrank'] != '') $requiredhonorrank = $mysql->quote_smart($_POST['requiredhonorrank']);
     3029 if (isset($_POST['requiredhonorrank']) && $_POST['requiredhonorrank'] != '') $requiredhonorrank = $sql->quote_smart($_POST['requiredhonorrank']);
    30323030        else $requiredhonorrank = 0;
    3033  if (isset($_POST['RequiredCityRank']) && $_POST['RequiredCityRank'] != '') $RequiredCityRank = $mysql->quote_smart($_POST['RequiredCityRank']);
     3031 if (isset($_POST['RequiredCityRank']) && $_POST['RequiredCityRank'] != '') $RequiredCityRank = $sql->quote_smart($_POST['RequiredCityRank']);
    30343032        else $RequiredCityRank = 0;
    3035  if (isset($_POST['RequiredReputationFaction']) && $_POST['RequiredReputationFaction'] != '') $RequiredReputationFaction = $mysql->quote_smart($_POST['RequiredReputationFaction']);
     3033 if (isset($_POST['RequiredReputationFaction']) && $_POST['RequiredReputationFaction'] != '') $RequiredReputationFaction = $sql->quote_smart($_POST['RequiredReputationFaction']);
    30363034        else $RequiredReputationFaction = 0;
    3037  if (isset($_POST['RequiredReputationRank']) && $_POST['RequiredReputationRank'] != '') $RequiredReputationRank = $mysql->quote_smart($_POST['RequiredReputationRank']);
     3035 if (isset($_POST['RequiredReputationRank']) && $_POST['RequiredReputationRank'] != '') $RequiredReputationRank = $sql->quote_smart($_POST['RequiredReputationRank']);
    30383036        else $RequiredReputationRank = 0;
    3039  if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $mysql->quote_smart($_POST['maxcount']);
     3037 if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $sql->quote_smart($_POST['maxcount']);
    30403038        else $maxcount = 0;
    3041  if (isset($_POST['stackable']) && $_POST['stackable'] != '') $stackable = $mysql->quote_smart($_POST['stackable']);
     3039 if (isset($_POST['stackable']) && $_POST['stackable'] != '') $stackable = $sql->quote_smart($_POST['stackable']);
    30423040        else $description = 0;
    3043  if (isset($_POST['ContainerSlots']) && $_POST['ContainerSlots'] != '') $ContainerSlots = $mysql->quote_smart($_POST['ContainerSlots']);
     3041 if (isset($_POST['ContainerSlots']) && $_POST['ContainerSlots'] != '') $ContainerSlots = $sql->quote_smart($_POST['ContainerSlots']);
    30443042        else $ContainerSlots = 0;
    3045  if (isset($_POST['stat_type1']) && $_POST['stat_type1'] != '') $stat_type1 = $mysql->quote_smart($_POST['stat_type1']);
     3043 if (isset($_POST['stat_type1']) && $_POST['stat_type1'] != '') $stat_type1 = $sql->quote_smart($_POST['stat_type1']);
    30463044        else $stat_type1 = 0;
    3047  if (isset($_POST['stat_value1']) && $_POST['stat_value1'] != '') $stat_value1 = $mysql->quote_smart($_POST['stat_value1']);
     3045 if (isset($_POST['stat_value1']) && $_POST['stat_value1'] != '') $stat_value1 = $sql->quote_smart($_POST['stat_value1']);
    30483046        else $stat_value1 = 0;
    3049  if (isset($_POST['stat_type2']) && $_POST['stat_type2'] != '') $stat_type2 = $mysql->quote_smart($_POST['stat_type2']);
     3047 if (isset($_POST['stat_type2']) && $_POST['stat_type2'] != '') $stat_type2 = $sql->quote_smart($_POST['stat_type2']);
    30503048        else $stat_type2 = 0;
    3051  if (isset($_POST['stat_value2']) && $_POST['stat_value2'] != '') $stat_value2 = $mysql->quote_smart($_POST['stat_value2']);
     3049 if (isset($_POST['stat_value2']) && $_POST['stat_value2'] != '') $stat_value2 = $sql->quote_smart($_POST['stat_value2']);
    30523050        else $stat_value2 = 0;
    3053  if (isset($_POST['stat_type3']) && $_POST['stat_type3'] != '') $stat_type3 = $mysql->quote_smart($_POST['stat_type3']);
     3051 if (isset($_POST['stat_type3']) && $_POST['stat_type3'] != '') $stat_type3 = $sql->quote_smart($_POST['stat_type3']);
    30543052        else $stat_type3 = 0;
    3055  if (isset($_POST['stat_value3']) && $_POST['stat_value3'] != '') $stat_value3 = $mysql->quote_smart($_POST['stat_value3']);
     3053 if (isset($_POST['stat_value3']) && $_POST['stat_value3'] != '') $stat_value3 = $sql->quote_smart($_POST['stat_value3']);
    30563054        else $stat_value3 = 0;
    3057  if (isset($_POST['stat_type4']) && $_POST['stat_type4'] != '') $stat_type4 = $mysql->quote_smart($_POST['stat_type4']);
     3055 if (isset($_POST['stat_type4']) && $_POST['stat_type4'] != '') $stat_type4 = $sql->quote_smart($_POST['stat_type4']);
    30583056        else $stat_type4 = 0;
    3059  if (isset($_POST['stat_value4']) && $_POST['stat_value4'] != '') $stat_value4 = $mysql->quote_smart($_POST['stat_value4']);
     3057 if (isset($_POST['stat_value4']) && $_POST['stat_value4'] != '') $stat_value4 = $sql->quote_smart($_POST['stat_value4']);
    30603058        else $stat_value4 = 0;
    3061  if (isset($_POST['stat_type5']) && $_POST['stat_type5'] != '') $stat_type5 = $mysql->quote_smart($_POST['stat_type5']);
     3059 if (isset($_POST['stat_type5']) && $_POST['stat_type5'] != '') $stat_type5 = $sql->quote_smart($_POST['stat_type5']);
    30623060        else $stat_type5 = 0;
    3063  if (isset($_POST['stat_value5']) && $_POST['stat_value5'] != '') $stat_value5 = $mysql->quote_smart($_POST['stat_value5']);
     3061 if (isset($_POST['stat_value5']) && $_POST['stat_value5'] != '') $stat_value5 = $sql->quote_smart($_POST['stat_value5']);
    30643062        else $stat_value5 = 0;
    3065  if (isset($_POST['stat_type6']) && $_POST['stat_type6'] != '') $stat_type6 = $mysql->quote_smart($_POST['stat_type6']);
     3063 if (isset($_POST['stat_type6']) && $_POST['stat_type6'] != '') $stat_type6 = $sql->quote_smart($_POST['stat_type6']);
    30663064        else $stat_type6 = 0;
    3067  if (isset($_POST['stat_value6']) && $_POST['stat_value6'] != '') $stat_value6 = $mysql->quote_smart($_POST['stat_value6']);
     3065 if (isset($_POST['stat_value6']) && $_POST['stat_value6'] != '') $stat_value6 = $sql->quote_smart($_POST['stat_value6']);
    30683066        else $stat_value6 = 0;
    3069  if (isset($_POST['stat_type7']) && $_POST['stat_type7'] != '') $stat_type7 = $mysql->quote_smart($_POST['stat_type7']);
     3067 if (isset($_POST['stat_type7']) && $_POST['stat_type7'] != '') $stat_type7 = $sql->quote_smart($_POST['stat_type7']);
    30703068        else $stat_type7 = 0;
    3071  if (isset($_POST['stat_value7']) && $_POST['stat_value7'] != '') $stat_value7 = $mysql->quote_smart($_POST['stat_value7']);
     3069 if (isset($_POST['stat_value7']) && $_POST['stat_value7'] != '') $stat_value7 = $sql->quote_smart($_POST['stat_value7']);
    30723070        else $stat_value7 = 0;
    3073  if (isset($_POST['stat_type8']) && $_POST['stat_type8'] != '') $stat_type8 = $mysql->quote_smart($_POST['stat_type8']);
     3071 if (isset($_POST['stat_type8']) && $_POST['stat_type8'] != '') $stat_type8 = $sql->quote_smart($_POST['stat_type8']);
    30743072        else $stat_type8 = 0;
    3075  if (isset($_POST['stat_value8']) && $_POST['stat_value8'] != '') $stat_value8 = $mysql->quote_smart($_POST['stat_value8']);
     3073 if (isset($_POST['stat_value8']) && $_POST['stat_value8'] != '') $stat_value8 = $sql->quote_smart($_POST['stat_value8']);
    30763074        else $stat_value8 = 0;
    3077  if (isset($_POST['stat_type9']) && $_POST['stat_type9'] != '') $stat_type9 = $mysql->quote_smart($_POST['stat_type9']);
     3075 if (isset($_POST['stat_type9']) && $_POST['stat_type9'] != '') $stat_type9 = $sql->quote_smart($_POST['stat_type9']);
    30783076        else $stat_type9 = 0;
    3079  if (isset($_POST['stat_value9']) && $_POST['stat_value9'] != '') $stat_value9 = $mysql->quote_smart($_POST['stat_value9']);
     3077 if (isset($_POST['stat_value9']) && $_POST['stat_value9'] != '') $stat_value9 = $sql->quote_smart($_POST['stat_value9']);
    30803078        else $stat_value9 = 0;
    3081  if (isset($_POST['stat_type10']) && $_POST['stat_type10'] != '') $stat_type10 = $mysql->quote_smart($_POST['stat_type10']);
     3079 if (isset($_POST['stat_type10']) && $_POST['stat_type10'] != '') $stat_type10 = $sql->quote_smart($_POST['stat_type10']);
    30823080        else $stat_type10 = 0;
    3083  if (isset($_POST['stat_value10']) && $_POST['stat_value10'] != '') $stat_value10 = $mysql->quote_smart($_POST['stat_value10']);
     3081 if (isset($_POST['stat_value10']) && $_POST['stat_value10'] != '') $stat_value10 = $sql->quote_smart($_POST['stat_value10']);
    30843082        else $stat_value10 = 0;
    3085  if (isset($_POST['dmg_min1']) && $_POST['dmg_min1'] != '') $dmg_min1 = $mysql->quote_smart($_POST['dmg_min1']);
     3083 if (isset($_POST['dmg_min1']) && $_POST['dmg_min1'] != '') $dmg_min1 = $sql->quote_smart($_POST['dmg_min1']);
    30863084        else $dmg_min1 = 0;
    3087  if (isset($_POST['dmg_max1']) && $_POST['dmg_max1'] != '') $dmg_max1 = $mysql->quote_smart($_POST['dmg_max1']);
     3085 if (isset($_POST['dmg_max1']) && $_POST['dmg_max1'] != '') $dmg_max1 = $sql->quote_smart($_POST['dmg_max1']);
    30883086        else $dmg_max1 = 0;
    3089  if (isset($_POST['dmg_type1']) && $_POST['dmg_type1'] != '') $dmg_type1 = $mysql->quote_smart($_POST['dmg_type1']);
     3087 if (isset($_POST['dmg_type1']) && $_POST['dmg_type1'] != '') $dmg_type1 = $sql->quote_smart($_POST['dmg_type1']);
    30903088        else $dmg_type1 = 0;
    3091  if (isset($_POST['dmg_min2']) && $_POST['dmg_min2'] != '') $dmg_min2 = $mysql->quote_smart($_POST['dmg_min2']);
     3089 if (isset($_POST['dmg_min2']) && $_POST['dmg_min2'] != '') $dmg_min2 = $sql->quote_smart($_POST['dmg_min2']);
    30923090        else $dmg_min2 = 0;
    3093  if (isset($_POST['dmg_max2']) && $_POST['dmg_max2'] != '') $dmg_max2 = $mysql->quote_smart($_POST['dmg_max2']);
     3091 if (isset($_POST['dmg_max2']) && $_POST['dmg_max2'] != '') $dmg_max2 = $sql->quote_smart($_POST['dmg_max2']);
    30943092        else $dmg_max2 = 0;
    3095  if (isset($_POST['dmg_type2']) && $_POST['dmg_type2'] != '') $dmg_type2 = $mysql->quote_smart($_POST['dmg_type2']);
     3093 if (isset($_POST['dmg_type2']) && $_POST['dmg_type2'] != '') $dmg_type2 = $sql->quote_smart($_POST['dmg_type2']);
    30963094        else $dmg_type2 = 0;
    3097  if (isset($_POST['dmg_min3']) && $_POST['dmg_min3'] != '') $dmg_min3 = $mysql->quote_smart($_POST['dmg_min3']);
     3095 if (isset($_POST['dmg_min3']) && $_POST['dmg_min3'] != '') $dmg_min3 = $sql->quote_smart($_POST['dmg_min3']);
    30983096        else $dmg_min3 = 0;
    3099  if (isset($_POST['dmg_max3']) && $_POST['dmg_max3'] != '') $dmg_max3 = $mysql->quote_smart($_POST['dmg_max3']);
     3097 if (isset($_POST['dmg_max3']) && $_POST['dmg_max3'] != '') $dmg_max3 = $sql->quote_smart($_POST['dmg_max3']);
    31003098        else $dmg_max3 = 0;
    3101  if (isset($_POST['dmg_type3']) && $_POST['dmg_type3'] != '') $dmg_type3 = $mysql->quote_smart($_POST['dmg_type3']);
     3099 if (isset($_POST['dmg_type3']) && $_POST['dmg_type3'] != '') $dmg_type3 = $sql->quote_smart($_POST['dmg_type3']);
    31023100        else $dmg_type3 = 0;
    3103  if (isset($_POST['dmg_min4']) && $_POST['dmg_min4'] != '') $dmg_min4 = $mysql->quote_smart($_POST['dmg_min4']);
     3101 if (isset($_POST['dmg_min4']) && $_POST['dmg_min4'] != '') $dmg_min4 = $sql->quote_smart($_POST['dmg_min4']);
    31043102        else $dmg_min4 = 0;
    3105  if (isset($_POST['dmg_max4']) && $_POST['dmg_max4'] != '') $dmg_max4 = $mysql->quote_smart($_POST['dmg_max4']);
     3103 if (isset($_POST['dmg_max4']) && $_POST['dmg_max4'] != '') $dmg_max4 = $sql->quote_smart($_POST['dmg_max4']);
    31063104        else $dmg_max4 = 0;
    3107  if (isset($_POST['dmg_type4']) && $_POST['dmg_type4'] != '') $dmg_type4 = $mysql->quote_smart($_POST['dmg_type4']);
     3105 if (isset($_POST['dmg_type4']) && $_POST['dmg_type4'] != '') $dmg_type4 = $sql->quote_smart($_POST['dmg_type4']);
    31083106        else $dmg_type4 = 0;
    3109  if (isset($_POST['dmg_min5']) && $_POST['dmg_min5'] != '') $dmg_min5 = $mysql->quote_smart($_POST['dmg_min5']);
     3107 if (isset($_POST['dmg_min5']) && $_POST['dmg_min5'] != '') $dmg_min5 = $sql->quote_smart($_POST['dmg_min5']);
    31103108        else $dmg_min5 = 0;
    3111  if (isset($_POST['dmg_max5']) && $_POST['dmg_max5'] != '') $dmg_max5 = $mysql->quote_smart($_POST['dmg_max5']);
     3109 if (isset($_POST['dmg_max5']) && $_POST['dmg_max5'] != '') $dmg_max5 = $sql->quote_smart($_POST['dmg_max5']);
    31123110        else $dmg_max5 = 0;
    3113  if (isset($_POST['dmg_type5']) && $_POST['dmg_type5'] != '') $dmg_type5 = $mysql->quote_smart($_POST['dmg_type5']);
     3111 if (isset($_POST['dmg_type5']) && $_POST['dmg_type5'] != '') $dmg_type5 = $sql->quote_smart($_POST['dmg_type5']);
    31143112        else $dmg_type5 = 0;
    3115  if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $mysql->quote_smart($_POST['armor']);
     3113 if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $sql->quote_smart($_POST['armor']);
    31163114        else $armor = 0;
    3117  if (isset($_POST['holy_res']) && $_POST['holy_res'] != '') $holy_res = $mysql->quote_smart($_POST['holy_res']);
     3115 if (isset($_POST['holy_res']) && $_POST['holy_res'] != '') $holy_res = $sql->quote_smart($_POST['holy_res']);
    31183116        else $holy_res = 0;
    3119  if (isset($_POST['fire_res']) && $_POST['fire_res'] != '') $fire_res = $mysql->quote_smart($_POST['fire_res']);
     3117 if (isset($_POST['fire_res']) && $_POST['fire_res'] != '') $fire_res = $sql->quote_smart($_POST['fire_res']);
    31203118        else $fire_res = 0;
    3121  if (isset($_POST['nature_res']) && $_POST['nature_res'] != '') $nature_res = $mysql->quote_smart($_POST['nature_res']);
     3119 if (isset($_POST['nature_res']) && $_POST['nature_res'] != '') $nature_res = $sql->quote_smart($_POST['nature_res']);
    31223120        else $nature_res = 0;
    3123  if (isset($_POST['frost_res']) && $_POST['frost_res'] != '') $frost_res = $mysql->quote_smart($_POST['frost_res']);
     3121 if (isset($_POST['frost_res']) && $_POST['frost_res'] != '') $frost_res = $sql->quote_smart($_POST['frost_res']);
    31243122        else $frost_res = 0;
    3125  if (isset($_POST['shadow_res']) && $_POST['shadow_res'] != '') $shadow_res = $mysql->quote_smart($_POST['shadow_res']);
     3123 if (isset($_POST['shadow_res']) && $_POST['shadow_res'] != '') $shadow_res = $sql->quote_smart($_POST['shadow_res']);
    31263124        else $shadow_res = 0;
    3127  if (isset($_POST['arcane_res']) && $_POST['arcane_res'] != '') $arcane_res = $mysql->quote_smart($_POST['arcane_res']);
     3125 if (isset($_POST['arcane_res']) && $_POST['arcane_res'] != '') $arcane_res = $sql->quote_smart($_POST['arcane_res']);
    31283126        else $arcane_res = 0;
    3129  if (isset($_POST['delay']) && $_POST['delay'] != '') $delay = $mysql->quote_smart($_POST['delay']);
     3127 if (isset($_POST['delay']) && $_POST['delay'] != '') $delay = $sql->quote_smart($_POST['delay']);
    31303128        else $delay = 0;
    3131  if (isset($_POST['ammo_type']) && $_POST['ammo_type'] != '') $ammo_type = $mysql->quote_smart($_POST['ammo_type']);
     3129 if (isset($_POST['ammo_type']) && $_POST['ammo_type'] != '') $ammo_type = $sql->quote_smart($_POST['ammo_type']);
    31323130        else $ammo_type = 0;
    3133  if (isset($_POST['RangedModRange']) && $_POST['RangedModRange'] != '') $RangedModRange = $mysql->quote_smart($_POST['RangedModRange']);
     3131 if (isset($_POST['RangedModRange']) && $_POST['RangedModRange'] != '') $RangedModRange = $sql->quote_smart($_POST['RangedModRange']);
    31343132        else $RangedModRange = 0;
    3135  if (isset($_POST['spellid_1']) && $_POST['spellid_1'] != '') $spellid_1 = $mysql->quote_smart($_POST['spellid_1']);
     3133 if (isset($_POST['spellid_1']) && $_POST['spellid_1'] != '') $spellid_1 = $sql->quote_smart($_POST['spellid_1']);
    31363134        else $spellid_1 = 0;
    3137  if (isset($_POST['spelltrigger_1']) && $_POST['spelltrigger_1'] != '') $spelltrigger_1 = $mysql->quote_smart($_POST['spelltrigger_1']);
     3135 if (isset($_POST['spelltrigger_1']) && $_POST['spelltrigger_1'] != '') $spelltrigger_1 = $sql->quote_smart($_POST['spelltrigger_1']);
    31383136        else $spelltrigger_1 = 0;
    3139  if (isset($_POST['spellcharges_1']) && $_POST['spellcharges_1'] != '') $spellcharges_1 = $mysql->quote_smart($_POST['spellcharges_1']);
     3137 if (isset($_POST['spellcharges_1']) && $_POST['spellcharges_1'] != '') $spellcharges_1 = $sql->quote_smart($_POST['spellcharges_1']);
    31403138        else $spellcharges_1 = 0;
    3141  if (isset($_POST['spellcooldown_1']) && $_POST['spellcooldown_1'] != '') $spellcooldown_1 = $mysql->quote_smart($_POST['spellcooldown_1']);
     3139 if (isset($_POST['spellcooldown_1']) && $_POST['spellcooldown_1'] != '') $spellcooldown_1 = $sql->quote_smart($_POST['spellcooldown_1']);
    31423140        else $spellcooldown_1 = -1;
    3143  if (isset($_POST['spellcategory_1']) && $_POST['spellcategory_1'] != '') $spellcategory_1 = $mysql->quote_smart($_POST['spellcategory_1']);
     3141 if (isset($_POST['spellcategory_1']) && $_POST['spellcategory_1'] != '') $spellcategory_1 = $sql->quote_smart($_POST['spellcategory_1']);
    31443142        else $description = 0;
    3145  if (isset($_POST['spellcategorycooldown_1']) && $_POST['spellcategorycooldown_1'] != '') $spellcategorycooldown_1 = $mysql->quote_smart($_POST['spellcategorycooldown_1']);
     3143 if (isset($_POST['spellcategorycooldown_1']) && $_POST['spellcategorycooldown_1'] != '') $spellcategorycooldown_1 = $sql->quote_smart($_POST['spellcategorycooldown_1']);
    31463144        else $spellcategorycooldown_1 = -1;
    3147  if (isset($_POST['spellid_2']) && $_POST['spellid_2'] != '') $spellid_2 = $mysql->quote_smart($_POST['spellid_2']);
     3145 if (isset($_POST['spellid_2']) && $_POST['spellid_2'] != '') $spellid_2 = $sql->quote_smart($_POST['spellid_2']);
    31483146        else $spellid_2 = 0;
    3149  if (isset($_POST['spelltrigger_2']) && $_POST['spelltrigger_2'] != '') $spelltrigger_2 = $mysql->quote_smart($_POST['spelltrigger_2']);
     3147 if (isset($_POST['spelltrigger_2']) && $_POST['spelltrigger_2'] != '') $spelltrigger_2 = $sql->quote_smart($_POST['spelltrigger_2']);
    31503148        else $spelltrigger_2 = 0;
    3151  if (isset($_POST['spellcharges_2']) && $_POST['spellcharges_2'] != '') $spellcharges_2 = $mysql->quote_smart($_POST['spellcharges_2']);
     3149 if (isset($_POST['spellcharges_2']) && $_POST['spellcharges_2'] != '') $spellcharges_2 = $sql->quote_smart($_POST['spellcharges_2']);
    31523150        else $spellcharges_2 = 0;
    3153  if (isset($_POST['spellcooldown_2']) && $_POST['spellcooldown_2'] != '') $spellcooldown_2 = $mysql->quote_smart($_POST['spellcooldown_2']);
     3151 if (isset($_POST['spellcooldown_2']) && $_POST['spellcooldown_2'] != '') $spellcooldown_2 = $sql->quote_smart($_POST['spellcooldown_2']);
    31543152        else $spellcooldown_2 = -1;
    3155  if (isset($_POST['spellcategory_2']) && $_POST['spellcategory_2'] != '') $spellcategory_2 = $mysql->quote_smart($_POST['spellcategory_2']);
     3153 if (isset($_POST['spellcategory_2']) && $_POST['spellcategory_2'] != '') $spellcategory_2 = $sql->quote_smart($_POST['spellcategory_2']);
    31563154        else $spellcategory_2 = 0;
    3157  if (isset($_POST['spellcategorycooldown_2']) && $_POST['spellcategorycooldown_2'] != '') $spellcategorycooldown_2 = $mysql->quote_smart($_POST['spellcategorycooldown_2']);
     3155 if (isset($_POST['spellcategorycooldown_2']) && $_POST['spellcategorycooldown_2'] != '') $spellcategorycooldown_2 = $sql->quote_smart($_POST['spellcategorycooldown_2']);
    31583156        else $spellcategorycooldown_2 = -1;
    3159  if (isset($_POST['spellid_3']) && $_POST['spellid_3'] != '') $spellid_3 = $mysql->quote_smart($_POST['spellid_3']);
     3157 if (isset($_POST['spellid_3']) && $_POST['spellid_3'] != '') $spellid_3 = $sql->quote_smart($_POST['spellid_3']);
    31603158        else $spellid_3 = 0;
    3161  if (isset($_POST['spelltrigger_3']) && $_POST['spelltrigger_3'] != '') $spelltrigger_3 = $mysql->quote_smart($_POST['spelltrigger_3']);
     3159 if (isset($_POST['spelltrigger_3']) && $_POST['spelltrigger_3'] != '') $spelltrigger_3 = $sql->quote_smart($_POST['spelltrigger_3']);
    31623160        else $spelltrigger_3 = 0;
    3163  if (isset($_POST['spellcharges_3']) && $_POST['spellcharges_3'] != '') $spellcharges_3 = $mysql->quote_smart($_POST['spellcharges_3']);
     3161 if (isset($_POST['spellcharges_3']) && $_POST['spellcharges_3'] != '') $spellcharges_3 = $sql->quote_smart($_POST['spellcharges_3']);
    31643162        else $spellcharges_3 = 0;
    3165  if (isset($_POST['spellcooldown_3']) && $_POST['spellcooldown_3'] != '') $spellcooldown_3 = $mysql->quote_smart($_POST['spellcooldown_3']);
     3163 if (isset($_POST['spellcooldown_3']) && $_POST['spellcooldown_3'] != '') $spellcooldown_3 = $sql->quote_smart($_POST['spellcooldown_3']);
    31663164        else $spellcooldown_3 = -1;
    3167  if (isset($_POST['spellcategory_3']) && $_POST['spellcategory_3'] != '') $spellcategory_3 = $mysql->quote_smart($_POST['spellcategory_3']);
     3165 if (isset($_POST['spellcategory_3']) && $_POST['spellcategory_3'] != '') $spellcategory_3 = $sql->quote_smart($_POST['spellcategory_3']);
    31683166        else $description = 0;
    3169  if (isset($_POST['spellcategorycooldown_3']) && $_POST['spellcategorycooldown_3'] != '') $spellcategorycooldown_3 = $mysql->quote_smart($_POST['spellcategorycooldown_3']);
     3167 if (isset($_POST['spellcategorycooldown_3']) && $_POST['spellcategorycooldown_3'] != '') $spellcategorycooldown_3 = $sql->quote_smart($_POST['spellcategorycooldown_3']);
    31703168        else $spellcategorycooldown_3 = -1;
    3171  if (isset($_POST['spellid_4']) && $_POST['spellid_4'] != '') $spellid_4 = $mysql->quote_smart($_POST['spellid_4']);
     3169 if (isset($_POST['spellid_4']) && $_POST['spellid_4'] != '') $spellid_4 = $sql->quote_smart($_POST['spellid_4']);
    31723170        else $spellid_4 = 0;
    3173  if (isset($_POST['spelltrigger_4']) && $_POST['spelltrigger_4'] != '') $spelltrigger_4 = $mysql->quote_smart($_POST['spelltrigger_4']);
     3171 if (isset($_POST['spelltrigger_4']) && $_POST['spelltrigger_4'] != '') $spelltrigger_4 = $sql->quote_smart($_POST['spelltrigger_4']);
    31743172        else $spelltrigger_4 = 0;
    3175  if (isset($_POST['spellcharges_4']) && $_POST['spellcharges_4'] != '') $spellcharges_4 = $mysql->quote_smart($_POST['spellcharges_4']);
     3173 if (isset($_POST['spellcharges_4']) && $_POST['spellcharges_4'] != '') $spellcharges_4 = $sql->quote_smart($_POST['spellcharges_4']);
    31763174        else $spellcharges_4 = 0;
    3177  if (isset($_POST['spellcooldown_4']) && $_POST['spellcooldown_4'] != '') $spellcooldown_4 = $mysql->quote_smart($_POST['spellcooldown_4']);
     3175 if (isset($_POST['spellcooldown_4']) && $_POST['spellcooldown_4'] != '') $spellcooldown_4 = $sql->quote_smart($_POST['spellcooldown_4']);
    31783176        else $spellcooldown_4 = -1;
    3179  if (isset($_POST['spellcategory_4']) && $_POST['spellcategory_4'] != '') $spellcategory_4 = $mysql->quote_smart($_POST['spellcategory_4']);
     3177 if (isset($_POST['spellcategory_4']) && $_POST['spellcategory_4'] != '') $spellcategory_4 = $sql->quote_smart($_POST['spellcategory_4']);
    31803178        else $spellcategory_4 = 0;
    3181  if (isset($_POST['spellcategorycooldown_4']) && $_POST['spellcategorycooldown_4'] != '') $spellcategorycooldown_4 = $mysql->quote_smart($_POST['spellcategorycooldown_4']);
     3179 if (isset($_POST['spellcategorycooldown_4']) && $_POST['spellcategorycooldown_4'] != '') $spellcategorycooldown_4 = $sql->quote_smart($_POST['spellcategorycooldown_4']);
    31823180        else $spellcategorycooldown_4 = -1;
    3183  if (isset($_POST['spellid_5']) && $_POST['spellid_5'] != '') $spellid_5 = $mysql->quote_smart($_POST['spellid_5']);
     3181 if (isset($_POST['spellid_5']) && $_POST['spellid_5'] != '') $spellid_5 = $sql->quote_smart($_POST['spellid_5']);
    31843182        else $spellid_5 = 0;
    3185  if (isset($_POST['spelltrigger_5']) && $_POST['spelltrigger_5'] != '') $spelltrigger_5 = $mysql->quote_smart($_POST['spelltrigger_5']);
     3183 if (isset($_POST['spelltrigger_5']) && $_POST['spelltrigger_5'] != '') $spelltrigger_5 = $sql->quote_smart($_POST['spelltrigger_5']);
    31863184        else $spelltrigger_5 = 0;
    3187  if (isset($_POST['spellcharges_5']) && $_POST['spellcharges_5'] != '') $spellcharges_5 = $mysql->quote_smart($_POST['spellcharges_5']);
     3185 if (isset($_POST['spellcharges_5']) && $_POST['spellcharges_5'] != '') $spellcharges_5 = $sql->quote_smart($_POST['spellcharges_5']);
    31883186        else $spellcharges_5 = 0;
    3189  if (isset($_POST['spellcooldown_5']) && $_POST['spellcooldown_5'] != '') $spellcooldown_5 = $mysql->quote_smart($_POST['spellcooldown_5']);
     3187 if (isset($_POST['spellcooldown_5']) && $_POST['spellcooldown_5'] != '') $spellcooldown_5 = $sql->quote_smart($_POST['spellcooldown_5']);
    31903188        else $spellcooldown_5 = -1;
    3191  if (isset($_POST['spellcategory_5']) && $_POST['spellcategory_5'] != '') $spellcategory_5 = $mysql->quote_smart($_POST['spellcategory_5']);
     3189 if (isset($_POST['spellcategory_5']) && $_POST['spellcategory_5'] != '') $spellcategory_5 = $sql->quote_smart($_POST['spellcategory_5']);
    31923190        else $spellcategory_5 = 0;
    3193  if (isset($_POST['spellcategorycooldown_5']) && $_POST['spellcategorycooldown_5'] != '') $spellcategorycooldown_5 = $mysql->quote_smart($_POST['spellcategorycooldown_5']);
     3191 if (isset($_POST['spellcategorycooldown_5']) && $_POST['spellcategorycooldown_5'] != '') $spellcategorycooldown_5 = $sql->quote_smart($_POST['spellcategorycooldown_5']);
    31943192        else $spellcategorycooldown_5 = -1;
    3195  if (isset($_POST['bonding']) && $_POST['bonding'] != '') $bonding = $mysql->quote_smart($_POST['bonding']);
     3193 if (isset($_POST['bonding']) && $_POST['bonding'] != '') $bonding = $sql->quote_smart($_POST['bonding']);
    31963194        else $bonding = 0;
    3197  if (isset($_POST['description']) && $_POST['description'] != '') $description = $mysql->quote_smart($_POST['description']);
     3195 if (isset($_POST['description']) && $_POST['description'] != '') $description = $sql->quote_smart($_POST['description']);
    31983196        else $description = "";
    3199  if (isset($_POST['PageText']) && $_POST['PageText'] != '') $PageText = $mysql->quote_smart($_POST['PageText']);
     3197 if (isset($_POST['PageText']) && $_POST['PageText'] != '') $PageText = $sql->quote_smart($_POST['PageText']);
    32003198        else $PageText = 0;
    3201  if (isset($_POST['LanguageID']) && $_POST['LanguageID'] != '') $LanguageID = $mysql->quote_smart($_POST['LanguageID']);
     3199 if (isset($_POST['LanguageID']) && $_POST['LanguageID'] != '') $LanguageID = $sql->quote_smart($_POST['LanguageID']);
    32023200        else $LanguageID = 0;
    3203  if (isset($_POST['PageMaterial']) && $_POST['PageMaterial'] != '') $PageMaterial = $mysql->quote_smart($_POST['PageMaterial']);
     3201 if (isset($_POST['PageMaterial']) && $_POST['PageMaterial'] != '') $PageMaterial = $sql->quote_smart($_POST['PageMaterial']);
    32043202        else $PageMaterial = 0;
    3205  if (isset($_POST['startquest']) && $_POST['startquest'] != '') $startquest = $mysql->quote_smart($_POST['startquest']);
     3203 if (isset($_POST['startquest']) && $_POST['startquest'] != '') $startquest = $sql->quote_smart($_POST['startquest']);
    32063204        else $startquest = 0;
    3207  if (isset($_POST['lockid']) && $_POST['lockid'] != '') $lockid = $mysql->quote_smart($_POST['lockid']);
     3205 if (isset($_POST['lockid']) && $_POST['lockid'] != '') $lockid = $sql->quote_smart($_POST['lockid']);
    32083206        else $lockid = 0;
    3209  if (isset($_POST['Material']) && $_POST['Material'] != '') $Material = $mysql->quote_smart($_POST['Material']);
     3207 if (isset($_POST['Material']) && $_POST['Material'] != '') $Material = $sql->quote_smart($_POST['Material']);
    32103208        else $Material = 0;
    3211  if (isset($_POST['sheath']) && $_POST['sheath'] != '') $sheath = $mysql->quote_smart($_POST['sheath']);
     3209 if (isset($_POST['sheath']) && $_POST['sheath'] != '') $sheath = $sql->quote_smart($_POST['sheath']);
    32123210        else $sheath = 0;
    3213  if (isset($_POST['RandomProperty']) && $_POST['RandomProperty'] != '') $RandomProperty = $mysql->quote_smart($_POST['RandomProperty']);
     3211 if (isset($_POST['RandomProperty']) && $_POST['RandomProperty'] != '') $RandomProperty = $sql->quote_smart($_POST['RandomProperty']);
    32143212        else $RandomProperty = 0;
    3215  if (isset($_POST['block ']) && $_POST['block '] != '') $block = $mysql->quote_smart($_POST['block']);
     3213 if (isset($_POST['block ']) && $_POST['block '] != '') $block = $sql->quote_smart($_POST['block']);
    32163214        else $block  = 0;
    3217  if (isset($_POST['itemset']) && $_POST['itemset'] != '') $itemset = $mysql->quote_smart($_POST['itemset']);
     3215 if (isset($_POST['itemset']) && $_POST['itemset'] != '') $itemset = $sql->quote_smart($_POST['itemset']);
    32183216        else $itemset = 0;
    3219  if (isset($_POST['MaxDurability']) && $_POST['MaxDurability'] != '') $MaxDurability = $mysql->quote_smart($_POST['MaxDurability']);
     3217 if (isset($_POST['MaxDurability']) && $_POST['MaxDurability'] != '') $MaxDurability = $sql->quote_smart($_POST['MaxDurability']);
    32203218        else $MaxDurability = 0;
    3221  if (isset($_POST['area']) && $_POST['area'] != '') $area = $mysql->quote_smart($_POST['area']);
     3219 if (isset($_POST['area']) && $_POST['area'] != '') $area = $sql->quote_smart($_POST['area']);
    32223220        else $area = 0;
    3223  if (isset($_POST['BagFamily']) && $_POST['BagFamily'] != '') $BagFamily = $mysql->quote_smart($_POST['BagFamily']);
     3221 if (isset($_POST['BagFamily']) && $_POST['BagFamily'] != '') $BagFamily = $sql->quote_smart($_POST['BagFamily']);
    32243222        else $BagFamily = 0;
    3225  if (isset($_POST['Map']) && $_POST['Map'] != '') $Map = $mysql->quote_smart($_POST['Map']);
     3223 if (isset($_POST['Map']) && $_POST['Map'] != '') $Map = $sql->quote_smart($_POST['Map']);
    32263224        else $Map = 0;
    3227  if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
     3225 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
    32283226        else $ScriptName = 0;
    3229  if (isset($_POST['DisenchantID']) && $_POST['DisenchantID'] != '') $DisenchantID = $mysql->quote_smart($_POST['DisenchantID']);
     3227 if (isset($_POST['DisenchantID']) && $_POST['DisenchantID'] != '') $DisenchantID = $sql->quote_smart($_POST['DisenchantID']);
    32303228        else $DisenchantID = 0;
    3231  if (isset($_POST['RequiredDisenchantSkill']) && $_POST['RequiredDisenchantSkill'] != '') $RequiredDisenchantSkill = $mysql->quote_smart($_POST['RequiredDisenchantSkill']);
     3229 if (isset($_POST['RequiredDisenchantSkill']) && $_POST['RequiredDisenchantSkill'] != '') $RequiredDisenchantSkill = $sql->quote_smart($_POST['RequiredDisenchantSkill']);
    32323230        else $RequiredDisenchantSkill = -1;
    3233  if (isset($_POST['unk0']) && $_POST['unk0'] != '') $unk0 = $mysql->quote_smart($_POST['unk0']);
     3231 if (isset($_POST['unk0']) && $_POST['unk0'] != '') $unk0 = $sql->quote_smart($_POST['unk0']);
    32343232        else $unk0 = -1;
    3235  if (isset($_POST['RandomSuffix']) && $_POST['RandomSuffix'] != '') $RandomSuffix = $mysql->quote_smart($_POST['RandomSuffix']);
     3233 if (isset($_POST['RandomSuffix']) && $_POST['RandomSuffix'] != '') $RandomSuffix = $sql->quote_smart($_POST['RandomSuffix']);
    32363234        else $RandomSuffix = 0;
    3237  if (isset($_POST['TotemCategory']) && $_POST['TotemCategory'] != '') $TotemCategory = $mysql->quote_smart($_POST['TotemCategory']);
     3235 if (isset($_POST['TotemCategory']) && $_POST['TotemCategory'] != '') $TotemCategory = $sql->quote_smart($_POST['TotemCategory']);
    32383236        else $TotemCategory = 0;
    3239  if (isset($_POST['socketColor_1']) && $_POST['socketColor_1'] != '') $socketColor_1 = $mysql->quote_smart($_POST['socketColor_1']);
     3237 if (isset($_POST['socketColor_1']) && $_POST['socketColor_1'] != '') $socketColor_1 = $sql->quote_smart($_POST['socketColor_1']);
    32403238        else $socketColor_1 = 0;
    3241  if (isset($_POST['socketContent_1']) && $_POST['socketContent_1'] != '') $socketContent_1 = $mysql->quote_smart($_POST['socketContent_1']);
     3239 if (isset($_POST['socketContent_1']) && $_POST['socketContent_1'] != '') $socketContent_1 = $sql->quote_smart($_POST['socketContent_1']);
    32423240        else $socketContent_1 = 0;
    3243  if (isset($_POST['socketColor_2']) && $_POST['socketColor_2'] != '') $socketColor_2 = $mysql->quote_smart($_POST['socketColor_2']);
     3241 if (isset($_POST['socketColor_2']) && $_POST['socketColor_2'] != '') $socketColor_2 = $sql->quote_smart($_POST['socketColor_2']);
    32443242        else $socketColor_2 = 0;
    3245  if (isset($_POST['socketContent_2']) && $_POST['socketContent_2'] != '') $socketContent_2 = $mysql->quote_smart($_POST['socketContent_2']);
     3243 if (isset($_POST['socketContent_2']) && $_POST['socketContent_2'] != '') $socketContent_2 = $sql->quote_smart($_POST['socketContent_2']);
    32463244        else $socketContent_2 = 0;
    3247  if (isset($_POST['socketColor_3']) && $_POST['socketColor_3'] != '') $socketColor_3 = $mysql->quote_smart($_POST['socketColor_3']);
     3245 if (isset($_POST['socketColor_3']) && $_POST['socketColor_3'] != '') $socketColor_3 = $sql->quote_smart($_POST['socketColor_3']);
    32483246        else $socketColor_3 = 0;
    3249  if (isset($_POST['socketContent_3']) && $_POST['socketContent_3'] != '') $socketContent_3 = $mysql->quote_smart($_POST['socketContent_3']);
     3247 if (isset($_POST['socketContent_3']) && $_POST['socketContent_3'] != '') $socketContent_3 = $sql->quote_smart($_POST['socketContent_3']);
    32503248        else $socketContent_3 = 0;
    3251  if (isset($_POST['socketBonus']) && $_POST['socketBonus'] != '') $socketBonus = $mysql->quote_smart($_POST['socketBonus']);
     3249 if (isset($_POST['socketBonus']) && $_POST['socketBonus'] != '') $socketBonus = $sql->quote_smart($_POST['socketBonus']);
    32523250        else $socketBonus = 0;
    3253  if (isset($_POST['GemProperties']) && $_POST['GemProperties'] != '') $GemProperties = $mysql->quote_smart($_POST['GemProperties']);
     3251 if (isset($_POST['GemProperties']) && $_POST['GemProperties'] != '') $GemProperties = $sql->quote_smart($_POST['GemProperties']);
    32543252        else $GemProperties = 0;
    3255  if (isset($_POST['ExtendedCost']) && $_POST['ExtendedCost'] != '') $ExtendedCost = $mysql->quote_smart($_POST['ExtendedCost']);
     3253 if (isset($_POST['ExtendedCost']) && $_POST['ExtendedCost'] != '') $ExtendedCost = $sql->quote_smart($_POST['ExtendedCost']);
    32563254        else $ExtendedCost = 0;
    3257  if (isset($_POST['ArmorDamageModifier']) && $_POST['ArmorDamageModifier'] != '') $ArmorDamageModifier = $mysql->quote_smart($_POST['ArmorDamageModifier']);
     3255 if (isset($_POST['ArmorDamageModifier']) && $_POST['ArmorDamageModifier'] != '') $ArmorDamageModifier = $sql->quote_smart($_POST['ArmorDamageModifier']);
    32583256        else $ArmorDamageModifier = 0;
    32593257
    3260         if (isset($_POST['de_ChanceOrRef']) && $_POST['de_ChanceOrRef'] != '') $de_ChanceOrRef = $mysql->quote_smart($_POST['de_ChanceOrRef']);
     3258        if (isset($_POST['de_ChanceOrRef']) && $_POST['de_ChanceOrRef'] != '') $de_ChanceOrRef = $sql->quote_smart($_POST['de_ChanceOrRef']);
    32613259                else $de_ChanceOrRef = 0;
    3262         if (isset($_POST['de_QuestChanceOrGroup']) && $_POST['de_QuestChanceOrGroup'] != '') $de_QuestChanceOrGroup = $mysql->quote_smart($_POST['de_QuestChanceOrGroup']);
     3260        if (isset($_POST['de_QuestChanceOrGroup']) && $_POST['de_QuestChanceOrGroup'] != '') $de_QuestChanceOrGroup = $sql->quote_smart($_POST['de_QuestChanceOrGroup']);
    32633261                else $de_QuestChanceOrGroup = 0;
    3264         if (isset($_POST['de_mincount']) && $_POST['de_mincount'] != '') $de_mincount = $mysql->quote_smart($_POST['de_mincount']);
     3262        if (isset($_POST['de_mincount']) && $_POST['de_mincount'] != '') $de_mincount = $sql->quote_smart($_POST['de_mincount']);
    32653263                else $de_mincount = 0;
    3266         if (isset($_POST['de_maxcount']) && $_POST['de_maxcount'] != '') $de_maxcount = $mysql->quote_smart($_POST['de_maxcount']);
     3264        if (isset($_POST['de_maxcount']) && $_POST['de_maxcount'] != '') $de_maxcount = $sql->quote_smart($_POST['de_maxcount']);
    32673265                else $de_maxcount = 0;
    3268         if (isset($_POST['de_quest_freeforall']) && $_POST['de_quest_freeforall'] != '') $de_quest_freeforall = $mysql->quote_smart($_POST['de_quest_freeforall']);
     3266        if (isset($_POST['de_quest_freeforall']) && $_POST['de_quest_freeforall'] != '') $de_quest_freeforall = $sql->quote_smart($_POST['de_quest_freeforall']);
    32693267                else $de_quest_freeforall = 0;
    3270         if (isset($_POST['de_item']) && $_POST['de_item'] != '') $de_item = $mysql->quote_smart($_POST['de_item']);
     3268        if (isset($_POST['de_item']) && $_POST['de_item'] != '') $de_item = $sql->quote_smart($_POST['de_item']);
    32713269                else $de_item = 0;
    3272         if (isset($_POST['del_de_items']) && $_POST['del_de_items'] != '') $del_de_items = $mysql->quote_smart($_POST['del_de_items']);
     3270        if (isset($_POST['del_de_items']) && $_POST['del_de_items'] != '') $del_de_items = $sql->quote_smart($_POST['del_de_items']);
    32733271                else $del_de_items = NULL;
    32743272
     
    33123310
    33133311  if ($_POST['type'] == "add_new"){
    3314         $sql = "INSERT INTO item_template (entry, class, subclass, name, name2, name3, name4, displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, AllowableRace, ItemLevel,
     3312        $sql_query = "INSERT INTO item_template (entry, class, subclass, name,displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, AllowableRace, ItemLevel,
    33153313        RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, stat_type1,
    33163314        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,
     
    33213319        bonding, description, PageText, LanguageID, PageMaterial, startquest, lockid, Material, sheath, RandomProperty, block, itemset, MaxDurability, area, BagFamily, Map, ScriptName, DisenchantID,RequiredDisenchantSkill,
    33223320        ArmorDamageModifier,unk0,RandomSuffix,TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, GemProperties, ExtendedCost)
    3323         VALUES ('$entry', '$class', '$subclass', '$name', '$name2', '$name3', '$name4', '$displayid', '$Quality', '$Flags', '$BuyCount', '$BuyPrice', '$SellPrice', '$InventoryType', '$AllowableClass', '$AllowableRace', '$ItemLevel', '$RequiredLevel',
     3321        VALUES ('$entry', '$class', '$subclass', '$name','$displayid', '$Quality', '$Flags', '$BuyCount', '$BuyPrice', '$SellPrice', '$InventoryType', '$AllowableClass', '$AllowableRace', '$ItemLevel', '$RequiredLevel',
    33243322        '$RequiredSkill', '$RequiredSkillRank', '$requiredspell', '$requiredhonorrank', '$RequiredCityRank', '$RequiredReputationFaction', '$RequiredReputationRank', '$maxcount', '$stackable', '$ContainerSlots', '$stat_type1',
    33253323        '$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',
     
    33343332 } elseif ($_POST['type'] == "edit"){
    33353333
    3336         $sql = "UPDATE item_template SET  ";
    3337  
    3338         $result = $mysql->query("SELECT * FROM item_template WHERE entry = '$entry'");
    3339         if ($item_templ = $mysql->fetch_assoc($result)){
    3340  
    3341                 if ($item_templ['class'] != $class) $sql .= "class='$class',";
    3342                 if ($item_templ['subclass'] != $subclass) $sql .= "subclass='$subclass',";
    3343                 if ($item_templ['name'] != $name) $sql .= "name='$name',";
    3344                 if ($item_templ['displayid'] != $displayid) $sql .= "displayid='$displayid',";
    3345                 if ($item_templ['Quality'] != $Quality) $sql .= "Quality='$Quality',";
    3346                 if ($item_templ['Flags'] != $Flags) $sql .= "Flags='$Flags',";
    3347                 if ($item_templ['BuyCount'] != $BuyCount) $sql .= "BuyCount='$BuyCount',";
    3348                 if ($item_templ['BuyPrice'] != $BuyPrice) $sql .= "BuyPrice='$BuyPrice',";
    3349                 if ($item_templ['SellPrice'] != $SellPrice) $sql .= "SellPrice='$SellPrice',";
    3350                 if ($item_templ['InventoryType'] != $InventoryType) $sql .= "InventoryType='$InventoryType',";
    3351                 if ($item_templ['AllowableClass'] != $AllowableClass) $sql .= "AllowableClass='$AllowableClass',";
    3352                 if ($item_templ['AllowableRace'] != $AllowableRace) $sql .= "AllowableRace='$AllowableRace',";
    3353                 if ($item_templ['ItemLevel'] != $ItemLevel) $sql .= "ItemLevel='$ItemLevel',";
    3354                 if ($item_templ['RequiredLevel'] != $RequiredLevel) $sql .= "RequiredLevel='$RequiredLevel',";
    3355                 if ($item_templ['RequiredSkill'] != $RequiredSkill) $sql .= "RequiredSkill='$RequiredSkill',";
    3356                 if ($item_templ['RequiredSkillRank'] != $RequiredSkillRank) $sql .= "RequiredSkillRank='$RequiredSkillRank',";
    3357                 if ($item_templ['requiredspell'] != $requiredspell) $sql .= "requiredspell='$requiredspell',";
    3358                 if ($item_templ['requiredhonorrank'] != $requiredhonorrank) $sql .= "requiredhonorrank='$requiredhonorrank',";
    3359                 if ($item_templ['RequiredCityRank'] != $RequiredCityRank) $sql .= "RequiredCityRank='$RequiredCityRank',";
    3360                 if ($item_templ['RequiredReputationFaction'] != $RequiredReputationFaction) $sql .= "RequiredReputationFaction='$RequiredReputationFaction',";
    3361                 if ($item_templ['RequiredReputationRank'] != $RequiredReputationRank) $sql .= "RequiredReputationRank='$RequiredReputationRank',";
    3362                 if ($item_templ['maxcount'] != $maxcount) $sql .= "maxcount='$maxcount',";
    3363                 if ($item_templ['stackable'] != $stackable) $sql .= "stackable='$stackable',";
    3364                 if ($item_templ['ContainerSlots'] != $ContainerSlots) $sql .= "ContainerSlots='$ContainerSlots',";
    3365                 if ($item_templ['stat_type1'] != $stat_type1) $sql .= "stat_type1='$stat_type1',";
    3366                 if ($item_templ['stat_value1'] != $stat_value1) $sql .= "stat_value1='$stat_value1',";
    3367                 if ($item_templ['stat_type2'] != $stat_type2) $sql .= "stat_type2='$stat_type2',";
    3368                 if ($item_templ['stat_value2'] != $stat_value2) $sql .= "stat_value2='$stat_value2',";
    3369                 if ($item_templ['stat_type3'] != $stat_type3) $sql .= "stat_type3='$stat_type3',";
    3370                 if ($item_templ['stat_value3'] != $stat_value3) $sql .= "stat_value3='$stat_value3',";
    3371                 if ($item_templ['stat_type4'] != $stat_type4) $sql .= "stat_type4='$stat_type4',";
    3372                 if ($item_templ['stat_value4'] != $stat_value4) $sql .= "stat_value4='$stat_value4',";
    3373                 if ($item_templ['stat_type5'] != $stat_type5) $sql .= "stat_type5='$stat_type5',";
    3374                 if ($item_templ['stat_value5'] != $stat_value5) $sql .= "stat_value5='$stat_value5',";
    3375                 if ($item_templ['stat_type6'] != $stat_type6) $sql .= "stat_type6='$stat_type6',";
    3376                 if ($item_templ['stat_value6'] != $stat_value6) $sql .= "stat_value6='$stat_value6',";
    3377                 if ($item_templ['stat_type7'] != $stat_type7) $sql .= "stat_type7='$stat_type7',";
    3378                 if ($item_templ['stat_value7'] != $stat_value7) $sql .= "stat_value7='$stat_value7',";
    3379                 if ($item_templ['stat_type8'] != $stat_type8) $sql .= "stat_type8='$stat_type8',";
    3380                 if ($item_templ['stat_value8'] != $stat_value8) $sql .= "stat_value8='$stat_value8',";
    3381                 if ($item_templ['stat_type9'] != $stat_type9) $sql .= "stat_type9='$stat_type9',";
    3382                 if ($item_templ['stat_value9'] != $stat_value9) $sql .= "stat_value9='$stat_value9',";
    3383                 if ($item_templ['stat_type10'] != $stat_type10) $sql .= "stat_type10='$stat_type10',";
    3384                 if ($item_templ['stat_value10'] != $stat_value10) $sql .= "stat_value10='$stat_value10',";
    3385                 if ($item_templ['dmg_min1'] != $dmg_min1) $sql .= "dmg_min1='$dmg_min1',";
    3386                 if ($item_templ['dmg_max1'] != $dmg_max1) $sql .= "dmg_max1='$dmg_max1',";
    3387                 if ($item_templ['dmg_type1'] != $dmg_type1) $sql .= "dmg_type1='$dmg_type1',";
    3388                 if ($item_templ['dmg_min2'] != $dmg_min2) $sql .= "dmg_min2='$dmg_min2',";
    3389                 if ($item_templ['dmg_max2'] != $dmg_max2) $sql .= "dmg_max2='$dmg_max2',";
    3390                 if ($item_templ['dmg_type2'] != $dmg_type2) $sql .= "dmg_type2='$dmg_type2',";
    3391                 if ($item_templ['dmg_min3'] != $dmg_min3) $sql .= "dmg_min3='$dmg_min3',";
    3392                 if ($item_templ['dmg_max3'] != $dmg_max3) $sql .= "dmg_max3='$dmg_max3',";
    3393                 if ($item_templ['dmg_type3'] != $dmg_type3) $sql .= "dmg_type3='$dmg_type3',";
    3394                 if ($item_templ['dmg_min4'] != $dmg_min4) $sql .= "dmg_min4='$dmg_min4',";
    3395                 if ($item_templ['dmg_max4'] != $dmg_max4) $sql .= "dmg_max4='$dmg_max4',";
    3396                 if ($item_templ['dmg_type4'] != $dmg_type4) $sql .= "dmg_type4='$dmg_type4',";
    3397                 if ($item_templ['dmg_min5'] != $dmg_min5) $sql .= "dmg_min5='$dmg_min5',";
    3398                 if ($item_templ['dmg_max5'] != $dmg_max5) $sql .= "dmg_max5='$dmg_max5',";
    3399                 if ($item_templ['dmg_type5'] != $dmg_type5) $sql .= "dmg_type5='$dmg_type5',";
    3400                 if ($item_templ['armor'] != $armor) $sql .= "armor='$armor',";
    3401                 if ($item_templ['holy_res'] != $holy_res) $sql .= "holy_res='$holy_res',";
    3402                 if ($item_templ['fire_res'] != $fire_res) $sql .= "fire_res='$fire_res',";
    3403                 if ($item_templ['nature_res'] != $nature_res) $sql .= "nature_res='$nature_res',";
    3404                 if ($item_templ['frost_res'] != $frost_res) $sql .= "frost_res='$frost_res',";
    3405                 if ($item_templ['shadow_res'] != $shadow_res) $sql .= "shadow_res='$shadow_res',";             
    3406                 if ($item_templ['arcane_res'] != $arcane_res) $sql .= "arcane_res='$arcane_res',";
    3407                 if ($item_templ['delay'] != $delay) $sql .= "delay='$delay',";
    3408                 if ($item_templ['ammo_type'] != $ammo_type) $sql .= "ammo_type='$ammo_type',";
    3409                 if ($item_templ['RangedModRange'] != $RangedModRange) $sql .= "RangedModRange='$RangedModRange',";
    3410                 if ($item_templ['spellid_1'] != $spellid_1) $sql .= "spellid_1='$spellid_1',";
    3411                 if ($item_templ['spelltrigger_1'] != $spelltrigger_1) $sql .= "spelltrigger_1='$spelltrigger_1',";
    3412                 if ($item_templ['spellcharges_1'] != $spellcharges_1) $sql .= "spellcharges_1='$spellcharges_1',";
    3413                 if ($item_templ['spellcooldown_1'] != $spellcooldown_1) $sql .= "spellcooldown_1='$spellcooldown_1',";
    3414                 if ($item_templ['spellcategory_1'] != $spellcategory_1) $sql .= "spellcategory_1='$spellcategory_1',";
    3415                 if ($item_templ['spellcategorycooldown_1'] != $spellcategorycooldown_1) $sql .= "spellcategorycooldown_1='$spellcategorycooldown_1',"; 
    3416                 if ($item_templ['spellid_2'] != $spellid_2) $sql .= "spellid_2='$spellid_2',"; 
    3417                 if ($item_templ['spelltrigger_2'] != $spelltrigger_2) $sql .= "spelltrigger_2='$spelltrigger_2',";
    3418                 if ($item_templ['spellcharges_2'] != $spellcharges_2) $sql .= "spellcharges_2='$spellcharges_2',";
    3419                 if ($item_templ['spellcooldown_2'] != $spellcooldown_2) $sql .= "spellcooldown_2='$spellcooldown_2',";
    3420                 if ($item_templ['spellcategory_2'] != $spellcategory_2) $sql .= "spellcategory_2='$spellcategory_2',";
    3421                 if ($item_templ['spellcategorycooldown_2'] != $spellcategorycooldown_2) $sql .= "spellcategorycooldown_2='$spellcategorycooldown_2',";
    3422                 if ($item_templ['spellid_3'] != $spellid_3) $sql .= "spellid_3='$spellid_3',";
    3423                 if ($item_templ['spelltrigger_3'] != $spelltrigger_3) $sql .= "spelltrigger_3='$spelltrigger_3',";
    3424                 if ($item_templ['spellcharges_3'] != $spellcharges_3) $sql .= "spellcharges_3='$spellcharges_3',";
    3425                 if ($item_templ['spellcooldown_3'] != $spellcooldown_3) $sql .= "spellcooldown_3='$spellcooldown_3',";
    3426                 if ($item_templ['spellcategory_3'] != $spellcategory_3) $sql .= "spellcategory_3='$spellcategory_3',";
    3427                 if ($item_templ['spellcategorycooldown_3'] != $spellcategorycooldown_3) $sql .= "spellcategorycooldown_3='$spellcategorycooldown_3',"; 
     3334        $sql_query = "UPDATE item_template SET  ";
     3335 
     3336        $result = $sql->query("SELECT * FROM item_template WHERE entry = '$entry'");
     3337        if ($item_templ = $sql->fetch_assoc($result)){
     3338 
     3339                if ($item_templ['class'] != $class) $sql_query .= "class='$class',";
     3340                if ($item_templ['subclass'] != $subclass) $sql_query .= "subclass='$subclass',";
     3341                if ($item_templ['name'] != $name) $sql_query .= "name='$name',";
     3342                if ($item_templ['displayid'] != $displayid) $sql_query .= "displayid='$displayid',";
     3343                if ($item_templ['Quality'] != $Quality) $sql_query .= "Quality='$Quality',";
     3344                if ($item_templ['Flags'] != $Flags) $sql_query .= "Flags='$Flags',";
     3345                if ($item_templ['BuyCount'] != $BuyCount) $sql_query .= "BuyCount='$BuyCount',";
     3346                if ($item_templ['BuyPrice'] != $BuyPrice) $sql_query .= "BuyPrice='$BuyPrice',";
     3347                if ($item_templ['SellPrice'] != $SellPrice) $sql_query .= "SellPrice='$SellPrice',";
     3348                if ($item_templ['InventoryType'] != $InventoryType) $sql_query .= "InventoryType='$InventoryType',";
     3349                if ($item_templ['AllowableClass'] != $AllowableClass) $sql_query .= "AllowableClass='$AllowableClass',";
     3350                if ($item_templ['AllowableRace'] != $AllowableRace) $sql_query .= "AllowableRace='$AllowableRace',";
     3351                if ($item_templ['ItemLevel'] != $ItemLevel) $sql_query .= "ItemLevel='$ItemLevel',";
     3352                if ($item_templ['RequiredLevel'] != $RequiredLevel) $sql_query .= "RequiredLevel='$RequiredLevel',";
     3353                if ($item_templ['RequiredSkill'] != $RequiredSkill) $sql_query .= "RequiredSkill='$RequiredSkill',";
     3354                if ($item_templ['RequiredSkillRank'] != $RequiredSkillRank) $sql_query .= "RequiredSkillRank='$RequiredSkillRank',";
     3355                if ($item_templ['requiredspell'] != $requiredspell) $sql_query .= "requiredspell='$requiredspell',";
     3356                if ($item_templ['requiredhonorrank'] != $requiredhonorrank) $sql_query .= "requiredhonorrank='$requiredhonorrank',";
     3357                if ($item_templ['RequiredCityRank'] != $RequiredCityRank) $sql_query .= "RequiredCityRank='$RequiredCityRank',";
     3358                if ($item_templ['RequiredReputationFaction'] != $RequiredReputationFaction) $sql_query .= "RequiredReputationFaction='$RequiredReputationFaction',";
     3359                if ($item_templ['RequiredReputationRank'] != $RequiredReputationRank) $sql_query .= "RequiredReputationRank='$RequiredReputationRank',";
     3360                if ($item_templ['maxcount'] != $maxcount) $sql_query .= "maxcount='$maxcount',";
     3361                if ($item_templ['stackable'] != $stackable) $sql_query .= "stackable='$stackable',";
     3362                if ($item_templ['ContainerSlots'] != $ContainerSlots) $sql_query .= "ContainerSlots='$ContainerSlots',";
     3363                if ($item_templ['stat_type1'] != $stat_type1) $sql_query .= "stat_type1='$stat_type1',";
     3364                if ($item_templ['stat_value1'] != $stat_value1) $sql_query .= "stat_value1='$stat_value1',";
     3365                if ($item_templ['stat_type2'] != $stat_type2) $sql_query .= "stat_type2='$stat_type2',";
     3366                if ($item_templ['stat_value2'] != $stat_value2) $sql_query .= "stat_value2='$stat_value2',";
     3367                if ($item_templ['stat_type3'] != $stat_type3) $sql_query .= "stat_type3='$stat_type3',";
     3368                if ($item_templ['stat_value3'] != $stat_value3) $sql_query .= "stat_value3='$stat_value3',";
     3369                if ($item_templ['stat_type4'] != $stat_type4) $sql_query .= "stat_type4='$stat_type4',";
     3370                if ($item_templ['stat_value4'] != $stat_value4) $sql_query .= "stat_value4='$stat_value4',";
     3371                if ($item_templ['stat_type5'] != $stat_type5) $sql_query .= "stat_type5='$stat_type5',";
     3372                if ($item_templ['stat_value5'] != $stat_value5) $sql_query .= "stat_value5='$stat_value5',";
     3373                if ($item_templ['stat_type6'] != $stat_type6) $sql_query .= "stat_type6='$stat_type6',";
     3374                if ($item_templ['stat_value6'] != $stat_value6) $sql_query .= "stat_value6='$stat_value6',";
     3375                if ($item_templ['stat_type7'] != $stat_type7) $sql_query .= "stat_type7='$stat_type7',";
     3376                if ($item_templ['stat_value7'] != $stat_value7) $sql_query .= "stat_value7='$stat_value7',";
     3377                if ($item_templ['stat_type8'] != $stat_type8) $sql_query .= "stat_type8='$stat_type8',";
     3378                if ($item_templ['stat_value8'] != $stat_value8) $sql_query .= "stat_value8='$stat_value8',";
     3379                if ($item_templ['stat_type9'] != $stat_type9) $sql_query .= "stat_type9='$stat_type9',";
     3380                if ($item_templ['stat_value9'] != $stat_value9) $sql_query .= "stat_value9='$stat_value9',";
     3381                if ($item_templ['stat_type10'] != $stat_type10) $sql_query .= "stat_type10='$stat_type10',";
     3382                if ($item_templ['stat_value10'] != $stat_value10) $sql_query .= "stat_value10='$stat_value10',";
     3383                if ($item_templ['dmg_min1'] != $dmg_min1) $sql_query .= "dmg_min1='$dmg_min1',";
     3384                if ($item_templ['dmg_max1'] != $dmg_max1) $sql_query .= "dmg_max1='$dmg_max1',";
     3385                if ($item_templ['dmg_type1'] != $dmg_type1) $sql_query .= "dmg_type1='$dmg_type1',";
     3386                if ($item_templ['dmg_min2'] != $dmg_min2) $sql_query .= "dmg_min2='$dmg_min2',";
     3387                if ($item_templ['dmg_max2'] != $dmg_max2) $sql_query .= "dmg_max2='$dmg_max2',";
     3388                if ($item_templ['dmg_type2'] != $dmg_type2) $sql_query .= "dmg_type2='$dmg_type2',";
     3389                if ($item_templ['dmg_min3'] != $dmg_min3) $sql_query .= "dmg_min3='$dmg_min3',";
     3390                if ($item_templ['dmg_max3'] != $dmg_max3) $sql_query .= "dmg_max3='$dmg_max3',";
     3391                if ($item_templ['dmg_type3'] != $dmg_type3) $sql_query .= "dmg_type3='$dmg_type3',";
     3392                if ($item_templ['dmg_min4'] != $dmg_min4) $sql_query .= "dmg_min4='$dmg_min4',";
     3393                if ($item_templ['dmg_max4'] != $dmg_max4) $sql_query .= "dmg_max4='$dmg_max4',";
     3394                if ($item_templ['dmg_type4'] != $dmg_type4) $sql_query .= "dmg_type4='$dmg_type4',";
     3395                if ($item_templ['dmg_min5'] != $dmg_min5) $sql_query .= "dmg_min5='$dmg_min5',";
     3396                if ($item_templ['dmg_max5'] != $dmg_max5) $sql_query .= "dmg_max5='$dmg_max5',";
     3397                if ($item_templ['dmg_type5'] != $dmg_type5) $sql_query .= "dmg_type5='$dmg_type5',";
     3398                if ($item_templ['armor'] != $armor) $sql_query .= "armor='$armor',";
     3399                if ($item_templ['holy_res'] != $holy_res) $sql_query .= "holy_res='$holy_res',";
     3400                if ($item_templ['fire_res'] != $fire_res) $sql_query .= "fire_res='$fire_res',";
     3401                if ($item_templ['nature_res'] != $nature_res) $sql_query .= "nature_res='$nature_res',";
     3402                if ($item_templ['frost_res'] != $frost_res) $sql_query .= "frost_res='$frost_res',";
     3403                if ($item_templ['shadow_res'] != $shadow_res) $sql_query .= "shadow_res='$shadow_res',";               
     3404                if ($item_templ['arcane_res'] != $arcane_res) $sql_query .= "arcane_res='$arcane_res',";
     3405                if ($item_templ['delay'] != $delay) $sql_query .= "delay='$delay',";
     3406                if ($item_templ['ammo_type'] != $ammo_type) $sql_query .= "ammo_type='$ammo_type',";
     3407                if ($item_templ['RangedModRange'] != $RangedModRange) $sql_query .= "RangedModRange='$RangedModRange',";
     3408                if ($item_templ['spellid_1'] != $spellid_1) $sql_query .= "spellid_1='$spellid_1',";
     3409                if ($item_templ['spelltrigger_1'] != $spelltrigger_1) $sql_query .= "spelltrigger_1='$spelltrigger_1',";
     3410                if ($item_templ['spellcharges_1'] != $spellcharges_1) $sql_query .= "spellcharges_1='$spellcharges_1',";
     3411                if ($item_templ['spellcooldown_1'] != $spellcooldown_1) $sql_query .= "spellcooldown_1='$spellcooldown_1',";
     3412                if ($item_templ['spellcategory_1'] != $spellcategory_1) $sql_query .= "spellcategory_1='$spellcategory_1',";
     3413                if ($item_templ['spellcategorycooldown_1'] != $spellcategorycooldown_1) $sql_query .= "spellcategorycooldown_1='$spellcategorycooldown_1',";   
     3414                if ($item_templ['spellid_2'] != $spellid_2) $sql_query .= "spellid_2='$spellid_2',";   
     3415                if ($item_templ['spelltrigger_2'] != $spelltrigger_2) $sql_query .= "spelltrigger_2='$spelltrigger_2',";
     3416                if ($item_templ['spellcharges_2'] != $spellcharges_2) $sql_query .= "spellcharges_2='$spellcharges_2',";
     3417                if ($item_templ['spellcooldown_2'] != $spellcooldown_2) $sql_query .= "spellcooldown_2='$spellcooldown_2',";
     3418                if ($item_templ['spellcategory_2'] != $spellcategory_2) $sql_query .= "spellcategory_2='$spellcategory_2',";
     3419                if ($item_templ['spellcategorycooldown_2'] != $spellcategorycooldown_2) $sql_query .= "spellcategorycooldown_2='$spellcategorycooldown_2',";
     3420                if ($item_templ['spellid_3'] != $spellid_3) $sql_query .= "spellid_3='$spellid_3',";
     3421                if ($item_templ['spelltrigger_3'] != $spelltrigger_3) $sql_query .= "spelltrigger_3='$spelltrigger_3',";
     3422                if ($item_templ['spellcharges_3'] != $spellcharges_3) $sql_query .= "spellcharges_3='$spellcharges_3',";
     3423                if ($item_templ['spellcooldown_3'] != $spellcooldown_3) $sql_query .= "spellcooldown_3='$spellcooldown_3',";
     3424                if ($item_templ['spellcategory_3'] != $spellcategory_3) $sql_query .= "spellcategory_3='$spellcategory_3',";
     3425                if ($item_templ['spellcategorycooldown_3'] != $spellcategorycooldown_3) $sql_query .= "spellcategorycooldown_3='$spellcategorycooldown_3',";   
    34283426                if ($item_templ['spellid_4'] != $spellid_4) $sql .= "spellid_4='$spellid_4',";
    3429                 if ($item_templ['spelltrigger_4'] != $spelltrigger_4) $sql .= "spelltrigger_4='$spelltrigger_4',";
    3430                 if ($item_templ['spellcharges_4'] != $spellcharges_4) $sql .= "spellcharges_4='$spellcharges_4',";
    3431                 if ($item_templ['spellcooldown_4'] != $spellcooldown_4) $sql .= "spellcooldown_4='$spellcooldown_4',";
    3432                 if ($item_templ['spellcategory_4'] != $spellcategory_4) $sql .= "spellcategory_4='$spellcategory_4',";
    3433                 if ($item_templ['spellcategorycooldown_4'] != $spellcategorycooldown_4) $sql .= "spellcategorycooldown_4='$spellcategorycooldown_4', ";
    3434                 if ($item_templ['spellid_5'] != $spellid_5) $sql .= "spellid_5='$spellid_5',";
    3435                 if ($item_templ['spelltrigger_5'] != $spelltrigger_5) $sql .= "spelltrigger_5='$spelltrigger_5',";
    3436                 if ($item_templ['spellcharges_5'] != $spellcharges_5) $sql .= "spellcharges_5='$spellcharges_5',";
    3437                 if ($item_templ['spellcooldown_5'] != $spellcooldown_5) $sql .= "spellcooldown_5='$spellcooldown_5',";
    3438                 if ($item_templ['spellcategory_5'] != $spellcategory_5) $sql .= "spellcategory_5='$spellcategory_5',"; 
    3439                 if ($item_templ['spellcategorycooldown_5'] != $spellcategorycooldown_5) $sql .= "spellcategorycooldown_5='$spellcategorycooldown_5',";
    3440                 if ($item_templ['bonding'] != $bonding) $sql .= "bonding='$bonding',";
    3441                 if ($item_templ['description'] != $description) $sql .= "description='$description',";
    3442                 if ($item_templ['PageText'] != $PageText) $sql .= "PageText='$PageText',";
    3443                 if ($item_templ['LanguageID'] != $LanguageID) $sql .= "LanguageID='$LanguageID',";     
    3444                 if ($item_templ['PageMaterial'] != $PageMaterial) $sql .= "PageMaterial='$PageMaterial',";
    3445                 if ($item_templ['startquest'] != $startquest) $sql .= "startquest='$startquest',";
    3446                 if ($item_templ['lockid'] != $lockid) $sql .= "lockid='$lockid',";
    3447                 if ($item_templ['Material'] != $Material) $sql .= "Material='$Material',";
    3448                 if ($item_templ['sheath'] != $sheath) $sql .= "sheath='$sheath',";     
    3449                 if ($item_templ['RandomProperty'] != $RandomProperty) $sql .= "RandomProperty='$RandomProperty',";
    3450                 if ($item_templ['block'] != $block) $sql .= "block='$block',";
    3451                 if ($item_templ['itemset'] != $itemset) $sql .= "itemset='$itemset',";
    3452                 if ($item_templ['MaxDurability'] != $MaxDurability) $sql .= "MaxDurability='$MaxDurability',";
    3453                 if ($item_templ['area'] != $area) $sql .= "area='$area',";     
    3454                 if ($item_templ['BagFamily'] != $BagFamily) $sql .= "BagFamily='$BagFamily',";
    3455                 if ($item_templ['Map'] != $Map) $sql .= "Map='$Map',";
    3456                 if ($item_templ['ScriptName'] != $ScriptName) $sql .= "ScriptName='$ScriptName',";
    3457                 if ($item_templ['DisenchantID'] != $DisenchantID) $sql .= "DisenchantID='$DisenchantID',";
    3458                 if ($item_templ['RequiredDisenchantSkill'] != $RequiredDisenchantSkill) $sql .= "RequiredDisenchantSkill='$RequiredDisenchantSkill',";
    3459                 if ($item_templ['ArmorDamageModifier'] != $ArmorDamageModifier) $sql .= "ArmorDamageModifier='$ArmorDamageModifier',";
    3460                 if ($item_templ['unk0'] != $unk0) $sql .= "unk0='$unk0',";
    3461                 if ($item_templ['RandomSuffix'] != $RandomSuffix) $sql .= "RandomSuffix='$RandomSuffix',";
    3462                 if ($item_templ['TotemCategory'] != $TotemCategory) $sql .= "TotemCategory='$TotemCategory',";
    3463                 if ($item_templ['socketColor_1'] != $socketColor_1) $sql .= "socketColor_1='$socketColor_1',";
    3464                 if ($item_templ['socketContent_1'] != $socketContent_1) $sql .= "socketContent_1='$socketContent_1',";
    3465                 if ($item_templ['socketColor_2'] != $socketColor_2) $sql .= "socketColor_2='$socketColor_2',";
    3466                 if ($item_templ['socketContent_2'] != $socketContent_2) $sql .= "socketContent_2='$socketContent_2',";
    3467                 if ($item_templ['socketColor_3'] != $socketColor_3) $sql .= "socketColor_3='$socketColor_3',";
    3468                 if ($item_templ['socketContent_3'] != $socketContent_3) $sql .= "socketContent_3='$socketContent_3',";
    3469                 if ($item_templ['socketBonus'] != $socketBonus) $sql .= "socketBonus='$socketBonus',";
    3470                 if ($item_templ['GemProperties'] != $GemProperties) $sql .= "GemProperties='$GemProperties',";
    3471                 if ($item_templ['ExtendedCost'] != $ExtendedCost) $sql .= "ExtendedCost='$ExtendedCost',";
    3472 
    3473         $mysql->free_result($result);
     3427                if ($item_templ['spelltrigger_4'] != $spelltrigger_4) $sql_query .= "spelltrigger_4='$spelltrigger_4',";
     3428                if ($item_templ['spellcharges_4'] != $spellcharges_4) $sql_query .= "spellcharges_4='$spellcharges_4',";
     3429                if ($item_templ['spellcooldown_4'] != $spellcooldown_4) $sql_query .= "spellcooldown_4='$spellcooldown_4',";
     3430                if ($item_templ['spellcategory_4'] != $spellcategory_4) $sql_query .= "spellcategory_4='$spellcategory_4',";
     3431                if ($item_templ['spellcategorycooldown_4'] != $spellcategorycooldown_4) $sql_query .= "spellcategorycooldown_4='$spellcategorycooldown_4', ";
     3432                if ($item_templ['spellid_5'] != $spellid_5) $sql_query .= "spellid_5='$spellid_5',";
     3433                if ($item_templ['spelltrigger_5'] != $spelltrigger_5) $sql_query .= "spelltrigger_5='$spelltrigger_5',";
     3434                if ($item_templ['spellcharges_5'] != $spellcharges_5) $sql_query .= "spellcharges_5='$spellcharges_5',";
     3435                if ($item_templ['spellcooldown_5'] != $spellcooldown_5) $sql_query .= "spellcooldown_5='$spellcooldown_5',";
     3436                if ($item_templ['spellcategory_5'] != $spellcategory_5) $sql_query .= "spellcategory_5='$spellcategory_5',";   
     3437                if ($item_templ['spellcategorycooldown_5'] != $spellcategorycooldown_5) $sql_query .= "spellcategorycooldown_5='$spellcategorycooldown_5',";
     3438                if ($item_templ['bonding'] != $bonding) $sql_query .= "bonding='$bonding',";
     3439                if ($item_templ['description'] != $description) $sql_query .= "description='$description',";
     3440                if ($item_templ['PageText'] != $PageText) $sql_query .= "PageText='$PageText',";
     3441                if ($item_templ['LanguageID'] != $LanguageID) $sql_query .= "LanguageID='$LanguageID',";       
     3442                if ($item_templ['PageMaterial'] != $PageMaterial) $sql_query .= "PageMaterial='$PageMaterial',";
     3443                if ($item_templ['startquest'] != $startquest) $sql_query .= "startquest='$startquest',";
     3444                if ($item_templ['lockid'] != $lockid) $sql_query .= "lockid='$lockid',";
     3445                if ($item_templ['Material'] != $Material) $sql_query .= "Material='$Material',";
     3446                if ($item_templ['sheath'] != $sheath) $sql_query .= "sheath='$sheath',";       
     3447                if ($item_templ['RandomProperty'] != $RandomProperty) $sql_query .= "RandomProperty='$RandomProperty',";
     3448                if ($item_templ['block'] != $block) $sql_query .= "block='$block',";
     3449                if ($item_templ['itemset'] != $itemset) $sql_query .= "itemset='$itemset',";
     3450                if ($item_templ['MaxDurability'] != $MaxDurability) $sql_query .= "MaxDurability='$MaxDurability',";
     3451                if ($item_templ['area'] != $area) $sql_query .= "area='$area',";       
     3452                if ($item_templ['BagFamily'] != $BagFamily) $sql_query .= "BagFamily='$BagFamily',";
     3453                if ($item_templ['Map'] != $Map) $sql_query .= "Map='$Map',";
     3454                if ($item_templ['ScriptName'] != $ScriptName) $sql_query .= "ScriptName='$ScriptName',";
     3455                if ($item_templ['DisenchantID'] != $DisenchantID) $sql_query .= "DisenchantID='$DisenchantID',";
     3456                if ($item_templ['RequiredDisenchantSkill'] != $RequiredDisenchantSkill) $sql_query .= "RequiredDisenchantSkill='$RequiredDisenchantSkill',";
     3457                if ($item_templ['ArmorDamageModifier'] != $ArmorDamageModifier) $sql_query .= "ArmorDamageModifier='$ArmorDamageModifier',";
     3458                if ($item_templ['unk0'] != $unk0) $sql_query .= "unk0='$unk0',";
     3459                if ($item_templ['RandomSuffix'] != $RandomSuffix) $sql_query .= "RandomSuffix='$RandomSuffix',";
     3460                if ($item_templ['TotemCategory'] != $TotemCategory) $sql_query .= "TotemCategory='$TotemCategory',";
     3461                if ($item_templ['socketColor_1'] != $socketColor_1) $sql_query .= "socketColor_1='$socketColor_1',";
     3462                if ($item_templ['socketContent_1'] != $socketContent_1) $sql_query .= "socketContent_1='$socketContent_1',";
     3463                if ($item_templ['socketColor_2'] != $socketColor_2) $sql_query .= "socketColor_2='$socketColor_2',";
     3464                if ($item_templ['socketContent_2'] != $socketContent_2) $sql_query .= "socketContent_2='$socketContent_2',";
     3465                if ($item_templ['socketColor_3'] != $socketColor_3) $sql_query .= "socketColor_3='$socketColor_3',";
     3466                if ($item_templ['socketContent_3'] != $socketContent_3) $sql_query .= "socketContent_3='$socketContent_3',";
     3467                if ($item_templ['socketBonus'] != $socketBonus) $sql_query .= "socketBonus='$socketBonus',";
     3468                if ($item_templ['GemProperties'] != $GemProperties) $sql_query .= "GemProperties='$GemProperties',";
     3469                if ($item_templ['ExtendedCost'] != $ExtendedCost) $sql_query .= "ExtendedCost='$ExtendedCost',";
     3470
     3471        $sql->free_result($result);
    34743472        unset($item_templ);
    34753473
    3476                 if (($sql == "UPDATE item_template SET  ")&&(!$de_item)&&(!$del_de_items)){
    3477                 $mysql->close();
     3474                if (($sql_query == "UPDATE item_template SET  ")&&(!$de_item)&&(!$del_de_items)){
     3475                $sql->close();
    34783476                redirect("item.php?action=edit&entry=$entry&error=6");
    34793477                } else {
    3480                                 if ($sql != "UPDATE item_template SET  "){
    3481                                         $sql[strlen($sql)-1] = " ";
    3482                                         $sql .= " WHERE entry = '$entry';\n";
    3483                                         } else $sql = "";
     3478                                if ($sql_query != "UPDATE item_template SET  "){
     3479                                        $sql_query[strlen($sql_query)-1] = " ";
     3480                                        $sql_query .= " WHERE entry = '$entry';\n";
     3481                                        } else $sql_query = "";
    34843482                }
    34853483               
    34863484                if ($de_item){
    3487                         $sql .= "INSERT INTO disenchant_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     3485                        $sql_query .= "INSERT INTO disenchant_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    34883486                                        VALUES ($DisenchantID,$de_item,'$de_ChanceOrRef', '$de_QuestChanceOrGroup' ,$de_mincount ,$de_maxcount ,$de_quest_freeforall);\n";
    34893487                        }
     
    34913489                if ($del_de_items){
    34923490                        foreach($del_de_items as $item_id)
    3493                                 $sql .= "DELETE FROM disenchant_loot_template WHERE entry = $DisenchantID AND item = $item_id;\n";
     3491                                $sql_query .= "DELETE FROM disenchant_loot_template WHERE entry = $DisenchantID AND item = $item_id;\n";
    34943492                        }
    34953493
    34963494 } else {
    3497                 $mysql->close();
     3495                $sql->close();
    34983496                redirect("item.php?error=5");
    34993497                }
    35003498 } else {
    3501         $mysql->close();
     3499        $sql->close();
    35023500        redirect("item.php?error=5");
    35033501        }
    35043502
    35053503 if ( isset($_POST['backup_op']) && ($_POST['backup_op'] == 1) ){
    3506         $mysql->close();
     3504        $sql->close();
    35073505        Header("Content-type: application/octet-stream");
    35083506        Header("Content-Disposition: attachment; filename=itemid_$entry.sql");
    3509         echo $sql;
     3507        echo $sql_query;
    35103508        exit();
    35113509        } else {
    3512                 $sql = explode(';',$sql);
    3513                 foreach($sql as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $mysql->query($tmp_query);
    3514                 $mysql->close();
     3510                $sql_query = explode(';',$sql_query);
     3511                foreach($sql_query as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $sql->query($tmp_query);
     3512                $sql->close();
    35153513                }
    35163514
     
    35523550        else redirect("item.php?error=1");
    35533551
    3554  $mysql = new MySQL;
    3555  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    3556 
    3557  $result = $mysql->query("DELETE FROM item_template WHERE entry = '$entry'");
    3558 
    3559  $mysql->close();
     3552 $sql = new SQL;
     3553 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     3554
     3555 $result = $sql->query("DELETE FROM item_template WHERE entry = '$entry'");
     3556
     3557 $sql->close();
    35603558 redirect("item.php");
    35613559 }
  • minimanager/js/general.js

    r5 r19  
    1 function Menu(){ //thanks to :Project Seven Development
    2  if(navigator.appVersion.indexOf("MSIE")==-1){return;}
    3  var i,k,g,lg,r=/\s*hvr/,nn='',c,cs='hvr',bv='menubar';
    4  
    5  for(i=0;i<6;i++){
    6         g=document.getElementById(bv+nn);
    7         if(g){
    8                 lg=g.getElementsByTagName("LI");
    9                 if(lg){
    10                         for(k=0;k<lg.length;k++){
    11                                 lg[k].onmouseover=function(){
    12                                         c=this.className;cl=(c)?c+' '+cs:cs;
    13                                         this.className=cl;
    14                                 };
    15                                 lg[k].onmouseout=function(){
    16                                         c=this.className;
    17                                         this.className=(c)?c.replace(r,''):'';
    18                                 };
    19                         }
    20                 }
    21         }nn=i+1;
    22  }
    23 }
    24 
    251function do_submit (form_name,backup){
    262        if (form_name == 'form1') {
     
    317                else if (form_name == 'form2') document.form2.submit();
    328                        else document.form.submit();
     9}
     10
     11function showHide(id){
     12        var o, st;
     13        if( document.getElementById ) // Standart way
     14                o = document.getElementById(id);
     15        else if(document.all) // for old MSIE
     16                o = document.all[id];
     17        else if(document.layers) // for NN4
     18                o = document.layers[id];
     19        st = o.style;
     20        // if the style.display value is blank we try to figure it out here
     21        if(st.display == '' && o.offsetWidth != undefined && o.offsetHeight != undefined)
     22                st.display = (o.offsetWidth != 0 && o.offsetHeight != 0) ? 'block' : 'none';
     23        st.display = (st.display == '' || st.display == 'block') ? 'none' : 'block';
    3324}
    3425
     
    6051
    6152    if(DOM || IE) this.obj.innerHTML = t;
    62     if(DOM) this.height = this.obj.offsetHeight;
    63     else if(IE) this.height = this.obj.style.pixelHeight;
     53    if(DOM){
     54                this.width = this.obj.offsetWidth;
     55                this.height = this.obj.offsetHeight;
     56        } else if(IE){
     57                this.width = this.obj.style.pixelWidth;
     58                this.height = this.obj.style.pixelHeight;
     59        }
     60       
    6461
    6562    this.move();
     
    177174var mouseX = mouseY = 0;
    178175document.onmousemove = getMouseXY;
     176
     177function ANSWERBOX() {
     178  this.text = '';
     179  this.btn_ok = 'OK';
     180  this.btn_cancel = 'Cancel';
     181  this.classname = 'answerbox';
     182  this.btn_icon = 'img/warn_red.gif';
     183  this.height = 0;
     184  this.obj = null;
     185  this.active = false;
     186
     187  this.create = function(action) {
     188    if(!this.obj) this.init();
     189
     190    var t = '<table class="' + this.classname + '"><tr><th colspan=2>'+((this.btn_icon)?'<img src="'+ this.btn_icon +'" width="48" height="48" alt="" align="absmiddle" />':'')+ this.text +'</th></tr>'
     191                + '<tr align="center"><td><a class="button" style="width:120px;" href="' + action + '">' + this.btn_ok + '</a></td>'
     192                + '<td><a class="button" style="width:120px;" href="#" onclick="answerbox.hide()">' + this.btn_cancel + '</a></td></tr></table>';
     193
     194    if(DOM || IE) this.obj.innerHTML = t;
     195    if(DOM){
     196                this.width = this.obj.offsetWidth;
     197                this.height = this.obj.offsetHeight;
     198        } else if(IE){
     199                this.width = this.obj.style.pixelWidth;
     200                this.height = this.obj.style.pixelHeight;
     201        }
     202
     203    this.move();
     204        this.show();
     205  }
     206
     207  this.init = function() {
     208    if(DOM) this.obj = document.getElementById('AnswerBox');
     209    else if(IE) this.obj = document.all.AnswerBox;
     210  }
     211
     212  this.move = function() {
     213    var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0);
     214    var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0);
     215
     216    this.obj.style.left = (winX/2 + getScrX() - this.width/2 - 5) + 'px';
     217    this.obj.style.top = (winY/2 + getScrY() - this.height/2 - 5) + 'px';
     218  }
     219
     220  this.show = function() {
     221    this.obj.style.zIndex = 60;
     222    this.active = true;
     223    this.obj.style.visibility = 'visible';
     224  }
     225
     226  this.hide = function() {
     227    this.obj.style.zIndex = -1;
     228    this.active = false;
     229    this.obj.style.visibility = 'hidden';
     230  }
     231
     232}
     233
     234function answerBox(text, action) {
     235  if(text) {
     236    answerbox.text = text;
     237        answerbox.create(action);
     238  }
     239}
     240
     241document.write('<div id="AnswerBox" style="position:absolute; visibility:hidden"></div>');
     242answerbox = new ANSWERBOX();
     243answerbox.init();
  • minimanager/lang/deDE.php

    r5 r19  
    2828        'none' => 'nichts',
    2929        'delete' => 'l&ouml;schen',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Bearbeiten',
    3132        'yes' => 'JA',
     
    256257        'no_act_quests' => 'No active Quests Found.', //TODO: Translate
    257258        'quest_id' => 'ID', //TODO: Translate
     259        'quest_level' => 'lvl',
    258260        'quest_title' => 'Quest Title', //TODO: Translate
    259261        'professions' => 'Professions', //TODO
    260262        'skills' => 'Skills', //TODO
     263        'skill_id' => 'ID', //TODO
     264        'skill_name' => 'Skill Name', //TODO
     265        'skill_value' => 'Value', //TODO
     266        // --- $skill_rank_array ---
     267        'apprentice' => 'Apprentice', //TODO: Translate
     268        'journeyman' => 'Journeyman', //TODO: Translate
     269        'expert' => 'Expert', //TODO: Translate
     270        'artisan' => 'artisan', //TODO: Translate
     271        'master' => 'Master', //TODO: Translate
     272        'inherent' => 'Inherent', //TODO: Translate
     273        'wise' => 'Wise', //TODO: Translate
    261274        // ---- edit_char.php ----
    262275        'update' => 'Aktualisiere Charakterdaten',
     
    593606$lang_mail = array(
    594607        // ----- MAIL.PHP -----
    595         'mail_options_type' => 'Mail Optionen / Art',
     608        'mail_type' => 'Mail Type',
     609        'mail_options' => 'Mail Options',
    596610        'email' => 'Email',
    597611        'ingame_mail' => 'WoW-Post',
     
    631645$lang_run_patch = array(
    632646        // -----RUN_PATCH.PHP -----
    633         'err_in_line' => 'MySQL Syntaxfehler in Abfrage Nummer ',
     647        'err_in_line' => 'SQL Syntaxfehler in Abfrage Nummer ',
    634648        'run_sql_file_only' => 'Du kannst nur .sql oder .qbquery Dateien ausf&uuml;hren.',
    635649        'file_not_found' => 'Datei nicht gefunden!',
     
    13641378        'req_level_desc' => 'Character level required to learn this spell.',
    13651379        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1366         'search_results' => 'Search Results'
     1380        'search_results' => 'Search Results',
     1381        'RacialLeader' => 'Racial Leader',
     1382        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13671383        );
    13681384
     
    14891505        'total_auctions' => 'Total Auctions',
    14901506        'search_results' => 'Search Results',
    1491         'auction_over' => 'Auction Over'
     1507        'auction_over' => 'Auction Over',
     1508        'all' => 'All',
     1509        'item_id' => 'Item Id',
     1510        'item_name' => 'Item Name',
     1511        'seller_name' => 'Seller Name',
     1512        'buyer_name' => 'Buyer Name',
     1513        'tot_found' => 'Total Items Found'
    14921514);
    14931515
  • minimanager/lang/enUS.php

    r5 r19  
    2727        'home' => 'Home',
    2828        'none' => 'none',
    29         'delete' => 'Del.',
     29        'delete' => 'Delete',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Edit',
    3132        'yes' => 'YES',
     
    256257        'no_act_quests' => 'No active Quests Found.',
    257258        'quest_id' => 'ID',
     259        'quest_level' => 'lvl',
    258260        'quest_title' => 'Quest Title',
    259261        'professions' => 'Professions',
    260262        'skills' => 'Skills',
     263        'skill_id' => 'ID',
     264        'skill_name' => 'Skill Name',
     265        'skill_value' => 'Value',
     266        // --- $skill_rank_array ---
     267        'apprentice' => 'Apprentice',
     268        'journeyman' => 'Journeyman',
     269        'expert' => 'Expert',
     270        'artisan' => 'artisan',
     271        'master' => 'Master',
     272        'inherent' => 'Inherent',
     273        'wise' => 'Wise',
    261274        // ---- edit_char.php ----
    262275        'update' => 'Update Character\'s Data',
     
    591604$lang_mail = array(
    592605        // ----- MAIL.PHP -----
    593         'mail_options_type' => 'Mail Options / Type',
     606        'mail_type' => 'Mail Type',
     607        'mail_options' => 'Mail Options',
    594608        'email' => 'Email',
    595609        'ingame_mail' => 'InGame Mail',
     
    629643$lang_run_patch = array(
    630644        // -----RUN_PATCH.PHP -----
    631         'err_in_line' => 'MySQL syntax error in query number ',
     645        'err_in_line' => 'SQL syntax error in query number ',
    632646        'run_sql_file_only' => 'You may only run .sql or .qbquery files.',
    633647        'file_not_found' => 'File Not Found!',
     
    13601374        'req_level_desc' => 'Character level required to learn this spell.',
    13611375        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1362         'search_results' => 'Search Results'
     1376        'search_results' => 'Search Results',
     1377        'RacialLeader' => 'Racial Leader',
     1378        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13631379        );
    13641380
     
    14851501        'total_auctions' => 'Total Auctions',
    14861502        'search_results' => 'Search Results',
    1487         'auction_over' => 'Auction Over'
     1503        'auction_over' => 'Auction Over',
     1504        'all' => 'All',
     1505        'item_id' => 'Item Id',
     1506        'item_name' => 'Item Name',
     1507        'seller_name' => 'Seller Name',
     1508        'buyer_name' => 'Buyer Name',
     1509        'tot_found' => 'Total Items Found'
    14881510);
    14891511
  • minimanager/lang/esAR.php

    r5 r19  
    2929        'none' => 'ninguno',
    3030        'delete' => 'Borrar',
     31        'delete_short' => 'Del.',
    3132        'edit' => 'Editar',
    3233        'yes' => 'SI',
     
    105106        'name' => 'Nombre',
    106107        'race' => 'Raza',
    107         'class' => 'Profesión',
    108         'level' => 'Nivel',
    109         'map' => 'Mapa',
     108        'class' => 'Prof.',
     109        'level' => 'Nvl',
     110        'map' => 'Región',
    110111        'zone' => 'Zona',
    111         'honor_kills' => 'Honor'
     112        'honor_kills' => 'Kills'
    112113        );
    113114       
     
    248249        'chars_acc' => 'Ver Personajes',
    249250        'send_mail' =>'Enviar Correo',
    250         'del_char' => 'Eliminar este Personaje',
     251        'del_char' => 'Eliminar Personaje',
    251252        'no_char_found' => 'No posee personajes!',
    252253        'char_sheet' => 'Hoja de Personaje',
     
    257258        'no_act_quests' => 'No hay Misiones Activas.',
    258259        'quest_id' => 'ID',
    259         'quest_lvl' => 'Nvl',
     260        'quest_level' => 'Nvl',
    260261        'quest_title' => 'Título',
    261262        'professions' => 'Profesiones',
    262263        'skills' => 'Habilidades',
     264        'skill_id' => 'ID',
     265        'skill_name' => 'Nombre',
     266        'skill_value' => 'Valor',
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apendiz',
     269        'journeyman' => 'Especializado',
     270        'expert' => 'Experto',
     271        'artisan' => 'Artesano',
     272        'master' => 'Master',
     273        'inherent' => 'Innato',
     274        'wise' => 'Sabio',
    263275        // ---- edit_char.php ----
    264276        'update' => 'Actualizar Datos',
    265277        'edit_char' => 'Editar Datos',
    266278        'edit_button' => 'Editar Datos',
    267         'edit_rules' => 'The values are character\'s base status without the item/spell modifiers.', //TODO
     279        'edit_rules' => 'Los valores de las caracteristicas están sin los modificadores de los items y hechizos.',
    268280        'edit_offline_only_char' => ' - Solo los personajes No Conectados pueden ser editados.',
    269281        'no_permission' => 'Ud. no posee permisos para editar este personaje.',
     
    275287        'to_char_view' => 'Ver Personajes',
    276288        'inv_bank' => 'Inventario y Banco',
    277         'location' => 'Localización',
    278         'move_to' => 'Teletransportar a (igual que .tele)',
     289        'location' => 'Posición',
     290        'move_to' => 'Transportar a',
    279291        'no_tp_location' => 'No se encontró la localización del lugar provisto.' //TODO
    280292        );
     
    368380        'poor' => 'Pobre',
    369381        'common' => 'Común',
    370         'uncommon' => 'NoComún',
     382        'uncommon' => 'No Común',
    371383        'rare' => 'Raro',
    372384        'epic' => 'Epico',
     
    382394        'shield' => 'Escudo',
    383395        'buckler' => 'Buckler',
    384         'block' => 'Bloque',
     396        'block' => 'Bloqueo',
    385397        'none' => 'Ninguno',
    386398        'other' => 'Otro',
     
    394406        'arcane_dmg' => 'Arcano',
    395407        'physical_dmg' => 'Físico',
    396         'lvl_req' => 'Nivel Requerido',
     408        'lvl_req' => 'Nivel Req.',
    397409        'item_set' => 'Item Set',
    398410        'bag' => 'Bolsa',
     
    404416        'res_nature' => 'Res. a la Naturaleza',
    405417        'res_frost' => 'Res. al Frío',
    406         'res_shadow' => 'Res.a la Sombra',
     418        'res_shadow' => 'Res. a la Sombra',
    407419        'strength' => 'Fuerza',
    408420        'agility' => 'Agilidad',
     
    463475$lang_char_list = array(
    464476        // ----- CHAR_LIST.PHP -----
    465         'cleanup' =>'Depurar Datos',
    466         'by_name' => 'por Nombre',
    467         'by_id' => 'por Id',
    468         'by_account' => 'por Cuenta',
     477        'cleanup' =>'Depurar Bases',
     478        'by_name' => 'x Nombre',
     479        'by_id' => 'x Id',
     480        'by_account' => 'x Cuenta',
    469481        'by_level' => '= Nivel',
    470482        'greater_level' => '&lt; Nivel',
    471         'by_guild' => 'por Cofradía',
    472         'by_race_id' => 'por Id de Raza',
    473         'by_class_id' => 'por Id de Prof.',
    474         'by_map_id' => 'por Id de Mapa',
     483        'by_guild' => 'x Cofradía',
     484        'by_race_id' => 'x Id de Raza',
     485        'by_class_id' => 'x Id de Prof.',
     486        'by_map_id' => 'x Id de Mapa',
    475487        'by_honor_kills' => '= Honor',
    476488        'greater_honor_kills' => '&lt; Honor',
    477         'by_online' => 'por Conectado',
     489        'by_online' => 'x Conectado',
    478490        'id' => 'ID',
    479491        'char_name' => 'Nombre',
    480492        'account' => 'Usuario',
    481493        'race' => 'Raza',
    482         'class' => 'Profesión',
    483         'level' => 'Nivel',
     494        'class' => 'Prof.',
     495        'level' => 'Nvl',
    484496        'map' => 'Mapa',
    485497        'zone' => 'Zona',
    486         'honor_kills' => 'Honor',
     498        'honor_kills' => 'Kills',
    487499        'online' => 'Estado',
    488500        'del_selected_chars' => 'Eliminar Personaje(s) Marcado(s)',
     
    498510        'browse_chars' => 'Listar Personajes',
    499511        'chars_gold' => '&lt; Monedas (C)',
    500         'by_item' => 'por ID de Elemento'
     512        'by_item' => 'x ID de Elemento'
    501513        );
    502514       
     
    526538        'accs_deleted' => '¡Cuenta(s) Eliminada(s)!',
    527539        'chars_deleted' => '¡Personaje(s) Eliminado(s)!',
    528         'back_cleaning' => 'Vovler',
    529         'clean_db' => 'Depurar Datos'
     540        'back_cleaning' => 'Volver',
     541        'clean_db' => 'Depurar Bases'
    530542        );
    531543       
    532544$lang_edit = array(
    533545        // ----- EDIT.PHP -----
    534         'edit_acc' =>'Editar Tu Cuenta',
    535         'id' => 'ID',
     546        'edit_acc' =>'Editar Mi Cuenta',
     547        'id' => 'Id',
    536548        'username' => 'Usuario',
    537549        'password' => 'Contraseña',
    538         'mail' => 'E-Mail',
    539         'gm_level' => 'GMlevel',
     550        'mail' => 'Correo',
     551        'gm_level' => 'Tipo de Cuenta',
    540552        'join_date' => 'Unido el',
    541553        'characters' => 'Personajes',
     
    547559        'error_updating' => 'Error de Actualización! - Non of the fields changed?',
    548560        'del_error' => 'Error Inesperado de Eliminación.',
    549         'edit_your_acc' => 'Editar Tu Cuenta',
    550         'cms_options' => 'Opciones del CMS',
    551         'select_cms_template' => 'Seleccione un Tema',
     561        'edit_your_acc' => 'Editar Mi Cuenta',
     562        'cms_options' => 'Opciones de la Página',
     563        'select_cms_template' => 'Elegir Tema',
    552564        'template' => 'Tema',
    553         'select_cms_layout_lang' => 'Seleccione un Idioma',
     565        'select_cms_layout_lang' => 'Elegir Idioma',
    554566        'language' => 'Idioma',
    555567        'save' => 'Actualizar',
     
    557569        'classic' => 'Clásico',
    558570        'expansion' => 'Expansión',
    559         'tot_chars' => 'Total Characters'
     571        'tot_chars' => 'Personajes'
    560572        );
    561573       
    562574$lang_guild = array(
    563575        // ----- GUILD.PHP -----
    564         'by_name' =>'por Nombre',
    565         'by_guild_leader' => 'por Lider',
    566         'by_create_date' => 'por Fecha',
    567         'by_id' => 'por Id',
     576        'by_name' =>'x Nombre',
     577        'by_guild_leader' => 'x Lider',
     578        'by_create_date' => 'x Fecha',
     579        'by_id' => 'x Id',
    568580        'id' => 'Id',
    569581        'guild_name' => 'Nombre',
     
    579591        'info' => 'Info',
    580592        'motd' => 'Mensaje del Día',
    581         'level' => 'Nivel',
     593        'level' => 'Nvl',
    582594        'name' => 'Nombre',
    583595        'remove' => 'Borrar',
     
    593605$lang_mail = array(
    594606        // ----- MAIL.PHP -----
    595         'mail_options_type' => 'Opciones y Tipo de Correo',
     607        'mail_type' => 'Mail Type',
     608        'mail_options' => 'Mail Options',
    596609        'email' => 'E-Mail',
    597610        'ingame_mail' => 'Correo WoW',
     
    610623        'item' => 'Item (id)',
    611624        'stack' => 'Stack',
    612         'mail_body' => 'Texto del Mensaje',
     625        'mail_body' => 'Cuerpo del Mensaje',
    613626        'dont_use_both_groupsend_and_to' => '* Nota: Si utilizala opción \'Por Grupo\' , asegurese de dejar vacio el campo \'Destinatarios\'.',
    614627        'mail_sent' => 'Correo Enviado Satisfactoriamente.',
     
    631644$lang_run_patch = array(
    632645        // -----RUN_PATCH.PHP -----
    633         'err_in_line' => 'Error de Sintaxis MySQL en la sentencia Nº ',
     646        'err_in_line' => 'Error de Sintaxis SQL en la sentencia Nº ',
    634647        'run_sql_file_only' => 'Solo puede ejecutar archivos .sql o .qbquery.',
    635648        'file_not_found' => '¡Archivo No Encontrado!',
     
    660673        'icon' => 'Icono',
    661674        'color' => 'Color',
    662         'timezone' => 'Zona Horaria',
     675        'timezone' => 'Idioma',
    663676        'edit_realm' => 'Editar Datos',
    664         'id' => 'ID',
     677        'id' => 'Id',
    665678        'update' => 'Actualizar Datos',
    666679        'realm_id' => 'Id del Mundo',
     
    669682        'update_err' => '¡Error de Actualización de Datos!<br />¿No se modificaron los campos?',
    670683        'realm_data' => 'Datos del Mundo',
    671         'online' => 'Disponible',
    672         'tot_char' => 'Total de Personajes',
     684        'online' => 'Estado',
     685        'tot_char' => 'Personajes',
    673686        'delete' => 'Eliminar Mundo',
    674687        'normal' => 'Normal',
     
    680693        'french' => 'Frances',
    681694        'others' => 'Otros',
    682         'conf_from_file' => '** This realm appear not to have proper configuration in config.php file.<br />Make sure to properly configure it before using under CMS.',//TODO
     695        'conf_from_file' => '** Este Mundo no se encuentra correctamente configurado en el archivo config.php<br />Asegurese de verificar la configuración antes de continuar utilizando el MiniManager.',
    683696        'offline' => 'Desconectado',
    684697        'status' => 'Estado'
     
    687700$lang_ticket = array(
    688701        // ----- TICKET.PHP -----
    689         'id' =>'ID',
     702        'id' =>'Id',
    690703        'sender' => 'Remitente',
    691704        'ticket_text' => 'Texto del Ticket',
     
    725738        'cleanup' => 'Depurar Bases',
    726739        'backup' => 'Resguardos',
    727         'by_name' => 'por Nombre',
    728         'by_tbc' => 'por Cuenta TBC',
    729         'by_id' => 'por ID',
     740        'by_name' => 'x Nombre',
     741        'by_tbc' => 'x Cuenta TBC',
     742        'by_id' => 'x ID',
    730743        'by_gm_level' => '= Nivel GM',
    731744        'greater_gm_level' => '< Nivel GM',
    732         'by_email' => 'por Email',
    733         'by_join_date' => 'por Fecha de Unión',
    734         'by_ip' => 'por IP',
     745        'by_email' => 'x E-Mail',
     746        'by_join_date' => 'x Fecha de Unión',
     747        'by_ip' => 'x IP',
    735748        'by_failed_loggins' => '< Conexiones Fallidas',
    736         'by_last_login' => 'por Última Conexión',
    737         'by_online' => 'por Conectado',
    738         'by_banned' => 'por Suspendido',
    739         'by_locked' => 'por Bloqueado',
    740         'id' => 'ID',
     749        'by_last_login' => 'x Última Conexión',
     750        'by_online' => 'x Conectado',
     751        'by_banned' => 'x Suspendido',
     752        'by_locked' => 'x Bloqueado',
     753        'id' => 'Id',
    741754        'username' => 'Usuario',
    742755        'gm_level' => 'Tipo',
     
    751764        'del_selected_users' => 'Eliminar Seleccionados',
    752765        'backup_selected_users' => 'Resguardar Seleccionados',
    753         'acc_backedup' => 'Resguardo de Cuentas Realizadas Satisfactoriamente',
     766        'acc_backedup' => 'Resguardo de cuentas Realizadas Satisfactoriamente',
    754767        'tot_acc' => 'Total de Cuentas',
    755768        'user_list' => 'Lista de Usuarios',
     
    797810        'srv_statistics' => 'Estadisticas del Servidor',
    798811        'general_info' => 'Información General',
    799         'tot_accounts' => 'Total de Cuentas',
    800         'total_of' => 'Hay un total de',
    801         'gms_one_for' => 'GMs, Uno por cada',
    802         'players' => 'Jugadores',
    803         'tot_chars_on_realm' => 'Total de Personajes',
    804         'average_of' => 'Un promedio de',
    805         'chars_per_acc' => 'Personajes por Cuenta',
     812        'tot_accounts' => '</b>Total de Cuentas<b>',
     813        'total_of' => '</b>Hay un total de <b>',
     814        'gms_one_for' => '</b>GMs, uno por cada <b>',
     815        'players' => '</b>jugadores',
     816        'tot_chars_on_realm' => 'Total de Personajes<b>',
     817        'average_of' => '</b>Un promedio de<b>',
     818        'chars_per_acc' => '</b>personajes por cuenta',
    806819        'horde' => 'Horda',
    807820        'alliance' => 'Alianza',
    808         'chars_by_race' => 'Personajes por Raza',
    809         'chars_by_class' => 'Personajes por Profesión',
    810         'chars_by_level' => 'Niveles de Personajes',
    811         'reset' => 'Refescar',
    812         'avg_uptime' => 'Tiempo en linea Promedio del Servidor',
    813         'max_uptime' => 'Tiempo en linea Máximo del Servidor',
    814         'uptime_prec' => ' Uptime percentage since first run'
     821        'chars_by_race' => 'Promedio de Razas',
     822        'chars_by_class' => 'Promedio de Profesiones',
     823        'chars_by_level' => 'Promedio de Niveles',
     824        'reset' => 'Actualizar',
     825        'avg_uptime' => '</b>Tiempo Promedio en linea del Servidor<b>',
     826        'max_uptime' => '</b>Tiempo Máximo en linea del Servidor<b>',
     827        'uptime_prec' => '</b>Porcentaje promedio en linea del Servidor<b>'
    815828);
    816829
     
    10861099        'drop_chance' => 'Drop Chance',
    10871100        'quest_drop_chance' => 'Quest Drop Chance',
    1088         'quest_freeforall' => 'Quest free for all'
     1101        'quest_freeforall' => 'Quest free for all',
    10891102        'armor_dmg_mod' => 'Armor Damage Modifier',
    10901103        'armor_dmg_mod_desc' => 'TODO:'
     
    13631376        'req_level_desc' => 'Character level required to learn this spell.',
    13641377        'check_to_delete' => '* Check checkbox next to item to delete.',
    1365         'search_results' => 'Search Results'
     1378        'search_results' => 'Search Results',
     1379        'RacialLeader' => 'Racial Leader',
     1380        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13661381        );
    13671382
     
    14881503        'total_auctions' => 'Total de Subastas',
    14891504        'search_results' => 'Resultado',
    1490         'auction_over' => 'Subastar'
     1505        'auction_over' => 'Subastar',
     1506        //todo
     1507        'all' => 'All',
     1508        'item_id' => 'Item Id',
     1509        'item_name' => 'Item Name',
     1510        'seller_name' => 'Seller Name',
     1511        'buyer_name' => 'Buyer Name',
     1512        'tot_found' => 'Total Items Found'
    14911513);
    14921514
     
    15651587        'zulaman' => 'Zul\'Aman',
    15661588        //---class/race---
    1567         'unknown' => 'Unknown',
     1589        'unknown' => 'Desconocido',
    15681590        'warrior' => 'Guerrero',
    15691591        'paladin' => 'Paladín',
  • minimanager/lang/frBE.php

    r5 r19  
    2828        'none' => 'aucun',
    2929        'delete' => 'Suppr.',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Editer',
    3132        'yes' => 'OUI',
     
    257258        'no_act_quests' => 'No active Quests Found.', //TODO: Translate
    258259        'quest_id' => 'ID', //TODO: Translate
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Quest Title', //TODO: Translate
    260262        'professions' => 'Professions', //TODO
    261263        'skills' => 'Skills', //TODO
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Sauvegarder',
     
    593606$lang_mail = array(
    594607        // ----- MAIL.PHP -----
    595         'mail_options_type' => 'Options / types d\'email',
     608        'mail_type' => 'Mail Type',
     609        'mail_options' => 'Mail Options',
    596610        'email' => 'Email',
    597611        'ingame_mail' => 'Mail dans le jeu',
     
    13641378        'req_level_desc' => 'Character level required to learn this spell.',
    13651379        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1366         'search_results' => 'Search Results'
     1380        'search_results' => 'Search Results',
     1381        'RacialLeader' => 'Racial Leader',
     1382        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13671383        );
    13681384
     
    14891505        'total_auctions' => 'Total Auctions',
    14901506        'search_results' => 'Search Results',
    1491         'auction_over' => 'Auction Over'
     1507        'auction_over' => 'Auction Over',
     1508        'all' => 'All',
     1509        'item_id' => 'Item Id',
     1510        'item_name' => 'Item Name',
     1511        'seller_name' => 'Seller Name',
     1512        'buyer_name' => 'Buyer Name',
     1513        'tot_found' => 'Total Items Found'
    14921514);
    14931515
  • minimanager/lang/frFR.php

    r5 r19  
    2929        'none' => 'aucun',
    3030        'delete' => 'Suppr.',
     31        'delete_short' => 'Del.',
    3132        'edit' => 'Editer',
    3233        'yes' => 'OUI',
     
    256257        'quests' => 'Quêtes',
    257258        'no_act_quests' => 'Aucune quête active.',
    258         'quest_id' => 'ID',
     259        'quest_id' => 'ID',
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Titre de Quête',
    260262        'professions' => 'Professions',
    261263        'skills' => 'Talents',
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Mise à jour',
     
    591604$lang_mail = array(
    592605        // ----- MAIL.PHP -----
    593         'mail_options_type' => 'Options / types d\'email',
     606        'mail_type' => 'Mail Type',
     607        'mail_options' => 'Mail Options',
    594608        'email' => 'Email',
    595609        'ingame_mail' => 'Mail dans le jeu',
     
    13601374        'req_level' => 'Req. Level',
    13611375        'req_level_desc' => 'Niveau de personnage requis pour apprendre ce sort.',
    1362         'check_to_delete' => '* Cocher la case à côté de l\'item pour enlever du modèle.'
     1376        'check_to_delete' => '* Cocher la case à côté de l\'item pour enlever du modèle.',
     1377        'search_results' => 'Search Results',
     1378        'RacialLeader' => 'Racial Leader',
     1379        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13631380        );
    13641381
     
    14881505        'total_auctions' => 'Total Auctions',
    14891506        'search_results' => 'Search Results',
    1490         'auction_over' => 'Auction Over'
     1507        'auction_over' => 'Auction Over',
     1508        'all' => 'All',
     1509        'item_id' => 'Item Id',
     1510        'item_name' => 'Item Name',
     1511        'seller_name' => 'Seller Name',
     1512        'buyer_name' => 'Buyer Name',
     1513        'tot_found' => 'Total Items Found'
    14911514);
    14921515
  • minimanager/lang/hrHR.php

    r5 r19  
    3131        'none' => 'ništa',
    3232        'delete' => 'Obriši',
     33        'delete_short' => 'Del.',
    3334        'edit' => 'Izmjeni',
    3435        'yes' => 'DA',
     
    259260        'no_act_quests' => 'No active Quests Found.',
    260261        'quest_id' => 'ID',
     262        'quest_level' => 'lvl',
    261263        'quest_title' => 'Naslov Questova',
    262264        'professions' => 'Profesije',
    263265        'skills' => 'Skilovi',
     266        'skill_id' => 'ID', //TODO
     267        'skill_name' => 'Skill Name', //TODO
     268        'skill_value' => 'Value', //TODO
     269        // --- $skill_rank_array ---
     270        'apprentice' => 'Apprentice', //TODO: Translate
     271        'journeyman' => 'Journeyman', //TODO: Translate
     272        'expert' => 'Expert', //TODO: Translate
     273        'artisan' => 'artisan', //TODO: Translate
     274        'master' => 'Master', //TODO: Translate
     275        'inherent' => 'Inherent', //TODO: Translate
     276        'wise' => 'Wise', //TODO: Translate
    264277        // ---- edit_char.php ----
    265278        'update' => 'Izmjeni podatke lika',
     
    594607$lang_mail = array(
    595608        // ----- MAIL.PHP -----
    596         'mail_options_type' => 'Mail Options / Type',
     609        'mail_type' => 'Mail Type',
     610        'mail_options' => 'Mail Options',
    597611        'email' => 'Email',
    598612        'ingame_mail' => 'InGame Mail',
     
    632646$lang_run_patch = array(
    633647        // -----RUN_PATCH.PHP -----
    634         'err_in_line' => 'MySQL syntax error in query number ',
     648        'err_in_line' => 'SQL syntax error in query number ',
    635649        'run_sql_file_only' => 'You may only run .sql or .qbquery files.',
    636650        'file_not_found' => 'File Not Found!',
     
    13621376        'req_level_desc' => 'Character level required to learn this spell.',
    13631377        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1364         'search_results' => 'Search Results'
     1378        'search_results' => 'Search Results',
     1379        'RacialLeader' => 'Racial Leader',
     1380        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13651381        );
    13661382
     
    14871503        'total_auctions' => 'Total Auctions',
    14881504        'search_results' => 'Search Results',
    1489         'auction_over' => 'Auction Over'
     1505        'auction_over' => 'Auction Over',
     1506        'all' => 'All',
     1507        'item_id' => 'Item Id',
     1508        'item_name' => 'Item Name',
     1509        'seller_name' => 'Seller Name',
     1510        'buyer_name' => 'Buyer Name',
     1511        'tot_found' => 'Total Items Found'
    14901512);
    14911513
  • minimanager/lang/noBM.php

    r5 r19  
    2828        'none' => 'ingen',
    2929        'delete' => 'Slett',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Endre',
    3132        'yes' => 'JA',
     
    256257        'quests' => 'Oppdrag',
    257258        'no_act_quests' => 'Ingen aktive oppdrag funnet.',
    258         'quest_id' => 'ID',
     259        'quest_id' => 'ID',
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Oppdrags navn',
    260262        'professions' => 'Professions', //TODO
    261263        'skills' => 'Skills', //TODO
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Oppdater person data',
     
    591604$lang_mail = array(
    592605        // ----- MAIL.PHP -----
    593         'mail_options_type' => 'E-post innstillinger / Type',
     606        'mail_type' => 'Mail Type',
     607        'mail_options' => 'Mail Options',
    594608        'email' => 'E-post',
    595609        'ingame_mail' => 'InGame Mail',
     
    629643$lang_run_patch = array(
    630644        // -----RUN_PATCH.PHP -----
    631         'err_in_line' => 'MySQL syntax fil i forespørsel nummer ',
     645        'err_in_line' => 'SQL syntax fil i forespørsel nummer ',
    632646        'run_sql_file_only' => 'Du kan kun kjøre .sql eller .qbquery filer.',
    633647        'file_not_found' => 'Fil ikke funnet!',
     
    10901104        'armor_dmg_mod' => 'Armor Damage Modifier',
    10911105        'armor_dmg_mod_desc' => 'TODO:'
    1092 );
    1093 
    1094 $lang_game_object = array( //TODO:
    1095         // ----- GAME_OBJECT.PHP -----
    1096         'unknown' => 'Unknown',
    1097         'custom_search' => 'Custom Filter',
    1098         'search' => '+ Search +',
    1099         'add_new' => 'Add New',
    1100         'tot_go_templ' => 'Total Game Object Templates',
    1101         'search_template' => 'Search Game Object Template',
    1102         'select' => 'Select',
    1103         'new_search' => 'New Search',
    1104         'tot_found' => 'Total Templates Found',
    1105         'add_new_go_templ' => 'Add New Game Object Template',
    1106         'edit_go_templ' => 'Edit Game Object Template',
    1107         'err_adding_new' => 'Error Adding New Game Object Template',
    1108         'err_no_fields_updated' => 'Error: No Fields Updated',
    1109         'search_go' => 'Search Game Objects',
    1110         'general' => 'General',
    1111         'sounds' => 'Additional Sounds',
    1112         'save_to_db' => 'Save to DB',
    1113         'save_to_script' => 'Save to Script',
    1114         'lookup_go' => 'Lookup GO',
    1115         'DOOR' => 'DOOR',
    1116         'BUTTON' => 'BUTTON',
    1117         'QUESTGIVER' => 'QUESTGIVER',
    1118         'CHEST' => 'CHEST',
    1119         'BINDER' => 'BINDER',
    1120         'GENERIC' => 'GENERIC',
    1121         'TRAP' => 'TRAP',
    1122         'CHAIR' => 'CHAIR',
    1123         'SPELL_FOCUS' => 'SPELL_FOCUS',
    1124         'TEXT' => 'TEXT',
    1125         'GOOBER' => 'GOOBER',
    1126         'TRANSPORT' => 'TRANSPORT',
    1127         'AREADAMAGE' => 'AREADAMAGE',
    1128         'CAMERA' => 'CAMERA',
    1129         'MAP_OBJECT' => 'MAP_OBJECT',
    1130         'MO_TRANSPORT' => 'MO_TRANSPORT',
    1131         'DUEL_FLAG' => 'DUEL_FLAG',
    1132         'FISHING_BOBBER' => 'FISHING_BOBBER',
    1133         'RITUAL' => 'RITUAL',
    1134         'MAILBOX' => 'MAILBOX',
    1135         'AUCTIONHOUSE' => 'AUCTIONHOUSE',
    1136         'GUARDPOST' => 'GUARDPOST',
    1137         'SPELLCASTER' => 'SPELLCASTER',
    1138         'MEETING_STONE' => 'MEETING_STONE',
    1139         'BG_Flag' => 'BG_Flag',
    1140         'FISHING_HOLE' => 'FISHING_HOLE',
    1141         'FLAGDROP' => 'FLAGDROP',
    1142         'CUSTOM_TELEPORTER' => 'CUSTOM_TELEPORTER',
    1143         'LOTTERY_KIOSK' => 'LOTTERY_KIOSK',
    1144         'CAPTURE_POINT' => 'CAPTURE_POINT',
    1145         'AURA_GENERATOR' => 'AURA_GENERATOR',
    1146         'DUNGEON_DIFFICULTY' => 'DUNGEON_DIFFICULTY',
    1147         'general' => 'General',
    1148         'name' => 'Name',
    1149         'name_desc' => 'Object\'s name.',
    1150         'entry' => 'Entry',
    1151         'entry_desc' => 'Unique GO identifier value',
    1152         'displayId' => 'Display Id',
    1153         'displayId_desc' => 'Graphic model\'s id sent to the client.',
    1154         'faction' => 'Faction',
    1155         'faction_desc' => 'Object\'s faction, if any.',
    1156         'flags' => 'Flags',
    1157         'flags_desc' => 'TODO:',
    1158         'type' => 'Type',
    1159         'type_desc' => 'Game Object\'s type',
    1160         'script_name' => 'ScriptName',
    1161         'ScriptName_desc' => 'Script\'s name GO uses.',
    1162         'size' => 'Size',
    1163         'size_desc' => 'Object\'s size must be set because graphic models can be resample.',
    1164         'sound' => 'Sound',
    1165         'sound_desc' => 'Data fields specific for different type field values. Each type has unique fields.<br />For more informaton visit https://svn.mangosproject.org/trac/MaNGOS/wiki/Database/gameobject_template',
    1166         'tmpl_not_found' => 'Template not Found',
    1167         'del_go' => 'Delete GO',
    1168         'del_spawns' => 'Delete Spawns',
    1169         'loot' => 'Loot',
    1170         'quests' => 'Quests',
    1171         'loot_tmpl_id' => 'Loot Template',
    1172         'drop_chance' => 'Drop Chance',
    1173         'quest_drop_chance' => 'Quest Drop Chance',
    1174         'quest_freeforall' => 'Quest Free for All',
    1175         'add_items_to_templ' => 'Add Items to Template',
    1176         'loot_item_id' => 'Loot template ID',
    1177         'loot_item_id_desc' => 'ID of the item you wish to be added.',
    1178         'loot_drop_chance' => 'Drop Chance',
    1179         'loot_drop_chance_desc' => 'Item Drop chance',
    1180         'loot_quest_drop_chance' => 'Quest Drop Chance',
    1181         'loot_quest_drop_chance_desc' => 'Quest Drop chance',
    1182         'min_count' => 'Min. Count',
    1183         'min_count_desc' => 'Minimum number of stack size on drop.',
    1184         'max_count' => 'Max. Count',
    1185         'max_count_desc' => 'Maximum number of stack size on drop.',
    1186         'quest_loot' => 'Quest Loot Flag',
    1187         'quest_loot_desc' => 'Quest Free for all loot flag.',
    1188         'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1189         'add_starts_quests' => 'Add Quest starts by this GO',
    1190         'quest_id' => 'Quest ID',
    1191         'quest_id_desc' => 'ID of the quest.',
    1192         'start_quests' => 'Start Quests',
    1193         'ends_quests' => 'Ends Quests',
    1194         'add_ends_quests' => 'Add Quest ends by this GO',
    1195         'go_swapned' => 'This Game Object spawned total of',
    1196         'times' => 'times',
    1197         'go_template' => 'Game Object Template',
    1198         'all_related_data' => 'Along with all related data.'
    11991106);
    12001107
     
    14711378        'req_level_desc' => 'Character level required to learn this spell.',
    14721379        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1473         'search_results' => 'Search Results'
     1380        'search_results' => 'Search Results',
     1381        'RacialLeader' => 'Racial Leader',
     1382        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    14741383        );
    14751384
     
    15961505        'total_auctions' => 'Total Auctions',
    15971506        'search_results' => 'Search Results',
    1598         'auction_over' => 'Auction Over'
     1507        'auction_over' => 'Auction Over',
     1508        'all' => 'All',
     1509        'item_id' => 'Item Id',
     1510        'item_name' => 'Item Name',
     1511        'seller_name' => 'Seller Name',
     1512        'buyer_name' => 'Buyer Name',
     1513        'tot_found' => 'Total Items Found'
    15991514);
    16001515
  • minimanager/lang/ptBR.php

    r5 r19  
    2828        'none' => 'nada',
    2929        'delete' => 'Del.',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Edit',
    3132        'yes' => 'SIM',
     
    257258        'no_act_quests' => 'No active Quests Found.', //TODO: Translate
    258259        'quest_id' => 'ID', //TODO: Translate
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Quest Title', //TODO: Translate
    260262        'professions' => 'Professions', //TODO
    261263        'skills' => 'Skills', //TODO
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Update Char Informacao',
     
    594607$lang_mail = array(
    595608        // ----- MAIL.PHP -----
    596         'mail_options_type' => 'Opcao de email / Tipo',
     609        'mail_type' => 'Mail Type',
     610        'mail_options' => 'Mail Options',
    597611        'email' => 'Email',
    598612        'ingame_mail' => 'InGame Mail',
     
    632646$lang_run_patch = array(
    633647        // -----RUN_PATCH.PHP -----
    634         'err_in_line' => 'MySQL syntax error na query numero ',
     648        'err_in_line' => 'SQL syntax error na query numero ',
    635649        'run_sql_file_only' => 'Voce so pode rodar .sql ou .qbquery arquivos.',
    636650        'file_not_found' => 'Arquivo nao encontrado!!!!',
     
    13671381        'req_level_desc' => 'Character level required to learn this spell.',
    13681382        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1369         'search_results' => 'Search Results'
     1383        'search_results' => 'Search Results',
     1384        'RacialLeader' => 'Racial Leader',
     1385        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13701386        );
    13711387
     
    14921508        'total_auctions' => 'Total Auctions',
    14931509        'search_results' => 'Search Results',
    1494         'auction_over' => 'Auction Over'
     1510        'auction_over' => 'Auction Over',
     1511        'all' => 'All',
     1512        'item_id' => 'Item Id',
     1513        'item_name' => 'Item Name',
     1514        'seller_name' => 'Seller Name',
     1515        'buyer_name' => 'Buyer Name',
     1516        'tot_found' => 'Total Items Found'
    14951517);
    14961518
  • minimanager/lang/ruRU.php

    r5 r19  
    22/*
    33 * Project Name: Russian Translate for MiniManager for Mangos Server
    4  * Date: 11.07.2007 version 0.0.8e
     4 * Date: 30.07.2007 version 0.0.8h
    55 * Author: Den Wailhorn
    66 * Copyright: Catarina WoW Server
     
    2828        'none' => 'íåò',
    2929        'delete' => 'Óäàëèòü',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Ïðàâèòü',
    3132        'yes' => 'ÄÀ!',
     
    7980        'acc_type' => 'Òèï àêêàóíòà',
    8081        'acc_type_desc' => 'Òèï èñïîëüçóåìîãî êëèåíòà',
    81         'classic' => 'World of Warcraft',
    82         'expansion' => 'WoW - The Burning Crusade',
     82        'classic' => 'Ìèð Âîåííîãî Ðåìåñëà',
     83        'expansion' => 'Ïûëàþùèé Êðåñòîâûé Ïîõîä',
    8384        'recover_acc_password' => 'Âîññòàíîâèòü ïàðîëü àêêàóíòà',
    8485        'user_pass_rec_desc' => 'Ââåäèòå èìÿ ïîä êîòîðûì âû çàðåãèñòðèðîâàíû',
     
    257258        'no_act_quests' => 'Íåò àêòèâíûõ êâåñòîâ',
    258259        'quest_id' => 'ID',
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Íàçâàíèå êâåñòà',
    260262        'professions' => 'Ïðîôåññèè',
    261263        'skills' => 'Íàâûêè',
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Îáíîâèòü äàííûå ïåðñà',
     
    274287        'to_char_view' => 'Âåðíóòüñÿ ê ïðîñìîòðó ïåðñà',
    275288        'inv_bank' => 'Ñíàðÿãà è âåùè â áàíêå',
    276         'location' => 'Location', //TODO
    277         'move_to' => 'Teleport to (.tele location name)', //TODO
    278         'no_tp_location' => 'No teleport location found using provided name.' //TODO
     289        'location' => 'Ëîêàöèÿ',
     290        'move_to' => 'Òåëåïîðò â (.tele íàçâàíèå ëîêàöèè)',
     291        'no_tp_location' => 'Íå íàéäåíî ëîêàöèé òåëåïîðòà â äàííîå ìåñòî'
    279292        );
    280293       
     
    331344        'thrown' => 'Ìåòàòåëüíîå',
    332345        'consumable' => 'Ñîçäàííîå',
    333         'arrows' => 'Ïðîáèâíîå - Ñòðåëû',
    334         'bullets' => 'Ïðîáèâíîå - Ïóëè',
    335         'projectile' => 'Ïðîáèâíîå',
     346        'arrows' => 'Ñíàðÿäû - Ñòðåëû',
     347        'bullets' => 'Ñíàðÿäû - Ïóëè',
     348        'projectile' => 'Ñíàðÿäû',
    336349        'trade_goods' => 'Òîâàð',
    337350        'parts' => '×àñòè',
     
    491504        'tot_found' => 'Âñåãî íàéäåíî',
    492505        'char_ids' => 'Ïåðñîíàæè id',
    493         'no_chars_del' => 'Íèêòî íå óäàëåí!</br>Íåò ðàçðåøåíèÿ?',
     506        'no_chars_del' => 'Íèêòî íå óäàëåí!<br>Íåò ðàçðåøåíèÿ?',
    494507        'total' => 'Âñåãî',
    495508        'chars_deleted' => 'Ïåðñîíàæè óäàëåíû!',
     
    592605$lang_mail = array(
    593606        // ----- MAIL.PHP -----
    594         'mail_options_type' => ' - | - Íàñòðîéêè ïî÷òû - | - ',
     607        'mail_type' => 'Mail Type',
     608        'mail_options' => 'Mail Options',
    595609        'email' => 'Ïî÷òà',
    596610        'ingame_mail' => 'Ïî÷òà â èãðå',
     
    829843        'chars_by_level' => 'Ïåðñîíàæè ïî óðîâíþ',
    830844        'reset' => 'Ñáðîñèòü ôèëüòðû',
    831         'avg_uptime' => 'Average Server Uptime', //TODO
    832         'max_uptime' => 'Maximum Server Uptime',
    833         'uptime_prec' => ' Uptime percentage since first run'
     845        'avg_uptime' => 'Ñåðâåð â ñðåäíåì äîñòóïåí',
     846        'max_uptime' => 'Ìàêñèìóì ñåðâåð äîñòóïåí',
     847        'uptime_prec' => ' ñ ïåðâîãî çàïóñêà ñåðâåð äîñòóïåí'
    834848);
    835849
     
    878892$lang_item_edit = array(
    879893        // ----- ITEM.PHP -----
    880         'search_item' => 'Search for Item(s)',
     894        'search_item' => 'Ïîèñê âåùåé',
    881895        'model_id' => 'Íîìåð ìîäåëè',
    882896        'all' => 'Âñå',
     
    897911        'del_item' => 'Óäàëèòü',
    898912        'general_tab' => 'Îáùèå',
    899         'additional_tab' => 'Extra',
     913        'additional_tab' => 'Äîïîëíèòåëüíî',
    900914        'stats_tab' => 'Ñòàòèñòèêà',
    901915        'damage_tab' => 'Óùåðá',
    902916        'spell_tab' => 'Ìàãèÿ',
    903         'req_tab' => 'Req.',
     917        'req_tab' => 'Òðåáîâàíèÿ',
    904918        'general' => 'Îáùèå',
    905919        'entry' => 'Çàïèñü',
     
    10191033        'spell_id' => 'Ìàãèÿ',
    10201034        'spell_id_desc' => 'Íîìåð çàêëèíàíèÿ ïî Spell.dbc',
    1021         'spell_trigger' => 'Òðèããåð ñïåëà',
     1035        'spell_trigger' => 'Òðèããåð çàêëà',
    10221036        'spell_trigger_desc' => 'Äåéñòâèå ïî êîòîðîìó çàêëèíàíèå ñðàáàòûâàåò',
    1023         'spell_charges' => 'Çàðÿäû ñïåëà',
     1037        'spell_charges' => 'Çàðÿäû çàêëà',
    10241038        'spell_charges_desc' => 'Ñêîëüêî çàðÿäîâ ó çàêëèíàíèÿ. 0: áåñêîíå÷íî, -X: item is expendable, +X: item is kept when all charges are spent).',
    1025         'spell_cooldown' => 'Ïåðåçàðÿäêà ñïåëà',
    1026         'spell_cooldown_desc' => 'Ïåðåçàðÿäêà ñïåëà â ìñ',
    1027         'spell_category' => 'Êàòåãîðèÿ ñïåëà',
    1028         'spell_category_desc' => 'Êàòåãîðèÿ ñïåëà',
     1039        'spell_cooldown' => 'Ïåðåçàðÿäêà çàêëà',
     1040        'spell_cooldown_desc' => 'Ïåðåçàðÿäêà çàêëà â ìñ',
     1041        'spell_category' => 'Êàòåãîðèÿ çàêëà',
     1042        'spell_category_desc' => 'Êàòåãîðèÿ çàêëà',
    10291043        'spell_category_cooldown' => 'Ïåðåçàðÿäêà êàòåãîðèè',
    1030         'spell_category_cooldown_desc' => 'Îáùàÿ ïåðåçàðÿäêà ïî âñåé êàòåãîðèè ñïåëîâ',
     1044        'spell_category_cooldown_desc' => 'Îáùàÿ ïåðåçàðÿäêà ïî âñåé êàòåãîðèè çàêëîâ',
    10311045        'allow_class' => 'Äîñòóïíî êëàññàì',
    10321046        'allow_class_desc' => 'Êàêèå êëàññû ìîãóò èñïîëüçîâàòü ýòó âåùü',
     
    10371051        'req_skill_rank' => 'Ðàíã íàâûêà',
    10381052        'req_skill_rank_desc' => 'Ìèíèìàëüíûé ðàíã íåîáõîäèìûé äëÿ èñïîëüçîâàíèÿ âåùè',
    1039         'req_spell' => 'Íåîáõîäèìûé ñïåë',
    1040         'req_spell_desc' => 'Ïåðñ äîëæåí çíàòü äàííûé ñïåë ÷òîáû èñïîëüçîâàòü âåùü',
     1053        'req_spell' => 'Íåîáõîäèìûé çàêë',
     1054        'req_spell_desc' => 'Ïåðñ äîëæåí çíàòü äàííûé çàêë ÷òîáû èñïîëüçîâàòü âåùü',
    10411055        'req_honor_rank' => 'Íåîáõîäèìûé ðàíã',
    10421056        'req_honor_rank_desc' => 'Ðàíã ÏâÏ Õîíîðà íåîáõîäèìûé äëÿ èñïîëüçîâàíèÿ âåùè',
     
    11051119        'quest_drop_chance' => 'Øàíñ äðîïà â êâåñòå',
    11061120        'quest_freeforall' => 'Â êâåñòå - äëÿ âñåõ',
    1107         'armor_dmg_mod' => 'Armor Damage Modifier',
    1108         'armor_dmg_mod_desc' => 'TODO:'
     1121        'armor_dmg_mod' => 'Ìîäèôèêàòîð óùåðáà äîñïåõà',
     1122        'armor_dmg_mod_desc' => 'TODO:',
     1123        'RacialLeader' => 'Racial Leader', //TODO
     1124        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    11091125);
    11101126
     
    11131129        'unknown' => 'Íåèçâåñòíî',
    11141130        'custom_search' => 'Ñâîé ôèëüòð',
    1115         'search' => '+ Ïîèñê +',
     1131        'search' => '- Ïîèñê -',
    11161132        'add_new' => 'Ñîçäàòü',
    11171133        'tot_go_templ' => 'Âñåãî øàáëîíîâ',
     
    11291145        'save_to_db' => 'Ñîõðàíèòü â áàçó',
    11301146        'save_to_script' => 'Ñîõðàíèòü ñêðèïò',
    1131         'lookup_go' => 'Ïîèñê GO',
     1147        'lookup_go' => 'Ïîèñê Îáúåêòà',
    11321148        'DOOR' => 'DOOR',
    11331149        'BUTTON' => 'BUTTON',
     
    11801196        'size_desc' => 'Ìàñøòàá ìîäåëè ãåéì-îáúåêòà',
    11811197        'sound' => 'Äåéñòâèå',
    1182         'sound_desc' => 'Ïîëå äàííûõ, óíèêàëüíîå äëÿ ðàçíîãî òèïà çíà÷åíèé.<br />https://svn.mangosproject.org/trac/MaNGOS/wiki/Database/gameobject_template - äîïîëíèòåëüíàÿ èíôîðìàöèÿ',
     1198        'sound_desc' => 'Ïîëå äàííûõ, óíèêàëüíîå äëÿ ðàçíîãî òèïà çíà÷åíèé.<br /><a href=\"https://svn.mangosproject.org/trac/MaNGOS/wiki/Database/gameobject_template/\" target=\"_new\"> - äîïîëíèòåëüíàÿ èíôîðìàöèÿ</a>',
    11831199        'tmpl_not_found' => 'Øàáëîí íå íàéäåí',
    11841200        'del_go' => 'Óäàëåíèå',
     
    12181234$lang_creature = array(
    12191235        // ----- CREATURE.PHP -----
    1220         'none' => 'None',
    1221         'custom' => 'Custom',
    1222         'gossip' => 'Gossip',
    1223         'quest_giver' => 'Quest Giver',
    1224         'vendor' => 'Vendor',
    1225         'taxi' => 'Taxi',
    1226         'trainer' => 'Trainer',
    1227         'spirit_healer' => 'Spirit Healer',
    1228         'guard' => 'Guard',
    1229         'inn_keeper' => 'Inn Keeper',
    1230         'banker' => 'Banker',
    1231         'retitioner' => 'Retitioner',
    1232         'tabard_vendor' => 'Tabard Vendor',
    1233         'battlemaster' => 'Battlemaster',
    1234         'auctioneer' => 'Auctioneer',
    1235         'stable_master' => 'Stable Master',
    1236         'armorer' => 'Armorer',
    1237         'normal' => 'Normal',
    1238         'elite' => 'Elite',
    1239         'rare_elite' => 'Rare Elite',
    1240         'world_boss' => 'World Boss',
    1241         'rare' => 'Rare',
     1236        'none' => 'Íåò',
     1237        'custom' => 'Ðàçíîå',
     1238        'gossip' => 'Îòâå÷àåò',
     1239        'quest_giver' => 'Êâåñòåð',
     1240        'vendor' => 'Ïðîäàâåö',
     1241        'taxi' => 'Òàêñè',
     1242        'trainer' => 'Òðåíåð',
     1243        'spirit_healer' => 'Äóõ-îæèâëÿòåëü',
     1244        'guard' => 'Ñòðàæà',
     1245        'inn_keeper' => 'Òðàêòèðùèê',
     1246        'banker' => 'Áàíêèð',
     1247        'retitioner' => 'Ãèëüäååö',
     1248        'tabard_vendor' => 'Ïðîäàâåö íàêèäîê',
     1249        'battlemaster' => 'Îðóæåéíûé ìàñòåð',
     1250        'auctioneer' => 'Àóêöèîíåð',
     1251        'stable_master' => 'Êîíþøèé',
     1252        'armorer' => 'Áðîííèê',
     1253        'normal' => 'Îáû÷íûé',
     1254        'elite' => 'Ýëèòà',
     1255        'rare_elite' => 'Ðåäêàÿ ýëèòà',
     1256        'world_boss' => 'Ìèðîâîé âðàã',
     1257        'rare' => 'Ðåäêî',
    12421258        'search_template' => 'Ïîèñê øàáëîíà ìîíñòðà',
    12431259        'select' => 'Âûáðàòü',
    1244         'other' => 'Other',
    1245         'beast' => 'Beast',
    1246         'dragonkin' => 'Dragonkin',
    1247         'demon' => 'Demon',
    1248         'elemental' => 'Elemental',
    1249         'giant' => 'Giant',
    1250         'undead' => 'Undead',
    1251         'humanoid' => 'Humanoid',
    1252         'critter' => 'Critter',
    1253         'mechanical' => 'Mechanical',
    1254         'not_specified' => 'Not Specified',
    1255         'class' => 'Class',
    1256         'mounts' => 'Mounts',
    1257         'trade_skill' => 'Trade Skill',
    1258         'pets' => 'Pets',
    1259         'wolf' => 'Wolf',
    1260         'cat' => 'Cat',
    1261         'spider' => 'Spider',
    1262         'bear' => 'Bear',
    1263         'boar' => 'Boar',
    1264         'crocolisk' => 'Crocolisk',
    1265         'carrion_bird' => 'Carrion Bird',
    1266         'crab' => 'Crab',
    1267         'gorilla' => 'Gorilla',
    1268         'raptor' => 'Raptor',
     1260        'other' => 'Äðóãîå',
     1261        'beast' => 'Çâåðü',
     1262        'dragonkin' => 'Äðàêîí',
     1263        'demon' => 'Äåìîí',
     1264        'elemental' => 'Ýëåìåíòàëü',
     1265        'giant' => 'Ãèãàíò',
     1266        'undead' => 'Íåæèòü',
     1267        'humanoid' => 'Ãóìàíîèä',
     1268        'critter' => 'Òâàðü',
     1269        'mechanical' => 'Ìåõàíè÷åñêèé',
     1270        'not_specified' => 'Íå óêàçàíî',
     1271        'class' => 'Êëàññ',
     1272        'mounts' => 'Âåðõîâîé',
     1273        'trade_skill' => 'Òîðãîâûé íàâûê',
     1274        'pets' => 'Ïðèðó÷åííûé',
     1275        'wolf' => 'Âîëê',
     1276        'cat' => 'Êîøêà',
     1277        'spider' => 'Ïàóê',
     1278        'bear' => 'Ìåäâåäü',
     1279        'boar' => 'Êàáàí',
     1280        'crocolisk' => 'Êðîêîäèë',
     1281        'carrion_bird' => 'Îòâðàòèòåëüíàÿ ïòèöà',
     1282        'crab' => 'Êðàá',
     1283        'gorilla' => 'Ãîðèëëà',
     1284        'raptor' => 'ßùåð',
    12691285        'tallstrider' => 'Tallstrider',
    12701286        'felhunter' => 'Felhunter',
    12711287        'voidwalker' => 'Voidwalker',
    1272         'succubus' => 'Succubus',
    1273         'doomguard' => 'Doomguard',
    1274         'scorpid' => 'Scorpid',
    1275         'turtle' => 'Turtle',
    1276         'scorpid' => 'Scorpid',
    1277         'imp' => 'Imp',
    1278         'bat' => 'Bat',
    1279         'hyena' => 'Hyena',
    1280         'owl' => 'Owl',
    1281         'wind_serpent' => 'Wind Serpent',
     1288        'succubus' => 'Ñóêêóá',
     1289        'doomguard' => 'Ñóäüáîñòðàæ',
     1290        'scorpid' => 'Ñêîðïèîí',
     1291        'turtle' => '×åðåïàõà',
     1292        'scorpid' => 'Ñêîðïèîí',
     1293        'imp' => 'Èìï',
     1294        'bat' => 'Ëåòó÷èé ìûøü',
     1295        'hyena' => 'Ãèåíà',
     1296        'owl' => 'Ñîâà',
     1297        'wind_serpent' => 'Âåòðîçìåé',
    12821298        'search' => 'Ïîèñê',
    12831299        'new_search' => 'Íîâûé ïîèñê',
     
    13221338        'type_desc' => 'Òèï òâàðè',
    13231339        'npc_flag' => 'Ôëàã NPC',
    1324         'npc_flag_desc' => 'This is way to cliet know how info you see if you clic(RMB) on NPC if is vendor if is auction in fact is menu how you see. Is what type of NPC it is.',
     1340        'npc_flag_desc' => 'Ïåðåäàåò èíôîðìàöèþ êëèåíòó, ÷òî ýòîò NPC äîëæåí äåëàòü ïî êëèêó íà íåãî - íàïðèìåð òîðãîâåö èëè àóêöèîíåð',
    13251341        'trainer_type' => 'Òèï òðåíåðà',
    1326         'trainer_type_desc' => 'If NPC flag is set to Trainer this flag will specify its type.',
     1342        'trainer_type_desc' => 'Åñëè ôëàã NPC ñòîèò êàê -Òðåíåð-, òî íàäî óêàçàòü òèï òðåíåðà',
    13271343        'loot' => 'Ëóò',
    13281344        'loot_id' => 'Ëóò òâàðè',
     
    13651381        'bounding_radius_desc' => 'Ðàäèóñ â êîòîðîì ìîíñòð àòàêóåò',
    13661382        'spells' => 'Ìàãèÿ',
    1367         'spell' => 'Ñïåë',
    1368         'spell_desc' => 'Ñïåëû òâàðè',
     1383        'spell' => 'çàêë',
     1384        'spell_desc' => 'çàêëû òâàðè',
    13691385        'resistances' => 'Çàùèòà îò ìàãèè',
    13701386        'resis_holy' => 'Ñâÿòîé',
    1371         'resis_holy_desc' => 'Holy Resitance.',
     1387        'resis_holy_desc' => 'Çàùèòà îò ìàãèè ñâÿòîñòè',
    13721388        'resis_fire' => 'Îãíåííîé',
    1373         'resis_fire_desc' => 'Fire Resitance.',
     1389        'resis_fire_desc' => 'Çàùèòà îò ìàãèè îãíÿ',
    13741390        'resis_nature' => 'Ïðèðîäíîé',
    1375         'resis_nature_desc' => 'Nature Resitance.',
     1391        'resis_nature_desc' => 'Çàùèòà îò ìàãèè ïðèðîäû',
    13761392        'resis_frost' => 'Ëåäÿíîé',
    1377         'resis_frost_desc' => 'Frost Resitance.',
     1393        'resis_frost_desc' => 'Çàùèòà îò ìàãèè ìîðîçà',
    13781394        'resis_shadow' => 'Òåíåâîé',
    1379         'resis_shadow_desc' => 'Shadow Resitance.',
     1395        'resis_shadow_desc' => 'Çàùèòà îò ìàãèè òåíåé',
    13801396        'resis_arcane' => 'Àðêàííîé',
    1381         'resis_arcane_desc' => 'Arcane Resitance.',
     1397        'resis_arcane_desc' => 'Çàùèòà îò àðêàííîé ìàãèè',
    13821398        'models' => 'Ìîäåëè',
    13831399        'modelid_male' => 'Ìóæñêàÿ',
    1384         'modelid_male_desc' => 'Graphical model that client must apply on this male creature.',
     1400        'modelid_male_desc' => 'Ãðàôè÷åñêàÿ ìóæñêàÿ ìîäåëü èç êëèåíòà',
    13851401        'modelid_female' => 'Æåíñêàÿ',
    1386         'modelid_female_desc' => 'Graphical model that client must apply on this Female creature.',
     1402        'modelid_female_desc' => 'Ãðàôè÷åñêàÿ æåíñêàÿ ìîäåëü èç êëèåíòà',
    13871403        'equip_slot' => 'Ñëîòû ñíàðÿãè',
    13881404        'equip_slot_desc' => 'TODO:',
    13891405        'equip_model' => 'Ìîäåëè ñíàðÿãè',
    1390         'equip_model_desc' => 'Equipement\'s model of the first item weared by the creature.',
     1406        'equip_model_desc' => 'Ìîäåëü âåùè, íàäåòîé íà òâàðü',
    13911407        'equip_info' => 'Èíôîðìàöèÿ ñíàðÿãè',
    13921408        'equip_info_desc' => 'TODO:',
    13931409        'scripts' => 'Ñêðèïòû',
    13941410        'ai_name' => 'AIName',
    1395         'ai_name_desc' => 'Name of the AI function creature uses.',
     1411        'ai_name_desc' => 'Èìÿ èñïîëüçóåìîé òâàðüþ AI ôóíêöèè',
    13961412        'movement_type' => 'Òèï äâèæåíèÿ',
    13971413        'movement_type_desc' => 'TODO.',
     
    14001416        'race' => 'Ðàñà',
    14011417        'race_desc' => 'Creature\'s race, like character.race field. Used for check in case npcflag include trainer flag (16) and trainer_type == TRAINER_TYPE_MOUNTS.',
    1402         'trainer_spell' => 'Òðåíåð ñïåë',
     1418        'trainer_spell' => 'Òðåíåð çàêë',
    14031419        'trainer_spell_desc' => 'Spell ID. Used for check in case npcflag include trainer flag (16) and trainer_type == TRAINER_TYPE_TRADESKILLS. Player must known trainer_spell to start training.',
    14041420        'inhabit_type' => 'Òèï äâèæåíèÿ',
     
    14341450        'count' => 'Êîë-âî',
    14351451        'trains' => 'Òðåíèðóåò',
    1436         'spell_id' => 'Ñïåë ID',
     1452        'spell_id' => 'çàêë ID',
    14371453        'cost' => 'Öåíà',
    14381454        'req_skill' => 'Òðåáóåò íàâûê',
     
    14471463        'search_creatures' => 'Ïîèñê òâàðåé',
    14481464        'custom_search' => 'Ñâîé ôèëüòð',
    1449         'pickpocketloot_tmpl_id' => 'Pickpocket Loot Template ID',
    1450         'skinning_loot_tmpl_id' => 'Skinning Loot Template ID',
    1451         'add_items_to_templ' => 'Add Item to Template',
    1452         'loot_item_id' => 'Item ID',
    1453         'loot_item_id_desc' => 'ID of the item you wish to be added.',
     1465        'pickpocketloot_tmpl_id' => 'Âîðîâñòâî øàáëîí ID',
     1466        'skinning_loot_tmpl_id' => 'Ñêîðíÿê øàáëîí ID',
     1467        'add_items_to_templ' => 'Äîáàâèòü âåùü â øàáëîí',
     1468        'loot_item_id' => 'ID âåùè',
     1469        'loot_item_id_desc' => 'ID âåùè, êîòîðóþ äîáàâëÿòü',
    14541470        'loot_drop_chance' => 'Øàíñ äðîïà',
    14551471        'loot_drop_chance_desc' => 'Øàíñ äðîïà',
    14561472        'loot_quest_drop_chance' => 'Øàíñ äðîïà â êâåñòå',
    14571473        'loot_quest_drop_chance_desc' => 'Øàíñ äðîïà â êâåñòå',
    1458         'min_count' => 'Min. Count',
    1459         'min_count_desc' => 'Minimum number of stack size on drop.',
    1460         'max_count' => 'Max. Count',
    1461         'max_count_desc' => 'Maximum number of stack size on drop.',
     1474        'min_count' => 'Ìèíèìóì',
     1475        'min_count_desc' => 'Ìèíèìàëüíîå êîëè÷åñòâî âûïàäàåò',
     1476        'max_count' => 'Maêñèìóì',
     1477        'max_count_desc' => 'Ìàêñèìàëüíîå êîëè÷åñòâî âûïàäàåò',
    14621478        'quest_loot' => 'Ôëàã êâåñòîâîãî ëóòà',
    1463         'quest_loot_desc' => 'Quest Free for all loot flag.',
    1464         'add_item_to_loot' => 'Add item to Loot Template',
     1479        'quest_loot_desc' => 'Êâåñòîâûé ôëàã -Ñâîáîäíî äëÿ âñåõ-',
     1480        'add_item_to_loot' => 'Äîáàâèòü âåùü â øàáëîí ëóòà',
    14651481        'drop_chance' => 'Øàíñ äðîïà',
    14661482        'quest_freeforall' => 'Â êâåñòå - äëÿ âñåõ',
    1467         'add_ends_quests' => 'Add Quest ends by this NPC',
    1468         'add_starts_quests' => 'Add Quest starts by this NPC',
    1469         'quest_id' => 'Quest ID',
    1470         'quest_id_desc' => 'ID of the quest.',
    1471         'add_items_to_vendor' => 'Add item to Vendor',
    1472         'vendor_item_id' => 'Item Id',
    1473         'vendor_item_id_desc' => 'Id of item you wish to add.',
    1474         'vendor_max_count' => 'Max. Count',
    1475         'vendor_max_count_desc' => 'Maximim number of items can be soled.',
    1476         'vendor_incrtime' => 'Increase Time',
    1477         'vendor_incrtime_desc' => 'Time before this item can be soled again.',
    1478         'train_spell_id' => 'Spell Id',
    1479         'train_spell_id_desc' => 'Id of the spell you like this trainer to train.',
    1480         'add_spell_to_trainer' => 'Add Spell to Trainer',
    1481         'train_cost' => 'Cost',
    1482         'train_cost_desc' => 'Cost in cooper of this skill.',
    1483         'req_skill' => 'Req. Skill',
    1484         'req_skill_desc' => 'Skill id required to learn this spell.',
    1485         'req_skill_value' => 'Req. Skill Value',
    1486         'req_skill_value_desc' => 'Skill level required to learn this spell.',
    1487         'req_level' => 'Req. Level',
    1488         'req_level_desc' => 'Character level required to learn this spell.',
     1483        'add_ends_quests' => 'Äîáàâèòü îêîí÷àíèå êâåñòà ýòîìó NPC',
     1484        'add_starts_quests' => 'Äîáàâèòü íà÷àëî êâåñòà ýòîìó NPC',
     1485        'quest_id' => 'Êâåñò ID',
     1486        'quest_id_desc' => 'ID êâåñòà',
     1487        'add_items_to_vendor' => 'Äîáàâèòü âåùü ïðîäàâöó',
     1488        'vendor_item_id' => 'ID âåùè',
     1489        'vendor_item_id_desc' => 'Íîìåð âåùè, êîòîðóþ äîáàâëÿòü',
     1490        'vendor_max_count' => 'Ìàêñèìóì',
     1491        'vendor_max_count_desc' => 'Ìàêñèìóì âåùåé ìîæíî ïðîäàòü',
     1492        'vendor_incrtime' => 'Óâåëè÷èòü âðåìÿ',
     1493        'vendor_incrtime_desc' => 'Âðåìÿ ÷åðåç êîòîðîå âåùü ñíîâà ïîÿâèòñÿ â ïðîäàæå',
     1494        'train_spell_id' => 'ID çàêëèíàíèÿ',
     1495        'train_spell_id_desc' => 'ID çàêëèíàíèÿ, êîòîðîìó áóäóò ó÷èòü',
     1496        'add_spell_to_trainer' => 'Äîáàâèòü òðåíåðó',
     1497        'train_cost' => 'Öåíà',
     1498        'train_cost_desc' => 'Öåíà â ìåäíûõ íà ýòó ñïîñîáíîñòü',
     1499        'req_skill' => 'Òðåáóåò ñêèë',
     1500        'req_skill_desc' => 'ID ñêèëà, êîòîðûé íåîáõîäèì äëÿ ïîêóïêè',
     1501        'req_skill_value' => 'Çíà÷åíèå',
     1502        'req_skill_value_desc' => 'Óðîâåíü ñêèëà, êîòîðûé òðåáóåòñÿ',
     1503        'req_level' => 'Óðîâåíü',
     1504        'req_level_desc' => 'Ìèíèìàëüíûé óðîâåíü äëÿ îáó÷åíèÿ',
    14891505        'check_to_delete' => '* Ïîñòàâèòü ãàëêó ðÿäîì ñ âåùüþ äëÿ óäàëåíèÿ åå ñ ìîíñòðà'
    14901506        );
     
    14931509        // ----- ID_TAB.PHP -----
    14941510        //---maps---
    1495         'azeroths' => 'Azeroths',
    1496         'kalimdor' => 'Kalimdor',
    1497         'test_zone' => 'Test Zone',
    1498         'kalidar' => 'Kalidar',
    1499         'alterac_valley' => 'Alterac Valley',
    1500         'shadowfang_keep_instance' => 'Shadowfang Keep',
    1501         'the_stockade_instance' => 'The Stockade',
    1502         'stormwind_prison' => 'Stormwind Prison',
    1503         'deadmines_instance' => 'Deadmines',
    1504         'plains_of_snow' => 'Plains of Snow',
    1505         'wailing_caverns_instance' => 'Wailing Caverns',
    1506         'monastery_interior' => 'Monastery Interior',
    1507         'razorfen_kraul_instance' => 'Razorfen Kraul',
    1508         'blackfathom_deeps_instance' => 'Blackfathom Deeps',
    1509         'uldaman_instance' => 'Uldaman',
    1510         'gnomeregan_instance' => 'Gnomeregan',
    1511         'sunken_temple_instance' => 'Sunken Temple',
    1512         'razorfen_downs_instance' => 'Razorfen Downs',
    1513         'outland' => 'Outland',
    1514         'emerald_forest' => 'Emerald Forest',
    1515         'scarlet_monastery_instance' => 'Scarlet Monastery',
    1516         'zul_farrak_instance' => 'Zul\'Farrak',
    1517         'blackrock_spire_instance' => 'Blackrock Spire',
    1518         'blackrock_depths_instance' => 'Blackrock Depths',
    1519         'onyxia_s_lair_instance' => 'Onyxia\'s Lair',
    1520         'caverns_of_time' => 'Caverns of Time',
    1521         'scholomance_instance' => 'Scholomance',
    1522         'zul_gurub_instance' => 'Zul\'Gurub',
    1523         'stratholme_instance' => 'Stratholme',
    1524         'maraudon_instance' => 'Maraudon',
    1525         'deeprun_tram' => 'Deeprun Tram',
    1526         'ragefire_chasm_instance' => 'Ragefire Chasm',
    1527         'the_molten_core_instance' => 'The Molten Core',
    1528         'dire_maul_instance' => 'Dire Maul',
    1529         'alliance_pvp_barracks' => 'Alliance PVP Barracks',
    1530         'horde_pvp_barracks' => 'Horde PVP Barracks',
    1531         'development_land' => 'Developpement Land',
    1532         'blackwing_lair_instance' => 'Blackwing Lair',
    1533         'warsong_gulch' => 'Warsong Gulch',
    1534         'ruins_of_ahn_qiraj_instance' => 'Ruins of Ahn\'Qiraj',
    1535         'arathi_basin' => 'Arathi Basin',
    1536         'temple_of_ahn_qiraj_instance' => 'Temple of Ahn\'Qiraj',
    1537         'naxxramas_instance' => 'Naxxramas',
     1511        'azeroths' => 'Àçåðîò',
     1512        'kalimdor' => 'Êàëèìäîð',
     1513        'test_zone' => 'òåñòîâàÿ çîíà',
     1514        'kalidar' => 'Êàëèäàð',
     1515        'alterac_valley' => 'äîëèíà Àëüòåðàê',
     1516        'shadowfang_keep_instance' => 'çàìîê Òåíåêëûê',
     1517        'the_stockade_instance' => '×àñòîêîë',
     1518        'stormwind_prison' => 'Òþðüìà Øòîðìîâåòðà',
     1519        'deadmines_instance' => 'Ñìåðòîøàõòû',
     1520        'plains_of_snow' => 'Ðàâíèíû Ñíåãà',
     1521        'wailing_caverns_instance' => 'Ñòåíàþùèå Ïåùåðû',
     1522        'monastery_interior' => 'Ìîíàñòûðñêèå Ïàëàòû',
     1523        'razorfen_kraul_instance' => 'Ðàçîðôåí Êðàóë',
     1524        'blackfathom_deeps_instance' => '×åðíîïîíÿíû Ãëóáèíû',
     1525        'uldaman_instance' => 'Óëüäàìàí',
     1526        'gnomeregan_instance' => 'Ãíîìîðåãàí',
     1527        'sunken_temple_instance' => 'Çàòîíóâøèé õðàì',
     1528        'razorfen_downs_instance' => 'Ðàçîðôåí Íèæíèé',
     1529        'outland' => 'Âíåøíåçåìüå',
     1530        'emerald_forest' => 'Èçóìðóäíîëåñüå',
     1531        'scarlet_monastery_instance' => 'Ìàëèíîâûé Ìîíàñòûðü',
     1532        'zul_farrak_instance' => 'Çóë-Ôàððàê',
     1533        'blackrock_spire_instance' => '×åðíîñêàëüíûé Øïèëü',
     1534        'blackrock_depths_instance' => '×åðíîñêàëüíûå Ãëóáèíû',
     1535        'onyxia_s_lair_instance' => 'Ëîãîâî Îíèêñèè',
     1536        'caverns_of_time' => 'Ïåùåðû Âðåìåíè',
     1537        'scholomance_instance' => 'Øêîëîìàíñüå',
     1538        'zul_gurub_instance' => 'Çóë-Ãóðóá',
     1539        'stratholme_instance' => 'Ñòðàòðå÷íîñòðîâüå',
     1540        'maraudon_instance' => 'Ìàðîäîí',
     1541        'deeprun_tram' => 'Ãëóáîáåãíîå Ìåòðî',
     1542        'ragefire_chasm_instance' => 'ßðîîãíèé Ðàçëîì',
     1543        'the_molten_core_instance' => 'Ëèòîÿäðüå',
     1544        'dire_maul_instance' => 'Æóòêîêóâàëäüå',
     1545        'alliance_pvp_barracks' => 'Êàçàðìû Àëüÿíñà',
     1546        'horde_pvp_barracks' => 'Êàçàðìû Îðäû',
     1547        'development_land' => 'Ðàçðàáîò÷èêîçåìüå',
     1548        'blackwing_lair_instance' => '×åðíîêðûëüå Ëîãîâî',
     1549        'warsong_gulch' => 'Áîåâîïåñåííîå óùåëüå',
     1550        'ruins_of_ahn_qiraj_instance' => 'Ðóèíû Àí-Êèðàæ',
     1551        'arathi_basin' => 'Àðàòè',
     1552        'temple_of_ahn_qiraj_instance' => 'Õðàì Àí-Êèðàæ',
     1553        'naxxramas_instance' => 'Íàêñ-Êñðàìàñ',
    15381554        //tbc - maps
    1539         'cot_black_morass' => 'The Black Morass',
    1540         'karazahn' => 'Karazahn',
    1541         'cot_hyjal_past' => 'Hyjal Past',
    1542         'hellfire_military' => 'The Shattered Halls',
    1543         'hellfire_demon' => 'The Blood Furnace',
    1544         'hellfire_rampart' => 'Hellfire Ramparts',
    1545         'hellfire_raid' => 'Magtheridon\'s Lair',
    1546         'coilfang_pumping' => 'The Steamvault',
    1547         'coilfang_marsh' => 'The Underbog',
    1548         'coilfang_draenei' => 'The Slave Pens',
    1549         'coilfang_raid' => 'Serpentshrine Cavern',
    1550         'tempest_keep_raid' => 'Eye of the Storm',
    1551         'tempest_keep_arcane' => 'The Arcatraz',
    1552         'tempest_keep_atrium' => 'The Botanica',
    1553         'tempest_keep_factory' => 'The Mechanar',
    1554         'auchindoun_shadow' => 'Shadow Labyrinth',
    1555         'auchindoun_arakkoa' => 'Sethekk Halls',
    1556         'auchindoun_ethereal' => 'Mana-Tombs',
    1557         'auchindoun_draenei' => 'Auchenai Crypts',
    1558         'nagrand_arena' => 'Nagrand Arena',
    1559         'cot_hillsbrad_past' => 'Old Hillsbrad Foothills',
    1560         'blades_edge_arena' => 'Blade\'s Edge Arena',
    1561         'black_temple' => 'Black Temple',
    1562         'gruuls_lair' => 'Gruul\'s Lair',
    1563         'netherstorm_arena' => 'Netherstorm Arena',
    1564         'zulaman' => 'Zul\'Aman',
     1555        'cot_black_morass' => '×åðíîãðÿçáîëîòüå',
     1556        'karazahn' => 'Êàðàçàí',
     1557        'cot_hyjal_past' => 'Õèäæàë Ïðîøëûé',
     1558        'hellfire_military' => 'Ðàçðóøåííûå Çàëû',
     1559        'hellfire_demon' => 'Êðîâàâàÿ Ïå÷ü',
     1560        'hellfire_rampart' => 'Àäñêîïëàìåííûå Âàëû',
     1561        'hellfire_raid' => 'Ëîãîâî Ìàãñåðèäîíà',
     1562        'coilfang_pumping' => 'Ïàðîâîõðàíüå',
     1563        'coilfang_marsh' => 'Íèæíåòðÿñèíüå',
     1564        'coilfang_draenei' => 'Ðàáîðó÷üå',
     1565        'coilfang_raid' => 'Çìååñâÿòèëèùíûå Ïåùåðû',
     1566        'tempest_keep_raid' => 'Ãëàç Øòîðìà',
     1567        'tempest_keep_arcane' => 'Àðêàòðàç',
     1568        'tempest_keep_atrium' => 'Áîòàíèêà',
     1569        'tempest_keep_factory' => 'Ìåõàíàð',
     1570        'auchindoun_shadow' => 'Òåíåâîé Ëàáèðèíò',
     1571        'auchindoun_arakkoa' => 'Çàëû Ñåòõåêêà',
     1572        'auchindoun_ethereal' => 'Ìàíà-Ìîãèëüå',
     1573        'auchindoun_draenei' => 'Î÷åíàéñêèå Ñêëåïû',
     1574        'nagrand_arena' => 'Íàãðàíäñêàÿ Àðåíà',
     1575        'cot_hillsbrad_past' => 'Ñòàðîå Øòèôòõîëìüå',
     1576        'blades_edge_arena' => 'Êëèíêîëåçâèéíàÿ Àðåíà',
     1577        'black_temple' => '×åðíûé Õðàì',
     1578        'gruuls_lair' => 'Ëîãîâî Ãðóóëà',
     1579        'netherstorm_arena' => 'Âíåøíåøòîðìîâàÿ Àðåíà',
     1580        'zulaman' => 'Çóë-Àìàí',
    15651581        //---class/race---
    15661582        'unknown' => 'íåïîíÿòíî',
     
    15861602        'draenei' => 'Äðàåíåé',
    15871603        //---zone---
    1588         'undercity' => 'Undercity',
    1589         'ironforge' => 'Ironforge',
    1590         'stormwind_city' => 'Stormwind City',
    1591         'badlands' => 'Badlands',
    1592         'wetlands' => 'Wetlands',
    1593         'stranglethorn_vale' => 'Stranglethorn Vale',
    1594         'redridge_mountains' => 'Redridge Mountains',
    1595         'loch_modan' => 'Loch Modan',
    1596         'duskwood' => 'Duskwood',
    1597         'deadwind_pass' => 'Deadwind Pass',
    1598         'elwynn_forest' => 'Elwynn Forest',
    1599         'burning_steppes' => 'Steppes ardentes',
    1600         'searing_gorge' => 'Searing Gorge',
    1601         'dun_morogh' => 'Dun Morogh',
    1602         'the_hinterlands' => 'The Hinterlands',
    1603         'westfall' => 'Westfall',
    1604         'hillsbrad_foothills' => 'Hillsbrad Foothills',
    1605         'eastern_plaguelands' => 'Eastern Plaguelands',
    1606         'western_plaguelands' => 'Western Plaguelands',
    1607         'silverpine_forest' => 'Silverpine Forest',
    1608         'tirisfal_glades' => 'Tirisfal Glades',
    1609         'blasted_lands' => 'Blasted Lands',
    1610         'swamp_of_sorrows' => 'Swamp of Sorrows',
    1611         'arathi_highlands' => 'Arathi Highlands',
    1612         'alterac_mountains' => 'Alterac Mountains',
    1613         'darnassus' => 'Darnassus',
    1614         'thunder_bluff' => 'Thunder Bluff',
    1615         'orgrimmar' => 'Orgrimmar',
     1604        'undercity' => 'Ïîäãîðîä',
     1605        'ironforge' => 'Æåëåçíîãîðí',
     1606        'stormwind_city' => 'Øòîðìîâåòåð',
     1607        'badlands' => 'Ïëîõîçåìüå',
     1608        'wetlands' => 'Ìîêðîçåìüå',
     1609        'stranglethorn_vale' => 'Øèïîäóøàùàÿ äîëèíà',
     1610        'redridge_mountains' => 'Êðàñíîãîðüå',
     1611        'loch_modan' => 'Ëîõ Ìîäàí',
     1612        'duskwood' => 'Ñóìåðåëåñ',
     1613        'deadwind_pass' => 'Ñìåðâåòåðíûé ïðîõîä',
     1614        'elwynn_forest' => 'Ëåñ Ýëâèíí',
     1615        'burning_steppes' => 'Ïûëàþùèå ñòåïè',
     1616        'searing_gorge' => 'Èññóøåíîå óùåëüå',
     1617        'dun_morogh' => 'Äóí Ìîðîã',
     1618        'the_hinterlands' => 'Âíóòðåçåìüå',
     1619        'westfall' => 'Çàïàäîïàä',
     1620        'hillsbrad_foothills' => 'Øòèôòõîëìüå',
     1621        'eastern_plaguelands' => 'Âîñò.×óìíîçåìüå',
     1622        'western_plaguelands' => 'Çàï.×óìíîçåìüå',
     1623        'silverpine_forest' => 'Ñðåáðîåëüíûé áîð',
     1624        'tirisfal_glades' => 'ïîëÿ Òèðèñôàëÿ',
     1625        'blasted_lands' => 'Âçîðâàíîçåìüå',
     1626        'swamp_of_sorrows' => 'Áîëîòà Ïå÷àëè',
     1627        'arathi_highlands' => 'íàãîðüå Àðàòè',
     1628        'alterac_mountains' => 'ãîðû Àëüòåðàê',
     1629        'darnassus' => 'Äàðíàññ',
     1630        'thunder_bluff' => 'Ãðîìîãðåì',
     1631        'orgrimmar' => 'Îðãðèìàð',
    16161632        'moonglade' => 'Moonglade',
    1617         'silithus' => 'Silithus',
    1618         'winterspring' => 'Winterspring',
    1619         'un_goro_crater' => 'Un\'Goro Crater',
    1620         'felwood' => 'Felwood',
    1621         'azshara' => 'Azshara',
    1622         'tanaris' => 'Tanaris',
    1623         'dustwallow_marsh' => 'Dustwallow Marsh',
    1624         'mulgore' => 'Mulgore',
    1625         'feralas' => 'Feralas',
    1626         'desolace' => 'Desolace',
    1627         'thousand_needles' => 'Thousand Needles',
    1628         'durotar' => 'Durotar',
    1629         'ashenvale' => 'Ashenvale',
    1630         'darkshore' => 'Darkshore',
    1631         'teldrassil' => 'Teldrassil',
    1632         'stonetalon_mountains' => 'Stonetalon Mountains',
    1633         'the_barrens' => 'The Barrens',
     1633        'silithus' => 'Ñèëèòóñ',
     1634        'winterspring' => 'Çèìíåêëþ÷üå',
     1635        'un_goro_crater' => 'êðàòåð Óí-Ãîðî',
     1636        'felwood' => 'Ôåëüñêèé ëåñ',
     1637        'azshara' => 'Àæàðà',
     1638        'tanaris' => 'Òàíàðèñ',
     1639        'dustwallow_marsh' => 'Ïûëåïîêðûòûå áîëîòà',
     1640        'mulgore' => 'Ìóëãîð',
     1641        'feralas' => 'Ôåðàëàñ',
     1642        'desolace' => 'Äåñîëàñ',
     1643        'thousand_needles' => 'Òûùåèãëüå',
     1644        'durotar' => 'Äóðîòàð',
     1645        'ashenvale' => 'Àøåíâàëü',
     1646        'darkshore' => 'Òåìíîáåðåæüå',
     1647        'teldrassil' => 'Òåëäðàñèë',
     1648        'stonetalon_mountains' => 'Êàìåííîêîãòüè ãîðû',
     1649        'the_barrens' => 'Ïóñòîøè',
    16341650        //tbc- zones
    1635         'shattrath_city' => 'Shattrath City',
    1636         'silvermoon_city' => 'Silvermoon City',
    1637         'netherstorm' => 'Netherstorm',
    1638         'terokkar_forest' => 'Terokkar Forest',
    1639         'nagrand' => 'Nagrand',
    1640         'bloodmyst_isle' => 'Bloodmyst Isle',
    1641         'blades_edge_mountains' => 'Blade\'s Edge Mountains',
    1642         'shadowmoon_valley' => 'Shadowmoon Valley',
    1643         'the_exodar' => 'The Exodar',
    1644         'zangarmarsh' => 'Zangarmarsh',
    1645         'hellfire_peninsula' => 'Hellfire Peninsula',
    1646         'azuremyst_isle' => 'Azuremyst Isle',
    1647         'ghostlands' => 'Ghostlands',
    1648         'eversong_woods' => 'Eversong Woods',
     1651        'shattrath_city' => 'Øàòòðàñ',
     1652        'silvermoon_city' => 'Ñðåáðîëóíüå',
     1653        'netherstorm' => 'Íèæíåâåòðüå',
     1654        'terokkar_forest' => 'ëåñ Òåððîêàð',
     1655        'nagrand' => 'Íàãðàíä',
     1656        'bloodmyst_isle' => 'Êðîâîòóìàííûé îñòðîâ',
     1657        'blades_edge_mountains' => 'Êëèíêîëåçâèéíûå ãîðû',
     1658        'shadowmoon_valley' => 'Òåíåëóííàÿ äîëèíà',
     1659        'the_exodar' => 'Ýêñîäàð',
     1660        'zangarmarsh' => 'Çàíãàðáîëîòüå',
     1661        'hellfire_peninsula' => 'Àäñêîïëàìåííûé ïîëóîñòðîâ',
     1662        'azuremyst_isle' => 'Ñèíåòóìàííûé îñòðîâ',
     1663        'ghostlands' => 'Ïðèçðà÷íîçåìüå',
     1664        'eversong_woods' => 'Ðåäêîïåñåííûé ëåñ',
    16491665        //skills
    1650         'SKILL_RIDING' => 'Riding',
    1651         'SKILL_LANG_DRAENEI' => 'Language Draenei',
    1652         'SKILL_JEWELCRAFTING' => 'Jewelcrafting',
    1653         'SKILL_RIDING_KODO' => 'Riding Kodo',
    1654         'SKILL_LANG_GUTTERSPEAK' => 'Language Gutterspeak',
    1655         'SKILL_LOCKPICKING' => 'LockPicking',
    1656         'SKILL_DISCIPLINE' => 'Descipline',
    1657         'SKILL_DESTRUCTION' => 'Destruction',
    1658         'SKILL_BALANCE' => 'Balance',
    1659         'SKILL_RIDING_UNDEAD_HORSE' => 'Riding Undead Horse',
    1660         'SKILL_RIDING_MECHANOSTRIDER' => 'Riding Mechanostrider',
    1661         'SKILL_RIDING_RAPTOR' => 'Riding Raptor',
    1662         'SKILL_FIST_WEAPONS' => 'Fist Weapons',
    1663         'SKILL_SHIELD' => 'Shield',
    1664         'SKILL_CLOTH' => 'Cloth',
    1665         'SKILL_LEATHER' => 'Leather',
    1666         'SKILL_MAIL' => 'Mail',
    1667         'SKILL_SKINNING' => 'Skinning',
    1668         'SKILL_ELEMENTAL_COMBAT' => 'Elemental Combat',
    1669         'SKILL_RESTORATION' => 'Restoration',
    1670         'SKILL_ENHANCEMENT' => 'Enhancement',
    1671         'SKILL_FISHING' => 'Fishing',
    1672         'SKILL_AFFLICTION' => 'Affiliction',
    1673         'SKILL_DEMONOLOGY' => 'Demonology',
    1674         'SKILL_ENCHANTING' => 'Enchanting',
    1675         'SKILL_LANG_TROLL' => 'Language Troll',
    1676         'SKILL_LANG_GNOMISH' => 'Language Gnomish',
    1677         'SKILL_PLATE_MAIL' => 'Plate Mail',
    1678         'SKILL_PET_TALENTS' => 'Pet Talents',
    1679         'SKILL_BEAST_TRAINING' => 'Beast Training',
    1680         'SKILL_PROTECTION' => 'Protection',
    1681         'SKILL_FURY' => 'Fury',
    1682         'SKILL_ASSASSINATION' => 'Assassination',
    1683         'SKILL_ARCANE' => 'Arcane',
    1684         'SKILL_POLEARMS' => 'Polearms',
    1685         'SKILL_WANDS' => 'Wands',
    1686         'SKILL_SPEARS' => 'Spears',
    1687         'SKILL_CROSSBOWS' => 'Crossbows',
    1688         'SKILL_WEAPON_TALENTS' => 'Weapon Talents',
    1689         'SKILL_ENGINERING' => 'Enginering',
    1690         'SKILL_TAILORING' => 'Tailoring',
    1691         'SKILL_MINING' => 'Mining',
    1692         'SKILL_COOKING' => 'Cooking',
    1693         'SKILL_RETRIBUTION' => 'Retribution',
    1694         'SKILL_HERBALISM' => 'Herbalism',
    1695         'SKILL_THROWN' => 'Thrown',
    1696         'SKILL_DAGGERS' => 'Daggers',
    1697         'SKILL_2H_AXES' => 'Two-Handed Axes',
    1698         'SKILL_ALCHEMY' => 'Alchemy',
    1699         'SKILL_LEATHERWORKING' => 'Leatherworking',
    1700         'SKILL_BLACKSMITHING' => 'Blacksmithing',
    1701         'SKILL_MARKSMANSHIP' => 'Marksmanship',
    1702         'SKILL_UNARMED' => 'Unarmed',
    1703         'SKILL_2H_MACES' => 'Two-Handed Maces',
    1704         'SKILL_RIDING_TIGER' => 'Riding Tiger',
    1705         'SKILL_RIDING_RAM' => 'Riding Ram',
    1706         'SKILL_RIDING_WOLF' => 'Riding Wolf',
    1707         'SKILL_RIDING_HORSE' => 'Riding Horse',
    1708         'SKILL_LANG_OLD_TONGUE' => 'Language Old Tongue',
    1709         'SKILL_LANG_TITAN' => 'Language Titan',
    1710         'SKILL_LANG_DEMON_TONGUE' => 'Language Demon Tongue',
    1711         'SKILL_LANG_DRACONIC' => 'Language Draconic',
    1712         'SKILL_LANG_THALASSIAN' => 'Language  Thalassian',
    1713         'SKILL_STAVES' => 'Staves',
    1714         'SKILL_FERAL_COMBAT' => 'Feral Comabt',
    1715         'SKILL_FIRST_AID' => 'First Aid',
    1716         'SKILL_DUAL_WIELD' => 'Dual Wield',
    1717         'SKILL_LANG_TAURAHE' => 'Language Taurahe',
    1718         'SKILL_LANG_DARNASSIAN' => 'Language Darnassian',
    1719         'SKILL_LANG_DWARVEN' => 'Language Dwarven',
    1720         'SKILL_LANG_ORCISH' => 'Language Orcish',
    1721         'SKILL_LANG_COMMON' => 'Language Common',
    1722         'SKILL_DEFENSE' => 'Defense',
    1723         'SKILL_SHADOW' => 'Shadow',
    1724         'SKILL_2H_SWORDS' => 'Two-Handed Swords',
    1725         'SKILL_HOLY' => 'Holy',
    1726         'SKILL_MACES' => 'Maces',
    1727         'SKILL_SURVIVAL' => 'Survival',
    1728         'SKILL_BEAST_MASTERY' => 'Beast Mastery',
    1729         'SKILL_GUNS' => 'Guns',
    1730         'SKILL_BOWS' => 'Bows',
    1731         'SKILL_AXES' => 'Axes',
    1732         'SKILL_SWORDS' => 'Swords',
    1733         'SKILL_POISONS' => 'Poisons',
    1734         'SKILL_SUBTLETY' => 'Subtlery',
    1735         'SKILL_COMBAT' => 'Combat',
    1736         'SKILL_ARMS' => 'Arms',
    1737         'SKILL_FIRE' => 'Fire',
    1738         'SKILL_FROST' => 'Frost',
     1666        'SKILL_RIDING' => 'Âåðõ.Åçäà',
     1667        'SKILL_LANG_DRAENEI' => 'ßçûê Äðàåíåé',
     1668        'SKILL_JEWELCRAFTING' => 'Þâåëèð',
     1669        'SKILL_RIDING_KODO' => 'Åçäà íà êîäî',
     1670        'SKILL_LANG_GUTTERSPEAK' => 'ßçûê Ãàòòåð',
     1671        'SKILL_LOCKPICKING' => 'Âçëîìùèê',
     1672        'SKILL_DISCIPLINE' => 'Äèñöèïëèíà',
     1673        'SKILL_DESTRUCTION' => 'Óíè÷òîæåíèå',
     1674        'SKILL_BALANCE' => 'Áàëàíñ',
     1675        'SKILL_RIDING_UNDEAD_HORSE' => 'Åçäà íà äîõëîøàäè',
     1676        'SKILL_RIDING_MECHANOSTRIDER' => 'Åçäà íà ìåõàíîñòðàóñå',
     1677        'SKILL_RIDING_RAPTOR' => 'Åçäà íà ðàïòîðå',
     1678        'SKILL_FIST_WEAPONS' => 'Êàñòåòû',
     1679        'SKILL_SHIELD' => 'Øèò',
     1680        'SKILL_CLOTH' => 'Òêàíü',
     1681        'SKILL_LEATHER' => 'Êîæà',
     1682        'SKILL_MAIL' => 'Êîëü÷óãà',
     1683        'SKILL_SKINNING' => 'Ñêîðíÿê',
     1684        'SKILL_ELEMENTAL_COMBAT' => 'Ñòèõèéíûé áîé',
     1685        'SKILL_RESTORATION' => 'Ëå÷åíèå',
     1686        'SKILL_ENHANCEMENT' => 'Óëó÷øåíèå',
     1687        'SKILL_FISHING' => 'Ðûáîëîâñòâî',
     1688        'SKILL_AFFLICTION' => 'Àôôèëèêöèÿ',
     1689        'SKILL_DEMONOLOGY' => 'Äåìîíîëîãèÿ',
     1690        'SKILL_ENCHANTING' => 'Î÷àðîâàíèå',
     1691        'SKILL_LANG_TROLL' => 'ßçûê Òðîëëåé',
     1692        'SKILL_LANG_GNOMISH' => 'ßçûê Ãíîìîâ',
     1693        'SKILL_PLATE_MAIL' => 'Ïëàñòèí÷àòûé äîñïåõ',
     1694        'SKILL_PET_TALENTS' => 'Ïðèó÷åíèå',
     1695        'SKILL_BEAST_TRAINING' => 'Òðåíèðîâêà çâåðåé',
     1696        'SKILL_PROTECTION' => 'Îáîðîíà',
     1697        'SKILL_FURY' => 'ßðîñòü',
     1698        'SKILL_ASSASSINATION' => 'Óáèéñòâî',
     1699        'SKILL_ARCANE' => 'Òàéíîå',
     1700        'SKILL_POLEARMS' => 'Àëåáàðäû',
     1701        'SKILL_WANDS' => 'Ïàëêè',
     1702        'SKILL_SPEARS' => 'Êîïüÿ',
     1703        'SKILL_CROSSBOWS' => 'Àðáàëåòû',
     1704        'SKILL_WEAPON_TALENTS' => 'Îðóæåéíûå òàëàíòû',
     1705        'SKILL_ENGINERING' => 'Èíæåíåð',
     1706        'SKILL_TAILORING' => 'Ïîðòíîé',
     1707        'SKILL_MINING' => 'Øàõòåð',
     1708        'SKILL_COOKING' => 'Ïîâàð',
     1709        'SKILL_RETRIBUTION' => 'Âîçìåçäèå',
     1710        'SKILL_HERBALISM' => 'Ãåðáàëèñò',
     1711        'SKILL_THROWN' => 'Ìåòàíèå',
     1712        'SKILL_DAGGERS' => 'Êèíæàëû',
     1713        'SKILL_2H_AXES' => 'Äâóðó÷.Òîïîðû',
     1714        'SKILL_ALCHEMY' => 'Àëõèìèÿ',
     1715        'SKILL_LEATHERWORKING' => 'Êîæåâíèê',
     1716        'SKILL_BLACKSMITHING' => 'Êóçíåö',
     1717        'SKILL_MARKSMANSHIP' => 'Ñíàéïåð',
     1718        'SKILL_UNARMED' => 'Áîðüáà',
     1719        'SKILL_2H_MACES' => 'Äâóðó÷.Áóëàâû',
     1720        'SKILL_RIDING_TIGER' => 'Åçäà íà òèãðå',
     1721        'SKILL_RIDING_RAM' => 'Åçäà íà áàðàíå',
     1722        'SKILL_RIDING_WOLF' => 'Åçäà íà âîëêå',
     1723        'SKILL_RIDING_HORSE' => 'Åçäà íà ëîøàäè',
     1724        'SKILL_LANG_OLD_TONGUE' => 'ßçûê Äðåâíèõ',
     1725        'SKILL_LANG_TITAN' => 'ßçûê Òèòàíîâ',
     1726        'SKILL_LANG_DEMON_TONGUE' => 'ßçûê Äåìîíîâ',
     1727        'SKILL_LANG_DRACONIC' => 'ßçûê Äðàêîíîâ',
     1728        'SKILL_LANG_THALASSIAN' => 'ßçûê Òàëàññêèé',
     1729        'SKILL_STAVES' => 'Ïîñîõè',
     1730        'SKILL_FERAL_COMBAT' => 'Çâåðèíûé áîé',
     1731        'SKILL_FIRST_AID' => 'Ñàíèòàð',
     1732        'SKILL_DUAL_WIELD' => 'Îáîåðó÷üå',
     1733        'SKILL_LANG_TAURAHE' => 'ßçûê Òàóðåí',
     1734        'SKILL_LANG_DARNASSIAN' => 'ßçûê Äàðíàññêèé',
     1735        'SKILL_LANG_DWARVEN' => 'ßçûê Äâàðôñêèé',
     1736        'SKILL_LANG_ORCISH' => 'ßçûê Îðêñêèé',
     1737        'SKILL_LANG_COMMON' => 'ßçûê Îáùèé',
     1738        'SKILL_DEFENSE' => 'Çàùèòà',
     1739        'SKILL_SHADOW' => 'Òåíåìàãèÿ',
     1740        'SKILL_2H_SWORDS' => 'Äâóðó÷.Ìå÷è',
     1741        'SKILL_HOLY' => 'Ñâÿòîìàãèÿ',
     1742        'SKILL_MACES' => 'Áóëàâû',
     1743        'SKILL_SURVIVAL' => 'Âûæèâàíèå',
     1744        'SKILL_BEAST_MASTERY' => 'Çâåðîòðåíèðîâêà',
     1745        'SKILL_GUNS' => 'Ðóæüÿ',
     1746        'SKILL_BOWS' => 'Ëóêè',
     1747        'SKILL_AXES' => 'Òîïîðû',
     1748        'SKILL_SWORDS' => 'Ìå÷è',
     1749        'SKILL_POISONS' => 'ßäû',
     1750        'SKILL_SUBTLETY' => 'Òîíêîñòü',
     1751        'SKILL_COMBAT' => 'Áîé',
     1752        'SKILL_ARMS' => 'Ðóêè',
     1753        'SKILL_FIRE' => 'Îãîíü',
     1754        'SKILL_FROST' => 'Ìîðîç',
    17391755        //------ItemSets-----
    17401756        'Set696' => 'High Warlord\'s Wartide',
  • minimanager/lang/trTR.php

    r5 r19  
    2828        'none' => 'hiçbiri',
    2929        'delete' => 'Sil',
     30        'delete_short' => 'Del.',
    3031        'edit' => 'Düzenle',
    3132        'yes' => 'EVET',
     
    257258        'no_act_quests' => 'Aktif görev bulunamadý.',
    258259        'quest_id' => 'ID',
     260        'quest_level' => 'lvl',
    259261        'quest_title' => 'Görev Adý',
    260262        'professions' => 'Professions', //TODO
    261263        'skills' => 'Skills', //TODO
     264        'skill_id' => 'ID', //TODO
     265        'skill_name' => 'Skill Name', //TODO
     266        'skill_value' => 'Value', //TODO
     267        // --- $skill_rank_array ---
     268        'apprentice' => 'Apprentice', //TODO: Translate
     269        'journeyman' => 'Journeyman', //TODO: Translate
     270        'expert' => 'Expert', //TODO: Translate
     271        'artisan' => 'artisan', //TODO: Translate
     272        'master' => 'Master', //TODO: Translate
     273        'inherent' => 'Inherent', //TODO: Translate
     274        'wise' => 'Wise', //TODO: Translate
    262275        // ---- edit_char.php ----
    263276        'update' => 'Karakter Verisi Güncelle',
     
    594607$lang_mail = array(
    595608        // ----- MAIL.PHP -----
    596         'mail_options_type' => 'Posta Seçenekleri / Tip',
     609        'mail_type' => 'Mail Type',
     610        'mail_options' => 'Mail Options',
    597611        'email' => 'E-Posta',
    598612        'ingame_mail' => 'OyunÝçi Posta',
     
    632646$lang_run_patch = array(
    633647        // -----RUN_PATCH.PHP -----
    634         'err_in_line' => 'MySQL sözdizimi hatasý, sorgu no ',
     648        'err_in_line' => 'SQL sözdizimi hatasý, sorgu no ',
    635649        'run_sql_file_only' => 'Sadece .sql veya .qbquery dosyalarý çalýþtýrabilirsiniz.',
    636650        'file_not_found' => 'Dosya Bulunamadý!',
     
    13661380        'req_level_desc' => 'Character level required to learn this spell.',
    13671381        'check_to_delete' => '* Check checkbox next to item to delete.',
    1368         'search_results' => 'Search Results'
     1382        'search_results' => 'Search Results',
     1383        'RacialLeader' => 'Racial Leader',
     1384        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13691385        );
    13701386
     
    14911507        'total_auctions' => 'Total Auctions',
    14921508        'search_results' => 'Search Results',
    1493         'auction_over' => 'Auction Over'
     1509        'auction_over' => 'Auction Over',
     1510        'all' => 'All',
     1511        'item_id' => 'Item Id',
     1512        'item_name' => 'Item Name',
     1513        'seller_name' => 'Seller Name',
     1514        'buyer_name' => 'Buyer Name',
     1515        'tot_found' => 'Total Items Found'
    14941516);
    14951517
  • minimanager/lang/zhCN.php

    r5 r19  
    3232        'none' => 'ÎÞ',
    3333        'delete' => 'ɾ³ý',
     34        'delete_short' => 'Del.',
    3435        'edit' => '±à¼­',
    3536        'yes' => 'È·¶¨',
     
    259260        'no_act_quests' => 'δÕÒµ½½øÐÐÖеÄÈÎÎñ.',
    260261        'quest_id' => 'ÈÎÎñID',
     262        'quest_level' => 'lvl',
    261263        'quest_title' => 'ÈÎÎñ±êÌâ',
    262264        'professions' => 'Professions', //TODO
    263265        'skills' => 'Skills', //TODO
     266        'skill_id' => 'ID', //TODO
     267        'skill_name' => 'Skill Name', //TODO
     268        'skill_value' => 'Value', //TODO
     269        // --- $skill_rank_array ---
     270        'apprentice' => 'Apprentice', //TODO: Translate
     271        'journeyman' => 'Journeyman', //TODO: Translate
     272        'expert' => 'Expert', //TODO: Translate
     273        'artisan' => 'artisan', //TODO: Translate
     274        'master' => 'Master', //TODO: Translate
     275        'inherent' => 'Inherent', //TODO: Translate
     276        'wise' => 'Wise', //TODO: Translate
    264277        // ---- edit_char.php ----
    265278        'update' => '¸üÐÂÈËÎïÊý¾Ý',
     
    596609$lang_mail = array(
    597610        // ----- MAIL.PHP -----
    598         'mail_options_type' => 'ÓʼþÑ¡Ïî /ÀàÐÍ',
     611        'mail_type' => 'Mail Type',
     612        'mail_options' => 'Mail Options',
    599613        'email' => 'Óʼþ',
    600614        'ingame_mail' => 'ÓÎÏ·ÖÐÓʼþ',
     
    634648$lang_run_patch = array(
    635649        // -----RUN_PATCH.PHP -----
    636         'err_in_line' => 'MYSQLÓï·¨´íÎóÊý×Ö ',
     650        'err_in_line' => 'SQLÓï·¨´íÎóÊý×Ö ',
    637651        'run_sql_file_only' => 'ÄãÖ»ÄÜÔËÐÐ . sql »ò.qbquery Îļþ.',
    638652        'file_not_found' => 'ûÕÒµ½Îļþ!',
     
    13691383        'req_level_desc' => 'Character level required to learn this spell.',
    13701384        'check_to_delete' => '* Check checkbox next to item to remove from template.',
    1371         'search_results' => 'Search Results'
     1385        'search_results' => 'Search Results',
     1386        'RacialLeader' => 'Racial Leader',
     1387        'RacialLeader_desc' => 'Set to 1 if the creature is Racial Leader'
    13721388        );
    13731389
     
    14941510        'total_auctions' => 'Total Auctions',
    14951511        'search_results' => 'Search Results',
    1496         'auction_over' => 'Auction Over'
     1512        'auction_over' => 'Auction Over',
     1513        'all' => 'All',
     1514        'item_id' => 'Item Id',
     1515        'item_name' => 'Item Name',
     1516        'seller_name' => 'Seller Name',
     1517        'buyer_name' => 'Buyer Name',
     1518        'tot_found' => 'Total Items Found'
    14971519);
    14981520
  • minimanager/login.php

    r5 r19  
    1919 if ( empty($_POST['user']) || empty($_POST['pass']) ) redirect("login.php?error=2");
    2020
    21  $mysql = new MySQL;
    22  $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    23 
    24  $user_name  = $mysql->quote_smart($_POST['user']);
    25  $user_pass  = $mysql->quote_smart($_POST['pass']);
    26 
    27  $result = $mysql->query("SELECT id,gmlevel,username FROM account WHERE username='$user_name' AND I='$user_pass' ");
    28 
    29  if ($mysql->num_rows($result) == 1) {
    30         $id = $mysql->result($result, 0, 'id');
    31         $result1 = $mysql->query("SELECT count(*) FROM account_banned WHERE id ='$id'");
    32         if ($mysql->result($result1, 0)) {
    33                 $mysql->close();
     21 $sql = new SQL;
     22 $link = $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     23
     24 $user_name  = $sql->quote_smart($_POST['user']);
     25 $user_pass  = $sql->quote_smart($_POST['pass']);
     26
     27 $result = $sql->query("SELECT id,gmlevel,username FROM account WHERE username='$user_name' AND I='$user_pass' ");
     28
     29 if ($sql->num_rows($result) == 1) {
     30        $id = $sql->result($result, 0, 'id');
     31        $result1 = $sql->query("SELECT count(*) FROM account_banned WHERE id ='$id'");
     32        if ($sql->result($result1, 0)) {
     33                $sql->close();
    3434                redirect("login.php?error=3");
    3535          } else {
    3636                        $_SESSION['user_id'] = $id;
    37                         $_SESSION['uname'] = $mysql->result($result, 0, 'username');
    38                         $_SESSION['user_lvl'] = $mysql->result($result, 0, 'gmlevel');
    39                         $_SESSION['realm_id'] = $mysql->quote_smart($_POST['realm']);
     37                        $_SESSION['uname'] = $sql->result($result, 0, 'username');
     38                        $_SESSION['user_lvl'] = $sql->result($result, 0, 'gmlevel');
     39                        $_SESSION['realm_id'] = $sql->quote_smart($_POST['realm']);
    4040                        $_SESSION['client_ip'] = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : getenv('REMOTE_ADDR');
    4141
     
    4545                                        setcookie("p_hash", $user_pass, time()+60*60*24*7);
    4646                                }
    47                                 $mysql->close();
     47                                $sql->close();
    4848                                redirect("index.php");
    4949                        }
    5050   } else {
    51                 $mysql->close();
     51                $sql->close();
    5252                redirect("login.php?error=1");
    5353        }
     
    9090        </tr>";
    9191
    92  $mysql = new MySQL;
    93  $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    94  $result = $mysql->query("SELECT id,name FROM `realmlist` LIMIT 10");
    95 
    96  if ($mysql->num_rows($result)>1){
     92 $sql = new SQL;
     93 $link = $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     94 $result = $sql->query("SELECT id,name FROM `realmlist` LIMIT 10");
     95
     96 if ($sql->num_rows($result)>1){
    9797        $output .= "<tr align=\"left\">
    9898                        <td colspan=\"2\">{$lang_login['select_realm']} :
    9999                         <select name=\"realm\">";
    100100                         
    101         while ($realm = $mysql->fetch_row($result)){
     101        while ($realm = $sql->fetch_row($result))
    102102                $output .= "<option value=\"$realm[0]\">$realm[1]</option>";
    103                 }
     103
    104104        $output .= "</select></td></tr>";
    105105        } else {
    106                 $output .= "<input type=\"hidden\" name=\"realm\" value=\"".$mysql->result($result, 0, 'id')."\" />";
     106                $output .= "<input type=\"hidden\" name=\"realm\" value=\"".$sql->result($result, 0, 'id')."\" />";
    107107                }
    108  $mysql->close();
     108 $sql->close();
    109109 
    110110 $output .= "<tr align=\"left\">
     
    131131//#################################################################################################
    132132function do_cookie_login(){
    133 global $lang_global, $realm_db;
     133 global $lang_global, $realm_db;
    134134
    135135 if ( empty($_COOKIE['uname']) || empty($_COOKIE['p_hash']) || empty($_COOKIE['realm_id'])) redirect("login.php?error=2");
    136136
    137  $mysql = new MySQL;
    138  $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    139  $user_name = $mysql->quote_smart($_COOKIE['uname']);
    140  $user_pass  = $mysql->quote_smart($_COOKIE['p_hash']);
    141 
    142  $result = $mysql->query("SELECT username,gmlevel,id FROM account WHERE username='$user_name' AND I='$user_pass'");
    143 
    144  if ($mysql->num_rows($result) == 1) {
    145         $id = $mysql->result($result, 0, 'id');
    146         $result1 = $mysql->query("SELECT count(*) FROM account_banned WHERE id ='$id'");
    147         if ($mysql->result($result1, 0)) {
    148                 $mysql->close();
     137 $sql = new SQL;
     138 $link = $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     139 $user_name = $sql->quote_smart($_COOKIE['uname']);
     140 $user_pass  = $sql->quote_smart($_COOKIE['p_hash']);
     141
     142 $result = $sql->query("SELECT username,gmlevel,id FROM account WHERE username='$user_name' AND I='$user_pass'");
     143
     144 if ($sql->num_rows($result)) {
     145        $id = $sql->result($result, 0, 'id');
     146        $result1 = $sql->query("SELECT count(*) FROM account_banned WHERE id ='$id'");
     147        if ($sql->result($result1, 0)) {
     148                $sql->close();
    149149                redirect("login.php?error=3");
    150150          } else {
    151151                        $_SESSION['user_id'] = $id;
    152                         $_SESSION['uname'] = $mysql->result($result, 0, 'username');
    153                         $_SESSION['user_lvl'] = $mysql->result($result, 0, 'gmlevel');
    154                         $_SESSION['realm_id'] = $mysql->quote_smart($_COOKIE['realm_id']);
     152                        $_SESSION['uname'] = $sql->result($result, 0, 'username');
     153                        $_SESSION['user_lvl'] = $sql->result($result, 0, 'gmlevel');
     154                        $_SESSION['realm_id'] = $sql->quote_smart($_COOKIE['realm_id']);
    155155                        $_SESSION['client_ip'] = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : getenv('REMOTE_ADDR');
    156156                                       
    157                         $mysql->close();
     157                        $sql->close();
    158158                        redirect("index.php");
    159159                 }
    160160 } else {
    161         $mysql->close();
     161        $sql->close();
    162162        setcookie ("uname", "", time() - 3600);
    163163        setcookie ("realm_id", "", time() - 3600);
     
    173173if (isset($_COOKIE["uname"]) && isset($_COOKIE["p_hash"]) && isset($_COOKIE["realm_id"]) && !isset($_GET['error'])) {
    174174        do_cookie_login();
    175         exit();
    176175 }
    177176
  • minimanager/mail.php

    r5 r19  
    2323                        <form action=\"mail.php?action=send_mail\" method=\"post\" name=\"form\">
    2424                                 <fieldset style=\"width: 770px;\">
    25                                         <legend>{$lang_mail['mail_options_type']}</legend>
     25                                        <legend>{$lang_mail['mail_type']}</legend>
    2626                                        <br />
    2727                                        <table class=\"top_hidden\" style=\"width: 720px;\">
     
    9494 }
    9595 
    96  $mysql = new MySQL;
    97  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
    98  
    99  $body = $mysql->quote_smart($_POST['body']);
    100  $subject = $mysql->quote_smart($_POST['subject']);
     96 $sql = new SQL;
     97 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     98 
     99 $body = $sql->quote_smart($_POST['body']);
     100 $subject = $sql->quote_smart($_POST['subject']);
    101101               
    102  if(isset($_POST['to'])&&($_POST['to'] != '')) $to = $mysql->quote_smart($_POST['to']);
     102 if(isset($_POST['to'])&&($_POST['to'] != '')) $to = $sql->quote_smart($_POST['to']);
    103103        else {
    104104                        $to = 0;
     
    106106                                redirect("mail.php?error=1");
    107107                                } else {
    108                                                 $group_value = $mysql->quote_smart($_POST['group_value']);
    109                                                 $group_sign = $mysql->quote_smart($_POST['group_sign']);
    110                                                 $group_send = $mysql->quote_smart($_POST['group_send']);
     108                                                $group_value = $sql->quote_smart($_POST['group_value']);
     109                                                $group_sign = $sql->quote_smart($_POST['group_sign']);
     110                                                $group_send = $sql->quote_smart($_POST['group_send']);
    111111                                                }
    112112                        }
    113113
    114114 $type = addslashes($_POST['type']);
    115  $att_gold = $mysql->quote_smart($_POST['money']);
    116  $att_item = $mysql->quote_smart($_POST['att_item']);
    117  $att_stack = $mysql->quote_smart($_POST['att_stack']);
     115 $att_gold = $sql->quote_smart($_POST['money']);
     116 $att_item = $sql->quote_smart($_POST['att_item']);
     117 $att_stack = $sql->quote_smart($_POST['att_stack']);
    118118 
    119119switch ($type) {
    120120case "email":
    121121
    122  require_once("scripts/class.phpmailer.php");
     122 require_once("scripts/mailer/class.phpmailer.php");
    123123 $mail = new PHPMailer();
    124124                $mail->Mailer = $mailer_type;
     
    157157 
    158158 } elseif (isset($group_value)){ //group send
    159                         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     159                        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    160160                       
    161161                        $email_array = array();
    162162                        switch ($group_send) {
    163163                        case "gm_level":
    164                                 $result = $mysql->query("SELECT email FROM account WHERE gmlevel $group_sign '$group_value'");
    165                                 while($user = $mysql->fetch_row($result)){
     164                                $result = $sql->query("SELECT email FROM account WHERE gmlevel $group_sign '$group_value'");
     165                                while($user = $sql->fetch_row($result)){
    166166                                        if($user[0] != "") array_push($email_array, $user[0]);
    167167                                        }
     
    169169 
    170170                        case "locked":
    171                                 $result = $mysql->query("SELECT email FROM account WHERE locked $group_sign '$group_value'");
    172                                 while($user = $mysql->fetch_row($result)){
     171                                $result = $sql->query("SELECT email FROM account WHERE locked $group_sign '$group_value'");
     172                                while($user = $sql->fetch_row($result)){
    173173                                        if($user[0] != "") array_push($email_array, $user[0]);
    174174                                        }
     
    176176
    177177                        case "banned":
    178                                 $que = $mysql->query("SELECT id FROM account_banned");
    179                                 while ($banned = mysql_fetch_row($que)){
    180                                         $result = $mysql->query("SELECT email FROM account WHERE id = '$banned[0]'");
    181                                         if($mysql->result($result, 0, 'email')) array_push($email_array, $mysql->result($result, 0, 'email'));                                 
     178                                $que = $sql->query("SELECT id FROM account_banned");
     179                                while ($banned = $sql->fetch_row($que)){
     180                                        $result = $sql->query("SELECT email FROM account WHERE id = '$banned[0]'");
     181                                        if($sql->result($result, 0, 'email')) array_push($email_array, $sql->result($result, 0, 'email'));                                     
    182182                                        }
    183183                        break;
    184184       
    185185                        default:
    186                         $mysql->close();
     186                        $sql->close();
    187187                        redirect("mail.php?error=5");
    188188                        }
    189                         $mysql->close();
     189                        $sql->close();
    190190
    191191                        foreach ($email_array as $mail_addr){
     
    206206
    207207case "ingame_mail":
    208  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     208 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    209209 
    210210 require_once("scripts/gen_lib.php");
    211211 
    212212 if($to){ //single Recipient
    213         $result = $mysql->query("SELECT guid FROM `character` WHERE name ='$to'");
    214 
    215         if ($mysql->num_rows($result) == 1) {
    216                 $receiver = $mysql->result($result, 0, 'guid');
     213        $result = $sql->query("SELECT guid FROM `character` WHERE name ='$to'");
     214
     215        if ($sql->num_rows($result) == 1) {
     216                $receiver = $sql->result($result, 0, 'guid');
    217217
    218218                send_ingame_mail($receiver, 0, $subject, $body, $att_gold, $att_item, $att_stack);
    219219               
    220220        } else {
    221                         $mysql->close();
     221                        $sql->close();
    222222                        redirect("mail.php?error=4");
    223223                        }
    224         $mysql->close();
     224        $sql->close();
    225225        redirect("mail.php?error=2");
    226226        break;
     
    229229                        switch ($group_send) {
    230230                        case "gm_level":
    231                                 $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    232                                 $result = $mysql->query("SELECT id FROM account WHERE gmlevel $group_sign '$group_value'");
    233                                 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    234                                 while($acc = $mysql->fetch_row($result)){
    235                                         $result_2 = $mysql->query("SELECT guid FROM `character` WHERE account = '$acc[0]'");
    236                                         while($char = $mysql->fetch_row($result_2)) array_push($char_array, $char[0]);
     231                                $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     232                                $result = $sql->query("SELECT id FROM account WHERE gmlevel $group_sign '$group_value'");
     233                                $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     234                                while($acc = $sql->fetch_row($result)){
     235                                        $result_2 = $sql->query("SELECT guid FROM `character` WHERE account = '$acc[0]'");
     236                                        while($char = $sql->fetch_row($result_2)) array_push($char_array, $char[0]);
    237237                                        }
    238238                        break;
    239239 
    240240                        case "online":
    241                                 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    242                                 $result = $mysql->query("SELECT guid FROM `character` WHERE online $group_sign '$group_value'");
    243                                 while($user = $mysql->fetch_row($result)) array_push($char_array, $user[0]);
     241                                $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     242                                $result = $sql->query("SELECT guid FROM `character` WHERE online $group_sign '$group_value'");
     243                                while($user = $sql->fetch_row($result)) array_push($char_array, $user[0]);
    244244                        break;
    245245
    246246                        case "char_level":
    247                                 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    248                                 $result = $mysql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $group_sign '$group_value'");
    249                                 while($user = $mysql->fetch_row($result)) array_push($char_array, $user[0]);
     247                                $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     248                                $result = $sql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $group_sign '$group_value'");
     249                                while($user = $sql->fetch_row($result)) array_push($char_array, $user[0]);
    250250                        break;
    251251                         
    252252                        default:
    253                         $mysql->close();
     253                        $sql->close();
    254254                        redirect("mail.php?error=5");
    255255                        }
     
    259259                                send_ingame_mail($receiver, 0, $subject, $body, $att_gold, $att_item, $att_stack);
    260260                        }
    261                         $mysql->close();
     261                        $sql->close();
    262262                        redirect("mail.php?error=2");
    263263 }
  • minimanager/mail_templates/terms.tpl

    r5 r19  
    1 Terms of Service
     1Terms of Service\n\n
    22
    33TO BE FILLED !!!
  • minimanager/motd.php

    r5 r19  
    1010 
    1111require_once("header.php");
     12require_once("scripts\bbcode_lib.php");
    1213valid_login(1);
    1314
    1415//#####################################################################################################
    15 // print add motd
     16// ADD MOTD
    1617//#####################################################################################################
    1718function add_motd(){
    18  global $lang_motd,$output;
    19  
    20 $output .= "<center>
     19 global $lang_motd, $lang_global, $output;
     20 
     21 $output .= "<center>
    2122                        <form action=\"motd.php?action=do_add_motd\" method=\"post\" name=\"form\">             
    2223                        <table class=\"top_hidden\">
     24                                <tr><td colspan=\"4\">";
     25                                        add_bbcode_editor();
     26 $output .= " </td></tr>
     27                                <tr><td colspan=\"4\">
     28                                        <textarea id=\"msg\" name=\"msg\" rows=\"10\" cols=\"93\"></textarea>
     29                                </td></tr>
    2330                                <tr>
    24                                  <td align=\"left\">";
    25                                  makebutton($lang_motd['post_motd'], "javascript:do_submit()",220);
    26         $output .= "</td>
    27                                  <td align=\"right\">{$lang_motd['post_rules']}</td>
    28                                 </tr></table>
    29                         <textarea name=\"msg\" rows=\"8\" cols=\"93\"></textarea><br />
    30                         </form><br /><br />
     31                                        <td>{$lang_motd['post_rules']}</td>
     32                                        <td>";
     33                                        makebutton($lang_motd['post_motd'], "javascript:do_submit()",220);
     34$output .= "    <td/><td>";
     35                                        makebutton($lang_global['back'], "javascript:window.history.back()",220);
     36$output .= "    </td>
     37                                </tr>
     38                        </table>
     39                        </form>
     40                        <br /><br />
    3141                        </center>";
    3242}
     
    4151if (empty($_POST['msg'])) redirect("motd.php?error=1");
    4252
    43  $mysql = new MySQL;
    44  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    45  
    46  $msg = $mysql->quote_smart($_POST['msg']);
    47 
    48  if (strlen($msg) > 254){
    49         $mysql->close();
     53 $sql = new SQL;
     54 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     55 
     56 $msg = $sql->quote_smart($_POST['msg']);
     57
     58 if (strlen($msg) > 4096){
     59        $sql->close();
    5060    redirect("motd.php?error=2");
    5161   }
    52    
    53  $msg = str_replace('\n', '<br />', $msg);
    54  $msg = str_replace('\r', '<br />', $msg);
    55  $msg = preg_replace( "/([^\/=\"\]])((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>",  $msg);
    56  $msg = preg_replace('/([^\/=\"\]])(www\.)(\S+)/', '\\1<a href="http://\\2\\3" target="_blank">\\2\\3</a>', $msg);
    57 
    58  $by = date("m/d/y H:i:s")." Posted by: $user_name";
    59 
    60  $query = $mysql->query("INSERT INTO bugreport (type, content) VALUES ('$by','$msg')");
    61  
    62  $mysql->close();
     62 
     63  $by = date("m/d/y H:i:s")." Posted by: $user_name";
     64
     65 $sql->query("INSERT INTO bugreport (type, content) VALUES ('$by','$msg')");
     66 $sql->close();
     67
     68 redirect("index.php");
     69}
     70
     71//#####################################################################################################
     72// EDIT MOTD
     73//#####################################################################################################
     74function edit_motd(){
     75 global $lang_motd,$lang_global, $output, $mangos_db, $realm_id;
     76 
     77 $sql = new SQL;
     78 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     79 
     80 if(isset($_GET['id'])) $id = $sql->quote_smart($_GET['id']);
     81        else redirect("motd.php?error=1");
     82 
     83 $result = $sql->query("SELECT content FROM bugreport WHERE id = '$id'");
     84 $msg = $sql->result($result, 0);
     85 $sql->close();
     86 
     87 $output .= "<center>
     88                        <form action=\"motd.php?action=do_edit_motd\" method=\"post\" name=\"form\">
     89                        <input type=\"hidden\" name=\"id\" value=\"$id\" />
     90                        <table class=\"top_hidden\">
     91                                <tr><td colspan=\"4\">";
     92                                        add_bbcode_editor();
     93 $output .= "</td></tr>
     94                                <tr>
     95                                        <td colspan=\"4\">
     96                                        <textarea id=\"msg\" name=\"msg\" rows=\"10\" cols=\"93\">$msg</textarea>
     97                                        </td>
     98                                </tr>
     99                                <tr>
     100                                        <td>{$lang_motd['post_rules']}</td>
     101                                        <td>";
     102                                        makebutton($lang_motd['post_motd'], "javascript:do_submit()",220);
     103$output .= "    <td/><td>";
     104                                        makebutton($lang_global['back'], "javascript:window.history.back()",220);
     105$output .= "</td>
     106                                </tr>
     107                        </table>
     108                        </form>
     109                        <br /><br />
     110                        </center>";
     111}
     112
     113
     114//#####################################################################################################
     115// DO EDIT MOTD
     116//#####################################################################################################
     117function do_edit_motd(){
     118 global  $lang_global, $mangos_db, $realm_id, $user_name;
     119 
     120 if (empty($_POST['msg']) || empty($_POST['id'])) redirect("motd.php?error=1");
     121
     122 $sql = new SQL;
     123 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     124 
     125 $msg = $sql->quote_smart($_POST['msg']);
     126 $id = $sql->quote_smart($_POST['id']);
     127 
     128 $by = $sql->result($sql->query("SELECT type FROM bugreport WHERE id = '$id'"), 0, 'type');
     129
     130 if (strlen($msg) > 4096){
     131        $sql->close();
     132    redirect("motd.php?error=2");
     133   }
     134 
     135 $by = split("<br />", $by, 2);
     136 $by = "{$by[0]}<br />".date("m/d/y H:i:s")." Edited by: $user_name";
     137
     138 $sql->query("UPDATE bugreport SET type = '$by', content = '$msg' WHERE id = '$id'");
     139 $sql->close();
    63140
    64141 redirect("index.php");
     
    74151 if (empty($_GET['id'])) redirect("index.php");
    75152
    76  $mysql = new MySQL;
    77  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    78  
    79  $id = $mysql->quote_smart($_GET['id']);
    80 
    81  $query = $mysql->query("DELETE FROM bugreport WHERE id ='$id'");
    82  
    83  $mysql->close();
     153 $sql = new SQL;
     154 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     155 
     156 $id = $sql->quote_smart($_GET['id']);
     157
     158 $query = $sql->query("DELETE FROM bugreport WHERE id ='$id'");
     159 
     160 $sql->close();
    84161 redirect("index.php");
    85162}
     
    116193        do_add_motd();
    117194        break;
     195case "edit_motd":
     196        edit_motd();
     197        break;
     198case "do_edit_motd":
     199        do_edit_motd();
     200        break;
    118201default:
    119202    add_motd();
  • minimanager/pomm/pomm.css

    r5 r19  
    77        background-color: #000000;
    88}
     9img {
     10        border: 0px;
     11        padding: 0px;
     12}
    913#world_map {
    1014        position: absolute;
     
    1317        left: 50%;
    1418        margin-left: -392px;
    15         background-image: url(img/map.jpg);
     19        background-image: url(../img/map.jpg);
    1620        z-index: 10;
    1721}
     
    6064        text-align: center;
    6165        padding: 3px;
    62         filter:alpha(opacity=70);
    63         -moz-opacity:.70;
    64         opacity:0.70;
     66        filter:alpha(opacity=75);
     67        -moz-opacity:.75;
     68        opacity:0.75;
    6569}
    6670.tip_text td {
  • minimanager/pomm/pomm.php

    r5 r19  
    5454        while (i<data.length) {
    5555                if (data[i].race==2 || data[i].race==5 || data[i].race==6 || data[i].race==8 || data[i].race==10)
    56                         {point="img/h_point.gif";}
    57                         else {point="img/a_point.gif";}
    58                 text=text+'<img src="'+point+'" style="position: absolute; border: 0px; left: '+data[i].x+'px; top: '+data[i].y+'px;" onmousemove="toolTip(\'<spawn>'+data[i].name+'</spawn><br />'+data[i].zone+'<br /><img src=\\\'img/'+data[i].race+'-'+data[i].gender+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18 /><img src=\\\'img/'+data[i].cl+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18 /><br />'+race_name[data[i].race]+'<br />'+class_name[data[i].cl]+'<br />'+data[i].level+'\',\'tip_text\');"onmouseout="toolTip();"\>';
     56                        {point="../img/h_point.gif";}
     57                        else {point="../img/a_point.gif";}
     58                text=text+'<img src="'+point+'" style="position: absolute; left: '+data[i].x+'px; top: '+data[i].y+'px;" onmousemove="toolTip(\'<spawn>'+data[i].name+'</spawn><br />'+data[i].zone+'<br /><img src=\\\'../img/c_icons/'+data[i].race+'-'+data[i].gender+'.gif\\\' style=\\\'float:center\\\' /><img src=\\\'../img/c_icons/'+data[i].cl+'.gif\\\' style=\\\'float:center\\\' /><br />'+race_name[data[i].race]+'<br />'+class_name[data[i].cl]+'<br />'+data[i].level+'\',\'tip_text\');"onmouseout="toolTip();"/>';
    5959                i++;
    6060        }
  • minimanager/pomm/pomm_lib.php

    r5 r19  
    1111require_once("../scripts/config.php");
    1212require_once("../scripts/global_lib.php");
    13 require_once("../scripts/mysql.php");
     13require_once("../scripts/db_layer.php");
    1414require_once("../scripts/get_lib.php");
    1515
     
    2727$user_id = $_SESSION['user_id'];
    2828
    29 function get_player_position($x,$y,$map) {
    30  global $zone_530;
    31 
     29function get_player_position($x,$y,$map,$zone) {
    3230 $xpos = round(($x / 1000)*17.7,0);
    3331 $ypos = round(($y / 1000)*17.7,0);
     
    4341       
    4442        case 530:
    45         $zone_id = 0;
    46         for ($i=0; $i < count($zone_530); $i++)
    47                 if (($zone_530[$i][2] < $x) && ($zone_530[$i][3] > $x) && ($zone_530[$i][1] < $y) && ($zone_530[$i][0] > $y)){
    48                         $zone_id =  $zone_530[$i][5];
    49                         break;
    50                         }
    51         if (($zone_id == 3525) || ($zone_id == 3557) || ($zone_id == 3524)){
     43        if (($zone == 3525) || ($zone == 3557) || ($zone == 3524)){
    5244                $pos['x'] = -162 - $ypos;
    5345                $pos['y'] = 75 - $xpos;
    54         } else if (($zone_id == 3487) || ($zone_id == 3433) || ($zone_id == 3430)){
     46        } else if (($zone == 3487) || ($zone == 3433) || ($zone == 3430)){
    5547                                $pos['x'] = 528 - $ypos;
    5648                                $pos['y'] = 218 - $xpos;
  • minimanager/pomm/pomm_run.php

    r5 r19  
    1414$JsHttpRequest =& new JsHttpRequest($site_encoding);
    1515
    16 $mysql = new MySQL;
    17 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     16$sql = new SQL;
     17$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1818
    1919if( !$user_lvl && !$server[$realm_id]['both_factions']){
    20         $result = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
    21         if ($mysql->num_rows($result)){
    22                 $order_side = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     20        $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     21        if ($sql->num_rows($result)){
     22                $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
    2323                " AND race IN (2,5,6,8,10) " : " AND race IN (1,3,4,7,11) ";
    2424        } else $order_side = "";
    2525} else $order_side = "";
    2626
    27 $result = $mysql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
    28                 SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1)
     27$result = $sql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
     28                SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1),zone
    2929                FROM `character` WHERE `online`= 1 $order_side");
    3030
    3131$i = 0;
    32 while($char = $mysql->fetch_row($result)){
     32while($char = $sql->fetch_row($result)){
    3333        $char_gender = str_pad(dechex($char[7]),8, 0, STR_PAD_LEFT);
    3434
    35         $pos = get_player_position($char[3],$char[4],$char[5]);
     35        $pos = get_player_position($char[3],$char[4],$char[5],$char[8]);
    3636        $arr[$i]['x'] = $pos['x'];
    3737        $arr[$i]['y'] = $pos['y'];
    3838        $arr[$i]['name'] = $char[0];
    39         if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[5], $char[3], $char[4]));
     39        if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[8]));
    4040                else $arr[$i]['zone'] = ereg_replace("'", "`", get_map_name($char[5]));
    4141        $arr[$i]['cl'] = $char[2];
     
    4646        }
    4747
    48 $mysql->close();
     48$sql->close();
    4949
    5050$_RESULT =$arr;
  • minimanager/pomm_public/pomm.css

    r5 r19  
    77        background-color: #000000;
    88}
     9img {
     10        border: 0px;
     11        padding: 0px;
     12}
    913#world_map {
    1014        position: absolute;
     
    1317        left: 50%;
    1418        margin-left: -392px;
    15         background-image: url(img/map.jpg);
     19        background-image: url(../img/map.jpg);
    1620        z-index: 10;
    1721}
     
    6064        text-align: center;
    6165        padding: 3px;
    62         filter:alpha(opacity=70);
    63         -moz-opacity:.70;
    64         opacity:0.70;
     66        filter:alpha(opacity=75);
     67        -moz-opacity:.75;
     68        opacity:0.75;
    6569}
    6670.tip_text td {
  • minimanager/pomm_public/pomm.php

    r5 r19  
    5454        while (i<data.length) {
    5555                if (data[i].race==2 || data[i].race==5 || data[i].race==6 || data[i].race==8 || data[i].race==10)
    56                         {point="img/h_point.gif";}
    57                         else {point="img/a_point.gif";}
    58                 text=text+'<img src="'+point+'" style="position: absolute; border: 0px; left: '+data[i].x+'px; top: '+data[i].y+'px;" onmousemove="toolTip(\'<spawn>'+data[i].name+'</spawn><br />'+data[i].zone+'<br /><img src=\\\'img/'+data[i].race+'-'+data[i].gender+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18 /><img src=\\\'img/'+data[i].cl+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18 /><br />'+race_name[data[i].race]+'<br />'+class_name[data[i].cl]+'<br />'+data[i].level+'\',\'tip_text\');"onmouseout="toolTip();"\>';
     56                        {point="../img/h_point.gif";}
     57                        else {point="../img/a_point.gif";}
     58                text=text+'<img src="'+point+'" style="position: absolute; left: '+data[i].x+'px; top: '+data[i].y+'px;" onmousemove="toolTip(\'<spawn>'+data[i].name+'</spawn><br />'+data[i].zone+'<br /><img src=\\\'../img/c_icons/'+data[i].race+'-'+data[i].gender+'.gif\\\' style=\\\'float:center\\\' /><img src=\\\'../img/c_icons/'+data[i].cl+'.gif\\\' style=\\\'float:center\\\' /><br />'+race_name[data[i].race]+'<br />'+class_name[data[i].cl]+'<br />'+data[i].level+'\',\'tip_text\');"onmouseout="toolTip();"/>';
    5959                i++;
    6060        }
  • minimanager/pomm_public/pomm_lib.php

    r5 r19  
    1111require_once("../scripts/config.php");
    1212require_once("../scripts/global_lib.php");
    13 require_once("../scripts/mysql.php");
     13require_once("../scripts/db_layer.php");
    1414require_once("../scripts/get_lib.php");
    1515
     
    2323
    2424if ( !ini_get('session.auto_start') ) session_start();
    25 $realm_id = 1; //$_SESSION['realm_id'];
    26 $user_lvl = 0; //$_SESSION['user_lvl'];
    27 $user_id = 1; //$_SESSION['user_id'];
    28 
    29 function get_player_position($x,$y,$map) {
    30  global $zone_530;
    31 
     25$realm_id = 1; // $_SESSION['realm_id'];
     26$user_lvl = 0; // $_SESSION['user_lvl'];
     27$user_id = 1; // $_SESSION['user_id'];
     28
     29function get_player_position($x,$y,$map,$zone) {
    3230 $xpos = round(($x / 1000)*17.7,0);
    3331 $ypos = round(($y / 1000)*17.7,0);
     
    4341       
    4442        case 530:
    45         $zone_id = 0;
    46         for ($i=0; $i < count($zone_530); $i++)
    47                 if (($zone_530[$i][2] < $x) && ($zone_530[$i][3] > $x) && ($zone_530[$i][1] < $y) && ($zone_530[$i][0] > $y)){
    48                         $zone_id =  $zone_530[$i][5];
    49                         break;
    50                         }
    51         if (($zone_id == 3525) || ($zone_id == 3557) || ($zone_id == 3524)){
     43        if (($zone == 3525) || ($zone == 3557) || ($zone == 3524)){
    5244                $pos['x'] = -162 - $ypos;
    5345                $pos['y'] = 75 - $xpos;
    54         } else if (($zone_id == 3487) || ($zone_id == 3433) || ($zone_id == 3430)){
     46        } else if (($zone == 3487) || ($zone == 3433) || ($zone == 3430)){
    5547                                $pos['x'] = 528 - $ypos;
    5648                                $pos['y'] = 218 - $xpos;
  • minimanager/pomm_public/pomm_run.php

    r5 r19  
    1414$JsHttpRequest =& new JsHttpRequest($site_encoding);
    1515
    16 $mysql = new MySQL;
    17 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     16$sql = new SQL;
     17$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1818
    1919if( !$user_lvl && !$server[$realm_id]['both_factions']){
    20         $result = $mysql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
    21         if ($mysql->num_rows($result)){
    22                 $order_side = (in_array($mysql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
     20        $result = $sql->query("SELECT race FROM `character` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");
     21        if ($sql->num_rows($result)){
     22                $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ?
    2323                " AND race IN (2,5,6,8,10) " : " AND race IN (1,3,4,7,11) ";
    2424        } else $order_side = "";
    2525} else $order_side = "";
    2626
    27 $result = $mysql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
    28                 SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1)
     27$result = $sql->query("SELECT name,race,class,position_x,position_y,map,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1),
     28                SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 37), ' ', -1),zone
    2929                FROM `character` WHERE `online`= 1 $order_side");
    3030
    3131$i = 0;
    32 while($char = $mysql->fetch_row($result)){
     32while($char = $sql->fetch_row($result)){
    3333        $char_gender = str_pad(dechex($char[7]),8, 0, STR_PAD_LEFT);
    3434
    35         $pos = get_player_position($char[3],$char[4],$char[5]);
     35        $pos = get_player_position($char[3],$char[4],$char[5],$char[8]);
    3636        $arr[$i]['x'] = $pos['x'];
    3737        $arr[$i]['y'] = $pos['y'];
    3838        $arr[$i]['name'] = $char[0];
    39         if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[5], $char[3], $char[4]));
     39        if (($char[5] == 1)||($char[5] == 0)||($char[5] == 530)) $arr[$i]['zone'] = ereg_replace("'", "`", get_zone_name($char[8]));
    4040                else $arr[$i]['zone'] = ereg_replace("'", "`", get_map_name($char[5]));
    4141        $arr[$i]['cl'] = $char[2];
     
    4646        }
    4747
    48 $mysql->close();
     48$sql->close();
    4949
    5050$_RESULT =$arr;
  • minimanager/realm.php

    r5 r19  
    3434 global $lang_global, $lang_realm, $output, $realm_db, $user_name, $server, $realm_id, $icon_type, $timezone_type;
    3535
    36  $mysql = new MySQL;
    37  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    38 
    39  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "name";
    40  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     36 $sql = new SQL;
     37 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     38
     39 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "name";
     40 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    4141 $order_dir = ($dir) ? "ASC" : "DESC";
    4242 $dir = ($dir) ? 0 : 1;
    4343 
    44  $result = $mysql->query("SELECT id,name,address,port,icon,color,timezone FROM `realmlist` ORDER BY $order_by $order_dir");
    45  $total_realms = $mysql->num_rows($result);
     44 $result = $sql->query("SELECT `realmlist`.id AS rid,name,address,port,icon,color,timezone,
     45                                                (SELECT SUM(numchars) FROM realmcharacters WHERE realmid = rid)
     46                                                FROM `realmlist` ORDER BY $order_by $order_dir");
     47 $total_realms = $sql->num_rows($result);
    4648
    4749 $output .= "<center><table class=\"top_hidden\">
     
    5456   <table class=\"lined\">
    5557   <tr>
    56         <td width=\"5%\" class=\"head\">{$lang_global['delete']}</td>
    57         <td width=\"40%\" class=\"head\"><a href=\"realm.php?order_by=name&amp;dir=$dir\" class=\"head_link\">{$lang_realm['name']}</a></td>
    58         <td width=\"5%\" class=\"head\">{$lang_realm['online']}</td>
    59         <td width=\"10%\" class=\"head\">{$lang_realm['tot_char']}</td>
    60         <td width=\"10%\" class=\"head\"><a href=\"realm.php?order_by=address&amp;dir=$dir\" class=\"head_link\">{$lang_realm['address']}</a></td>
    61         <td width=\"5%\" class=\"head\"><a href=\"realm.php?order_by=port&amp;dir=$dir\" class=\"head_link\">{$lang_realm['port']}</a></td>
    62         <td width=\"8%\" class=\"head\"><a href=\"realm.php?order_by=icon&amp;dir=$dir\" class=\"head_link\">{$lang_realm['icon']}</a></td>
    63     <td width=\"5%\" class=\"head\"><a href=\"realm.php?order_by=color&amp;dir=$dir\" class=\"head_link\">{$lang_realm['color']}</a></td>
    64         <td width=\"7%\" class=\"head\"><a href=\"realm.php?order_by=timezone&amp;dir=$dir\" class=\"head_link\">{$lang_realm['timezone']}</a></td>
     58        <th width=\"5%\">{$lang_global['delete_short']}</th>
     59        <th width=\"40%\"><a href=\"realm.php?order_by=name&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['name']}</a></th>
     60        <th width=\"5%\">{$lang_realm['online']}</th>
     61        <th width=\"10%\">{$lang_realm['tot_char']}</th>
     62        <th width=\"10%\"><a href=\"realm.php?order_by=address&amp;dir=$dir\">".($order_by=='address' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['address']}</a></th>
     63        <th width=\"5%\"><a href=\"realm.php?order_by=port&amp;dir=$dir\">".($order_by=='port' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['port']}</a></th>
     64        <th width=\"8%\"><a href=\"realm.php?order_by=icon&amp;dir=$dir\">".($order_by=='icon' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['icon']}</a></th>
     65    <th width=\"5%\"><a href=\"realm.php?order_by=color&amp;dir=$dir\">".($order_by=='color' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['color']}</a></th>
     66        <th width=\"7%\"><a href=\"realm.php?order_by=timezone&amp;dir=$dir\">".($order_by=='timezone' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_realm['timezone']}</a></th>
    6567   </tr>";
    6668
    67  while ($realm = $mysql->fetch_row($result)){
    68         $output .= "<tr><td><a href=\"realm.php?action=del_realm&amp;id=$realm[0]\"><img src=\"img/x.ico\" class=\"no_border\" alt=\"\" /></a></td>";
     69 while ($realm = $sql->fetch_row($result)){
     70        $output .= "<tr><td><a href=\"realm.php?action=del_realm&amp;id=$realm[0]\"><img src=\"img/aff_cross.png\" alt=\"\" /></a></td>";
    6971        if (isset($server[$realm[0]]['game_port'])) {
    7072                $output .= "<td><a href=\"realm.php?action=edit_realm&amp;id=$realm[0]\">$realm[1]</a></td>";
    71                 if (test_port($server[$realm[0]]['addr'],$server[$realm[0]]['game_port']))  $output .= "<td><img src=\"img/up.gif\" class=\"no_border\" alt=\"\" /></td>";
    72                         else $output .= "<td><img src=\"img/down.gif\" class=\"no_border\" alt=\"\" /></td>";
     73                if (test_port($server[$realm[0]]['addr'],$server[$realm[0]]['game_port']))  $output .= "<td><img src=\"img/up.gif\" alt=\"\" /></td>";
     74                        else $output .= "<td><img src=\"img/down.gif\" alt=\"\" /></td>";
    7375        } else $output .= "<td><a href=\"realm.php?action=edit_realm&amp;id=$realm[0]\">$realm[1] (Not Configured yet)</a></td>
    7476                                           <td>***</td>";
    7577
    76   $query_1 = $mysql->query("SELECT SUM(numchars) FROM realmcharacters WHERE realmid = '$realm[0]'");
    77 
    78   $output .= "<td>".$mysql->result($query_1, 0)."</td>
     78  $output .= "<td>$realm[7]</td>
    7979                                <td>$realm[2]</td>
    8080                                <td>$realm[3]</td>
     
    8686 $output .= "</table><br /></center>";
    8787
    88  $mysql->close();
     88 $sql->close();
    8989}
    9090
     
    9999 if(!isset($_GET['id'])) redirect("realm.php?error=1");
    100100 
    101  $mysql = new MySQL;
    102  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    103 
    104  $id = $mysql->quote_smart($_GET['id']);
    105  
    106  $result = $mysql->query("SELECT id,name,address,port,icon,color,timezone FROM realmlist WHERE id ='$id'");
    107 
    108  if ($realm = $mysql->fetch_row($result)) {
     101 $sql = new SQL;
     102 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     103
     104 $id = $sql->quote_smart($_GET['id']);
     105 
     106 $result = $sql->query("SELECT realmlist.id AS rid,name,address,port,icon,color,timezone,
     107                                                (SELECT SUM(numchars) FROM realmcharacters WHERE realmid = rid)
     108                                                FROM realmlist WHERE id ='$id'");
     109
     110 if ($realm = $sql->fetch_row($result)) {
    109111        $output .= "<center>
    110112        <fieldset style=\"width: 550px;\">
     
    159161        $output .= "</tr></td>
    160162                                <tr><td>";
    161         $result = $mysql->query("SELECT SUM(numchars) FROM realmcharacters WHERE realmid = '$realm[0]'");
    162         $output .= "<tr><td>{$lang_realm['tot_char']}</td><td>".$mysql->result($result, 0)."</td></tr>";
     163        $output .= "<tr><td>{$lang_realm['tot_char']}</td><td>$realm[7]</td></tr>";
    163164} else $output .= "<tr><td colspan=\"2\">{$lang_realm['conf_from_file']}</td><td>";
    164165
     
    177178  } else error($lang_global['err_no_result']);
    178179 
    179  $mysql->close();
     180 $sql->close();
    180181}
    181182
     
    192193 }
    193194 
    194  $mysql = new MySQL;
    195  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    196  
    197  $id = $mysql->quote_smart($_GET['id']);
    198  $new_name = $mysql->quote_smart($_GET['new_name']);
    199  $new_address = $mysql->quote_smart($_GET['new_address']);
    200  $new_port = $mysql->quote_smart($_GET['new_port']);
    201  $new_icon = $mysql->quote_smart($_GET['new_icon']);
    202  $new_color = $mysql->quote_smart($_GET['new_color']);
    203  $new_timezone = $mysql->quote_smart($_GET['new_timezone']);
    204 
    205  $sql = "UPDATE realmlist SET name='$new_name', address ='$new_address' , port ='$new_port', icon ='$new_icon', color ='$new_color', timezone ='$new_timezone' WHERE id = '$id'";
    206  $query = $mysql->query($sql);
    207 
    208  if ($mysql->affected_rows()) {
    209         $mysql->close();
     195 $sql = new SQL;
     196 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     197 
     198 $id = $sql->quote_smart($_GET['id']);
     199 $new_name = $sql->quote_smart($_GET['new_name']);
     200 $new_address = $sql->quote_smart($_GET['new_address']);
     201 $new_port = $sql->quote_smart($_GET['new_port']);
     202 $new_icon = $sql->quote_smart($_GET['new_icon']);
     203 $new_color = $sql->quote_smart($_GET['new_color']);
     204 $new_timezone = $sql->quote_smart($_GET['new_timezone']);
     205
     206 $query = $sql->query("UPDATE realmlist SET name='$new_name', address ='$new_address' , port ='$new_port', icon ='$new_icon', color ='$new_color', timezone ='$new_timezone' WHERE id = '$id'");
     207
     208 if ($sql->affected_rows()) {
     209        $sql->close();
    210210        redirect("realm.php?error=3");
    211211    } else {
    212                 $mysql->close();
     212                $sql->close();
    213213                redirect("realm.php?action=edit_realm&id=$id&error=4");
    214214        }
     
    226226
    227227 $output .= "<center><h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />";
    228  $output .= "<font class=\"bold\">{$lang_realm['realm_id']}: $id {$lang_global['will_be_erased']}</font><br /><br />";
     228 $output .= "<font class=\"bold\">{$lang_realm['realm_id']}: $id<br />{$lang_global['will_be_erased']}</font><br /><br />";
    229229 $output .= "<table class=\"hidden\">
    230230          <tr>
     
    245245 global $realm_db;
    246246
    247  $mysql = new MySQL;
    248  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    249 
    250  if(isset($_GET['id'])) $id = $mysql->quote_smart($_GET['id']);
     247 $sql = new SQL;
     248 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     249
     250 if(isset($_GET['id'])) $id = $sql->quote_smart($_GET['id']);
    251251        else redirect("realm.php?error=1");
    252252
    253  $mysql->query("DELETE FROM realmlist WHERE id = '$id'");
    254 
    255  if ($mysql->affected_rows()) {
    256         $mysql->close();
     253 $sql->query("DELETE FROM realmlist WHERE id = '$id'");
     254
     255 if ($sql->affected_rows()) {
     256        $sql->close();
    257257        redirect("realm.php");
    258258    } else {
    259                 $mysql->close();
     259                $sql->close();
    260260                redirect("realm.php?error=2");
    261261        }
     
    270270 global $realm_db;
    271271
    272  $mysql = new MySQL;
    273  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    274 
    275  $result = $mysql->query("INSERT INTO realmlist (id, name, address, port, icon, color, timezone)
     272 $sql = new SQL;
     273 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     274
     275 $result = $sql->query("INSERT INTO realmlist (id, name, address, port, icon, color, timezone)
    276276  VALUES (NULL,'MANGOS','127.0.0.1', 8085 ,0 ,0 ,1)");
    277277
    278  $mysql->close();
     278 $sql->close();
    279279
    280280 if ($result) redirect("realm.php");
     
    290290 global $realm_db;
    291291
    292  $mysql = new MySQL;
    293  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    294  
    295  $id = (isset($_GET['id'])) ? $mysql->quote_smart($_GET['id']) : 1;
    296  
    297  $result = $mysql->query("SELECT id FROM realmlist WHERE id ='$id'");
    298  if ($mysql->num_rows($result)) $_SESSION['realm_id'] = $id;
    299  $mysql->close();
     292 $sql = new SQL;
     293 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     294 
     295 $id = (isset($_GET['id'])) ? $sql->quote_smart($_GET['id']) : 1;
     296 
     297 $result = $sql->query("SELECT id FROM realmlist WHERE id ='$id'");
     298 if ($sql->num_rows($result)) $_SESSION['realm_id'] = $id;
     299 $sql->close();
    300300
    301301 $url = (isset($_GET['url'])) ? $_GET['url'] : "index.php";
  • minimanager/register.php

    r5 r19  
    1010 require_once("header.php");
    1111
    12 
    1312//#####################################################################################################
    1413// DO REGISTER
     
    1817                $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title;
    1918
    20  if (empty($_COOKIE['terms']) || ($_COOKIE['terms']) != 'i_do') redirect("register.php?err=13");
    21 
    22  //make sure all got by post
    2319 if ( empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['username']) ) {
    2420   redirect("register.php?err=1");
     
    5450 }
    5551 
    56         $mysql = new MySQL;
    57         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    58        
    59         $user_name = $mysql->quote_smart(trim($_POST['username']));
    60         $pass = $mysql->quote_smart($_POST['pass']);
    61         $pass1 = $mysql->quote_smart($_POST['pass1']);
     52        $sql = new SQL;
     53        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     54       
     55        $user_name = $sql->quote_smart(trim($_POST['username']));
     56        $pass = $sql->quote_smart($_POST['pass']);
     57        $pass1 = $sql->quote_smart($_POST['pass1']);
    6258
    6359        //make sure username/pass at least 4 chars long and less than max
    6460        if ((strlen($user_name) < 4) || (strlen($user_name) > 15)){
    65                 $mysql->close();
     61                $sql->close();
    6662        redirect("register.php?err=5");
    6763        }
     
    7167        //make sure it doesnt contain non english chars.
    7268        if (!alphabetic($user_name)) {
    73                 $mysql->close();
     69                $sql->close();
    7470        redirect("register.php?err=6");
    7571        }
    7672
    7773        //make sure the mail is valid mail format
    78         $mail = $mysql->quote_smart(trim($_POST['email']));
     74        $mail = $sql->quote_smart(trim($_POST['email']));
    7975        if ((!is_email($mail))||(strlen($mail)  > 224)) {
    80                         $mysql->close();
     76                        $sql->close();
    8177                redirect("register.php?err=7");
    8278                }
     
    8480        $per_ip = ($limit_acc_per_ip) ? "OR last_ip='$last_ip'" : "";
    8581
    86         $result = $mysql->query("SELECT ip FROM ip_banned WHERE ip = '$last_ip'");
     82        $result = $sql->query("SELECT ip FROM ip_banned WHERE ip = '$last_ip'");
    8783        //IP is in ban list
    88         if ($mysql->num_rows($result)){
    89                         $mysql->close();
     84        if ($sql->num_rows($result)){
     85                        $sql->close();
    9086                redirect("register.php?err=8&usr=$last_ip");
    9187        }
    9288
    93         $result = $mysql->query("SELECT username,email FROM account WHERE username='$user_name' OR email='$mail' $per_ip");
     89        $result = $sql->query("SELECT username,email FROM account WHERE username='$user_name' OR email='$mail' $per_ip");
    9490
    9591        //there is already someone with same user/mail
    96         if ($mysql->num_rows($result)){
    97                         $mysql->close();
     92        if ($sql->num_rows($result)){
     93                        $sql->close();
    9894                redirect("register.php?err=3&usr=$user_name");
    9995        } else {
    100                 $tbc = (isset($_POST['tbc'])) ? $mysql->quote_smart($_POST['tbc']) : 0;
    101 
    102                 $result = $mysql->query("INSERT INTO account (username,I,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online,tbc)
     96                $tbc = (isset($_POST['tbc'])) ? $sql->quote_smart($_POST['tbc']) : 0;
     97
     98                $result = $sql->query("INSERT INTO account (username,I,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online,tbc)
    10399                                VALUES ('$user_name','$pass',0,'$mail',current_date(),'$last_ip',0,$create_acc_locked,NULL,0,$tbc)");
    104                 $mysql->close();
     100                $sql->close();
    105101               
    106102                setcookie ("terms", "", time() - 3600);
    107103
    108104                if ($send_mail_on_creation){
    109                         require_once("scripts/class.phpmailer.php");
     105                        require_once("scripts/mailer/class.phpmailer.php");
    110106                        $mailer = new PHPMailer();
    111107                        $mailer->Mailer = $mailer_type;
     
    166162                        }
    167163                }
     164                answerbox.btn_ok='{$lang_register['i_agree']}';
     165                answerbox.btn_cancel='{$lang_register['i_dont_agree']}';
     166                answerbox.btn_icon='';
    168167        </script>
    169 
    170168        <fieldset style=\"width: 550px;\">
    171169        <legend>{$lang_register['create_acc']}</legend>
     
    205203        <tr><td colspan=\"2\"><hr /></td></tr>
    206204        <tr>
    207          <td colspan=\"2\">{$lang_register['read_terms']} : <a href=\"javascript:popUp('terms.php?action=terms')\">{$lang_register['terms']}</a></td>
     205         <td colspan=\"2\">{$lang_register['read_terms']}.</td>
    208206        </tr>
    209207        <tr><td colspan=\"2\"><hr / ></td></tr>
    210208        <tr><td>";
    211                 makebutton($lang_register['create_acc_button'], "javascript:do_submit_data()",150);
     209               
     210        $terms = "<textarea rows=\'18\' cols=\'80\' readonly=\'readonly\'>";
     211        $fp = fopen("mail_templates/terms.tpl", 'r') or die (error("Couldn't Open terms.tpl File!"));
     212        while (!feof($fp)) $terms .= fgets($fp, 1024);
     213        fclose($fp);
     214        $terms .= "</textarea>";
     215
     216                makebutton($lang_register['create_acc_button'], "javascript:answerBox('{$lang_register['terms']}<br />$terms', 'javascript:do_submit_data()')",150);
    212217$output .= "</td><td>";
    213                 makebutton($lang_global['back'], "javascript:window.history.back()", 328);
     218                makebutton($lang_global['back'], "login.php", 328);
    214219 $output .= "</td></tr>
    215220    </table>
     
    258263 if ( empty($_POST['username']) || empty($_POST['email']) ) redirect("register.php?action=pass_recovery&err=1");
    259264
    260  $mysql = new MySQL;
    261  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    262        
    263  $user_name = $mysql->quote_smart(trim($_POST['username']));
    264  $email_addr = $mysql->quote_smart($_POST['email']);
    265 
    266  $result = $mysql->query("SELECT I FROM account WHERE username = '$user_name' AND email = '$email_addr'");
    267 
    268  if ($mysql->num_rows($result) == 1){
    269 
    270         require_once("scripts/class.phpmailer.php");
     265 $sql = new SQL;
     266 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     267       
     268 $user_name = $sql->quote_smart(trim($_POST['username']));
     269 $email_addr = $sql->quote_smart($_POST['email']);
     270
     271 $result = $sql->query("SELECT I FROM account WHERE username = '$user_name' AND email = '$email_addr'");
     272
     273 if ($sql->num_rows($result) == 1){
     274
     275        require_once("scripts/mailer/class.phpmailer.php");
    271276        $mail = new PHPMailer();
    272277        $mail->Mailer = $mailer_type;
     
    292297        $body = str_replace("<password>", substr(sha1(strtoupper($user_name)),0,7), $body);
    293298        $body = str_replace("<activate_link>",
    294                 $_SERVER['HTTP_HOST']."/register.php?action=do_pass_activate&amp;h=".$mysql->result($result, 0, 'I')."&amp;p=".substr(sha1(strtoupper($user_name)),0,7), $body);
     299                $_SERVER['HTTP_HOST']."/register.php?action=do_pass_activate&amp;h=".$sql->result($result, 0, 'I')."&amp;p=".substr(sha1(strtoupper($user_name)),0,7), $body);
    295300        $body = str_replace("<base_url>", $_SERVER['HTTP_HOST'], $body);
    296301
     
    323328 if ( empty($_GET['h']) || empty($_GET['p']) ) redirect("register.php?action=pass_recovery&err=1");
    324329
    325  $mysql = new MySQL;
    326  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    327 
    328  $pass = $mysql->quote_smart(trim($_GET['p']));
    329  $hash = $mysql->quote_smart($_GET['h']);
    330 
    331  $result = $mysql->query("SELECT id,username FROM account WHERE I = '$hash'");
    332 
    333  if ($mysql->num_rows($result) == 1){
    334         $username = $mysql->result($result, 0, 'username');
    335         $id = $mysql->result($result, 0, 'id');
    336         if (substr(sha1(strtoupper($mysql->result($result, 0, 'username'))),0,7) == $pass){
    337                 $mysql->query("UPDATE account SET I=SHA1(CONCAT(UPPER('$username'),':',UPPER('$pass'))) WHERE id = '$id'");
     330 $sql = new SQL;
     331 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     332
     333 $pass = $sql->quote_smart(trim($_GET['p']));
     334 $hash = $sql->quote_smart($_GET['h']);
     335
     336 $result = $sql->query("SELECT id,username FROM account WHERE I = '$hash'");
     337
     338 if ($sql->num_rows($result) == 1){
     339        $username = $sql->result($result, 0, 'username');
     340        $id = $sql->result($result, 0, 'id');
     341        if (substr(sha1(strtoupper($sql->result($result, 0, 'username'))),0,7) == $pass){
     342                $sql->query("UPDATE account SET I=SHA1(CONCAT(UPPER('$username'),':',UPPER('$pass'))) WHERE id = '$id'");
    338343                redirect("login.php");
    339344                }
     
    348353// MAIN
    349354//#####################################################################################################
    350 $output .= "<script type=\"text/javascript\">
    351 function popUp(URL) {
    352         m_window = window.open(URL, 'm_window', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=400');
    353         m_window.moveTo(100,100);
    354 }
    355 </script>";
    356 
    357355$err = (isset($_GET['err'])) ? $_GET['err'] : NULL;
    358356
     
    398396   $output .= "<h1><font class=\"error\">{$lang_register['recovery_mail_sent']}</font></h1>";
    399397   break;
    400 case 13:
    401    $output .= "<h1><font class=\"error\">{$lang_register['error_terms']}</font></h1>";
    402    break;
    403398default:
    404399   $output .= "<h1><font class=\"error\">{$lang_register['fill_all_fields']}</font></h1>";
  • minimanager/repair.php

    r5 r19  
    3535 $output .="<script type=\"text/javascript\" src=\"js/check.js\"></script>";
    3636                 
    37  $mysql = new MySQL;
    38  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     37 $sql = new SQL;
     38 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    3939
    40  $result = $mysql->query("SHOW TABLES FROM {$realm_db['name']}");
     40 $result = $sql->query("SHOW TABLES FROM {$realm_db['name']}");
    4141               
    4242 $output .= "<table class=\"lined\" style=\"width: 550px;\">
    4343                        <tr>
    44                                 <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></td>
    45                                 <td width=\"25%\" class=\"head\">{$lang_repair['table_name']}</td>
    46                                 <td width=\"35%\" class=\"head\">{$lang_repair['status']}</td>
    47                                 <td width=\"15%\" class=\"head\">{$lang_repair['num_records']}</td>
     44                                <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></th>
     45                                <th width=\"25%\">{$lang_repair['table_name']}</th>
     46                                <th width=\"35%\">{$lang_repair['status']}</th>
     47                                <th width=\"15%\">{$lang_repair['num_records']}</th>
    4848                        </tr>
    4949                        <tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$realm_db['name']} {$lang_repair['tables']} :</td></tr>";
    5050                 
    51  while ($table = $mysql->fetch_row($result)){
    52         $result1 = $mysql->query("SELECT count(*) FROM `$table[0]`");
    53         $result2 = $mysql->query("CHECK TABLE `$table[0]` CHANGED");
     51 while ($table = $sql->fetch_row($result)){
     52        $result1 = $sql->query("SELECT count(*) FROM `$table[0]`");
     53        $result2 = $sql->query("CHECK TABLE `$table[0]` CHANGED");
    5454       
    5555        $output .= "<tr>
    5656                    <td><input type=\"checkbox\" name=\"check[]\" value=\"realm~0~{$realm_db['name']}~$table[0]\" onclick=\"CheckCheckAll(document.form);\" /></td>
    5757                    <td>$table[0]</td>
    58                         <td>".$mysql->result($result2, 0, 'Msg_type')." : ".$mysql->result($result2, 0, 'Msg_text')."</td>
    59                         <td>".$mysql->result($result1, 0)."</td>
     58                        <td>".$sql->result($result2, 0, 'Msg_type')." : ".$sql->result($result2, 0, 'Msg_text')."</td>
     59                        <td>".$sql->result($result1, 0)."</td>
    6060            </tr>";
    6161}
     
    6464        $output .= "<tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$db['name']} Tables :</td></tr>";
    6565       
    66         $mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    67         $result = $mysql->query("SHOW TABLES FROM {$db['name']}");
     66        $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     67        $result = $sql->query("SHOW TABLES FROM {$db['name']}");
    6868
    69         while ($table = $mysql->fetch_row($result)){
    70         $result1 = $mysql->query("SELECT count(*) FROM `$table[0]`");
    71         $result2 = $mysql->query("CHECK TABLE `$table[0]` CHANGED");
     69        while ($table = $sql->fetch_row($result)){
     70        $result1 = $sql->query("SELECT count(*) FROM `$table[0]`");
     71        $result2 = $sql->query("CHECK TABLE `$table[0]` CHANGED");
    7272       
    7373        $output .= "<tr>
    7474                    <td><input type=\"checkbox\" name=\"check[]\" value=\"world~{$db['id']}~{$db['name']}~$table[0]\" onclick=\"CheckCheckAll(document.form);\" /></td>
    7575                    <td>$table[0]</td>
    76                         <td>".$mysql->result($result2, 0, 'Msg_type')." : ".$mysql->result($result2, 0, 'Msg_text')."</td>
    77                         <td>".$mysql->result($result1, 0)."</td>
     76                        <td>".$sql->result($result2, 0, 'Msg_type')." : ".$sql->result($result2, 0, 'Msg_text')."</td>
     77                        <td>".$sql->result($result1, 0)."</td>
    7878            </tr>";
    7979        }
     
    9797        }
    9898
    99  $mysql = new MySQL;
     99 $sql = new SQL;
    100100 $counter = 0;
    101101
     
    104104                $table_data = explode("~", $table);
    105105                if ($table_data[0] == "realm"){
    106                         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
     106                        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    107107                } else {
    108                                 $mysql->connect($mangos_db[$table_data[1]]['addr'], $mangos_db[$table_data[1]]['user'], $mangos_db[$table_data[1]]['pass']);
     108                                $sql->connect($mangos_db[$table_data[1]]['addr'], $mangos_db[$table_data[1]]['user'], $mangos_db[$table_data[1]]['pass']);
    109109                                }
    110110
    111                  $result = $mysql->query("$table_action TABLE {$table_data[2]}.`{$table_data[3]}`");
    112                  $action_result = $mysql->fetch_row($result);
     111                 $result = $sql->query("$table_action TABLE {$table_data[2]}.`{$table_data[3]}`");
     112                 $action_result = $sql->fetch_row($result);
    113113                 
    114114                 if ($action_result[3] === "OK") $counter++;
  • minimanager/run_patch.php

    r5 r19  
    6767 if ( empty($_POST['query']) || empty($_POST['use_db']) ) redirect("run_patch.php?error=1");
    6868
    69  $mysql = new MySQL;
    70  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);
     69 $sql = new SQL;
     70 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    7171 
    72  $use_db = $mysql->quote_smart($_POST['use_db']);
     72 $use_db = $sql->quote_smart($_POST['use_db']);
    7373 $query = $_POST['query'];
    7474 
    75  if ($use_db == $realm_db['name']) $mysql->db($realm_db['name']);
     75 if ($use_db == $realm_db['name']) $sql->db($realm_db['name']);
    7676        else {
    7777                foreach ($mangos_db as $db)
    78                         if ($use_db == $db['name']) $mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     78                        if ($use_db == $db['name']) $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    7979        }
    8080       
     
    9595 foreach($qr as $qry) {
    9696        $line++;
    97         if(trim($qry)) ($mysql->query(trim($qry))?$good++:$bad++);
     97        if(trim($qry)) ($sql->query(trim($qry))?$good++:$bad++);
    9898                if ($bad) {
    99                                         $err = ereg_replace ("\n","",mysql_error());
     99                                        $err = ereg_replace ("\n","",$sql->error());
    100100                                        $err = ereg_replace ("\r\n$","",$err);
    101101                                        $err = ereg_replace ("\r$","",$err);
     
    105105  }
    106106
    107  $mysql->close();
     107 $sql->close();
    108108 
    109109 if ($queries) redirect("run_patch.php?error=2&tot=$good");
  • minimanager/scripts/config.sample.php

    r14 r19  
    99 */
    1010
    11 $version = "0.1.3d";
    12 
    13 //---- MySQL Configuration ----
     11$version = "0.1.4a";
     12
     13//---- SQL Configuration ----
     14
     15/* SQL server type  :
     16*  "MySQL" - Mysql
     17*  "PgSQL" - PostgreSQL
     18*  "MySQLi" - MySQLi
     19*  "SQLLite" - SQLLite
     20*/
     21$db_type = "MySQL";
     22
    1423$realm_db = Array(
    1524        'addr' => "127.0.0.1:3306",     //SQL server IP:port this realmd located on
    16         'user' => "mangos",                     //SQL server login this realmd located on
    17         'pass' => "mangos",                     //SQL server pass this realmd located on
     25        'user' => "root",                       //SQL server login this realmd located on
     26        'pass' => "pass",                       //SQL server pass this realmd located on
    1827        'name' => "realmd",                     //realmd DB name
    1928        'encoding' => "utf8"            //SQL connection encoding
     
    2433                        'id' => 1,                                      //Realm ID
    2534                        'addr' => "127.0.0.1:3306",     //SQL server IP:port this DB located on
    26                         'user' => "mangos",                     //SQL server login this DB located on
    27                         'pass' => "mangos",                     //SQL server pass this DB located on
     35                        'user' => "root",                       //SQL server login this DB located on
     36                        'pass' => "pass",                       //SQL server pass this DB located on
    2837                        'name' => "mangos",                     //World Database name
    2938                        'encoding' => "utf8",           //SQL connection encoding
    30                         'db_rev' => "SDB rev.202"       //db rev. used
     39                        'db_rev' => "SDB rev.24"        //db rev. used
    3140                        ),
    3241);
     
    3948                        'term_type' => "SSH",           //Terminal type - ("SSH"/"Telnet")
    4049                        'term_port' => 22,                      //Terminal port
    41                         'rev' => "rev.4203",            //Mangos rev. used
     50                        'rev' => "rev.4285",            //Mangos rev. used
    4251                        'both_factions' => false        //Allow to see opponent faction characters. Affects only players. 
    4352                        ),
     
    4756
    4857//---- Mail configuration ----
    49 $admin_mail = "noname@company.com";     //mail used for bug reports and other user contact
     58$admin_mail = "root@admin.com"; //mail used for bug reports and other user contact
    5059
    5160$mailer_type = "smtp";                  // type of mailer to be used("mail", "sendmail", "smtp")
    52 $from_mail = "noname@company.com";      //all emails will be sent from this email
     61$from_mail = "mail@mail.com";   //all emails will be sent from this email
    5362//smtp server config
    5463$smtp_cfg = array(
    55                         'host' => "smtp.company.com",   //smtp server
     64                        'host' => "smtp.mail.com",      //smtp server
    5665                        'port' => 25,                           //port
    5766                        'user' => "",                           //username - use only if auth. required
     
    7382
    7483//---- Layout configuration ----
    75 $title = "WoW server";
     84$title = "MiniManager for MaNgOs srv.";
    7685$itemperpage = 25;
    7786
    7887$css_template = "Sulfur";               //file/folder name of css tamplate to use from templates directory by default
    7988$language = "enUS";                     //default site language
    80 $site_encoding = "iso-8859-2";  //default encoding
     89$site_encoding = "iso-8859-1";  //default encoding
    8190
    8291//---- IRC Options ------
  • minimanager/scripts/del_lib.php

    r5 r19  
    1616        global $mangos_db, $realm_db, $user_lvl, $user_id, $tab_del_user_mangos;
    1717
    18         $mysql_01 = new MySQL;
    19         $mysql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
    20         $query = $mysql_01->query("SELECT account,online FROM `character` WHERE guid ='$guid' LIMIT 1");
    21         $owner_acc_id = $mysql_01->result($query, 0, 'account');
    22         $mysql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    23         $query1 = $mysql_01->query("SELECT gmlevel FROM account WHERE id ='$owner_acc_id'");
    24         $owner_gmlvl = $mysql_01->result($query1, 0, 'gmlevel');
     18        $sql_01 = new SQL;
     19        $sql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
     20        $query = $sql_01->query("SELECT account,online FROM `character` WHERE guid ='$guid' LIMIT 1");
     21        $owner_acc_id = $sql_01->result($query, 0, 'account');
     22        $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     23        $query1 = $sql_01->query("SELECT gmlevel FROM account WHERE id ='$owner_acc_id'");
     24        $owner_gmlvl = $sql_01->result($query1, 0, 'gmlevel');
    2525        unset($query1);
    2626       
    2727        if (($user_lvl > $owner_gmlvl)||($owner_acc_id == $user_id)) {
    28                 $mysql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
     28                $sql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
    2929
    30                 if (!$mysql_01->result($query, 0, 'online')){
     30                if (!$sql_01->result($query, 0, 'online')){
    3131                        foreach ($tab_del_user_mangos as $value){
    32                                 $query = $mysql_01->query("DELETE FROM {$value[0]} WHERE {$value[1]} = '$guid'");
     32                                $query = $sql_01->query("DELETE FROM {$value[0]} WHERE {$value[1]} = '$guid'");
    3333                                }
    3434
    35                         $mysql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    36                         $query_2 = $mysql_01->query("SELECT numchars FROM realmcharacters WHERE acctid ='$owner_acc_id' AND realmid = '$realm'");
    37                         $chars_in_acc = $mysql_01->result($query_2, 0, 'numchars');
     35                        $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     36                        $query_2 = $sql_01->query("SELECT numchars FROM realmcharacters WHERE acctid ='$owner_acc_id' AND realmid = '$realm'");
     37                        $chars_in_acc = $sql_01->result($query_2, 0, 'numchars');
    3838                        if ($chars_in_acc) $chars_in_acc--;
    3939                                else $chars_in_acc = 0;
    40                         $query_2 = $mysql_01->query("UPDATE realmcharacters SET numchars='$chars_in_acc' WHERE acctid ='$owner_acc_id' AND realmid = '$realm'");
     40                        $query_2 = $sql_01->query("UPDATE realmcharacters SET numchars='$chars_in_acc' WHERE acctid ='$owner_acc_id' AND realmid = '$realm'");
    4141
    42                         $mysql_01->close();
     42                        $sql_01->close();
    4343                        return true;
    4444                        }
    4545                }
    46         $mysql_01->close();
     46        $sql_01->close();
    4747        return false;
    4848}
     
    5555        $del_char = 0;
    5656
    57         $mysql_01 = new MySQL;
    58         $mysql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    59         $query = $mysql_01->query("SELECT gmlevel,online FROM account WHERE id ='$acc_id'");
    60         $gmlevel = $mysql_01->result($query, 0, 'gmlevel');
     57        $sql_01 = new SQL;
     58        $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     59        $query = $sql_01->query("SELECT gmlevel,online FROM account WHERE id ='$acc_id'");
     60        $gmlevel = $sql_01->result($query, 0, 'gmlevel');
    6161
    6262        if (($user_lvl > $gmlevel)||($acc_id == $user_id)) {
    63                 if (!$mysql_01->result($query, 0, 'online')){
     63                if (!$sql_01->result($query, 0, 'online')){
    6464                foreach ($mangos_db as $db){
    65                         $mysql_01->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    66                         $result = $mysql_01->query("SELECT guid FROM `character` WHERE account='$acc_id'");
    67                         while ($row = $mysql_01->fetch_array($result)) {
     65                        $sql_01->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     66                        $result = $sql_01->query("SELECT guid FROM `character` WHERE account='$acc_id'");
     67                        while ($row = $sql_01->fetch_array($result)) {
    6868                                        foreach ($tab_del_user_mangos as $value)
    69                                         $query = $mysql_01->query("DELETE FROM $value[0] WHERE $value[1] = '$row[0]'");
     69                                        $query = $sql_01->query("DELETE FROM $value[0] WHERE $value[1] = '$row[0]'");
    7070                                $del_char++;
    7171                        }
    7272                }
    7373
    74                 $mysql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     74                $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    7575
    7676                foreach ($tab_del_user_realmd as $value){
    77                                 $query = $mysql_01->query("DELETE FROM $value[0] WHERE $value[1] = '$acc_id'");
     77                                $query = $sql_01->query("DELETE FROM $value[0] WHERE $value[1] = '$acc_id'");
    7878                                }
    79                 if ($mysql_01->affected_rows()) {
    80                         $mysql_01->close();
     79                if ($sql_01->affected_rows()) {
     80                        $sql_01->close();
    8181                        return array(true,$del_char);
    8282                        }
    8383                }
    8484        }
    85         $mysql_01->close();
     85        $sql_01->close();
    8686        return array(false,$del_char);
    8787}
     
    9595        require_once("scripts/defines.php");
    9696       
    97         $mysql_01 = new MySQL;
    98         $mysql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
    99         $query = $mysql_01->query("DELETE FROM guild WHERE guildid = '$guid'");
    100         $query = $mysql_01->query("DELETE FROM guild_rank WHERE guildid = '$guid'");
     97        $sql_01 = new SQL;
     98        $sql_01->connect($mangos_db[$realm]['addr'], $mangos_db[$realm]['user'], $mangos_db[$realm]['pass'], $mangos_db[$realm]['name']);
     99        $query = $sql_01->query("DELETE FROM guild WHERE guildid = '$guid'");
     100        $query = $sql_01->query("DELETE FROM guild_rank WHERE guildid = '$guid'");
    101101               
    102102        //clean data inside character.data field
    103         $temp = $mysql_01->query("SELECT guid FROM guild_member WHERE guildid = '$guid'");
    104         while ($guild_member = $mysql_01->fetch_row($temp)){
    105                 $char_data = $mysql_01->query("SELECT data FROM `character` WHERE guid = '$guild_member[0]'");
    106                 $data = $mysql_01->result($char_data, 0, 'data');
     103        $temp = $sql_01->query("SELECT guid FROM guild_member WHERE guildid = '$guid'");
     104        while ($guild_member = $sql_01->fetch_row($temp)){
     105                $char_data = $sql_01->query("SELECT data FROM `character` WHERE guid = '$guild_member[0]'");
     106                $data = $sql_01->result($char_data, 0, 'data');
    107107                $data = explode(' ',$data);
    108108                $data[CHAR_DATA_OFFSET_GUILD_ID] = 0;
    109109                $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0;
    110110                $data = implode(" ",$data);
    111                 $query = $mysql_01->query("UPDATE `character` SET data = '$data' WHERE guid = '$guild_member[0]'");
     111                $query = $sql_01->query("UPDATE `character` SET data = '$data' WHERE guid = '$guild_member[0]'");
    112112                }
    113113
    114         $query = $mysql_01->query("DELETE FROM guild_member WHERE guildid = '$guid'");
     114        $query = $sql_01->query("DELETE FROM guild_member WHERE guildid = '$guid'");
    115115
    116         if ($mysql_01->affected_rows()){
    117                 $mysql_01->close();
     116        if ($sql_01->affected_rows()){
     117                $sql_01->close();
    118118                return true;
    119119                } else {
    120                                 $mysql_01->close();
     120                                $sql_01->close();
    121121                                return false;
    122122                                }
  • minimanager/scripts/gen_lib.php

    r5 r19  
    1414        global $lang_global, $mangos_db, $realm_id;
    1515       
    16         $mysql_0 = new MySQL;
    17         $mysql_0->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],true);
     16        $sql_0 = new SQL;
     17        $sql_0->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1818 
    19         $result = $mysql_0->query("SELECT MAX(`id`) FROM item_text");
    20         $item_page_id = ($mysql_0->result($result, 0)) + 1;
    21         $result = $mysql_0->query("INSERT INTO item_text (id, text) VALUES ($item_page_id,'$body')");
     19        $result = $sql_0->query("SELECT MAX(`id`) FROM item_text");
     20        $item_page_id = ($sql_0->result($result, 0)) + 1;
     21        $result = $sql_0->query("INSERT INTO item_text (id, text) VALUES ($item_page_id,'$body')");
    2222
    23         $result = $mysql_0->query("SELECT MAX(`id`) FROM mail");
    24         $mail_id = ($mysql_0->result($result, 0)) + 1;
     23        $result = $sql_0->query("SELECT MAX(`id`) FROM mail");
     24        $mail_id = ($sql_0->result($result, 0)) + 1;
    2525
    2626        $item_guid = ($item) ? gen_item_instance($to, $item, $stack) : 0;
    2727
    28         $sql = "INSERT INTO mail (id,messageType,sender,receiver,subject,itemTextId,item_guid,item_template,expire_time,deliver_time,money,cod,checked)
    29                         VALUES ($mail_id, 0, '$from', '$to', '$subject', '$item_page_id', '$item_guid', '$item', '".(time() + (30*24*3600))."','".(time()+5)."', '$gold', 0, 0)";
    30         $result = $mysql_0->query($sql);
     28        $result = $sql_0->query("INSERT INTO mail (id,messageType,sender,receiver,subject,itemTextId,item_guid,item_template,expire_time,deliver_time,money,cod,checked)
     29                        VALUES ($mail_id, 0, '$from', '$to', '$subject', '$item_page_id', '$item_guid', '$item', '".(time() + (30*24*3600))."','".(time()+5)."', '$gold', 0, 0)");
    3130       
    3231        if ($result) {
    33                 $mysql_0->close();
     32                $sql_0->close();
    3433                return $mail_id;
    3534        } else {
    36                         $mysql_0->close();
     35                        $sql_0->close();
    3736                        return 0;
    3837                        }
     
    4544 global $lang_global, $mangos_db, $realm_id;
    4645
    47  $mysql_1 = new MySQL;
    48  $mysql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name'],true);
     46 $sql_1 = new SQL;
     47 $sql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    4948
    50  $result = $mysql_1->query("SELECT MAX(guid) FROM item_instance");
    51  $guid = $mysql_1->result($result, 0) + 1;
     49 $result = $sql_1->query("SELECT MAX(guid) FROM item_instance");
     50 $guid = $sql_1->result($result, 0) + 1;
    5251
    53  $result = $mysql_1->query("SELECT flags,stackable,MaxDurability,spellcharges_1,spellcharges_2,
     52 $result = $sql_1->query("SELECT flags,stackable,MaxDurability,spellcharges_1,spellcharges_2,
    5453                                                        spellcharges_3,spellcharges_4,spellcharges_5 FROM item_template
    5554                                                        WHERE entry = '$item_id'");
    56  $item_template = $mysql_1->fetch_row($result);
     55 $item_template = $sql_1->fetch_row($result);
    5756 
    5857 if ($item_template[1] <= 1) $stack = 1;
     
    8685 $data = implode(" ",$item_data);
    8786
    88  $result = $mysql_1->query("INSERT INTO item_instance (guid, owner_guid, data) VALUES ($guid, '$owner','$data')");
     87 $result = $sql_1->query("INSERT INTO item_instance (guid, owner_guid, data) VALUES ($guid, '$owner','$data')");
    8988 
    9089 if ($result) {
    91         $mysql_1->close();
     90        $sql_1->close();
    9291        return $guid;
    9392 } else {
    94                 $mysql_1->close();
     93                $sql_1->close();
    9594                return 0;
    9695                }
  • minimanager/scripts/get_lib.php

    r5 r19  
    1414 global $lang_global, $realm_db;
    1515
    16  $mysql_0 = new MySQL;
    17  $mysql_0->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    18 
    19  $result = $mysql_0->query("SELECT name FROM `realmlist` WHERE id = '$realm_id'");
    20  $realm_name = $mysql_0->result($result, 0);
    21 
    22  $mysql_0->close();
     16 $sql_0 = new SQL;
     17 $sql_0->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     18
     19 $result = $sql_0->query("SELECT name FROM `realmlist` WHERE id = '$realm_id'");
     20 $realm_name = $sql_0->result($result, 0);
     21
     22 $sql_0->close();
    2323 return $realm_name;
    2424}
     
    3030 global $lang_global, $mangos_db, $realm_id;
    3131 if($item_id){
    32         $mysql_1 = new MySQL;
    33         $mysql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    34 
    35         $result = $mysql_1->query("SELECT name FROM item_template WHERE entry = '$item_id'");
    36         $item_name = ($mysql_1->num_rows($result) == 1) ? $mysql_1->result($result, 0,"name") : "ItemID: $item_id Not Found" ;
    37 
    38         $mysql_1->close();
     32        $sql_1 = new SQL;
     33        $sql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     34
     35        $result = $sql_1->query("SELECT name FROM item_template WHERE entry = '$item_id'");
     36        $item_name = ($sql_1->num_rows($result) == 1) ? $sql_1->result($result, 0,"name") : "ItemID: $item_id Not Found" ;
     37
     38        $sql_1->close();
    3939        return $item_name;
    4040 } else return NULL;
     
    4747 global $lang_global, $lang_item, $lang_id_tab, $mangos_db, $realm_id, $itemset_id;
    4848 if($item_id){
    49         $mysql_1 = new MySQL;
    50         $mysql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     49        $sql_1 = new SQL;
     50        $sql_1->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    5151       
    52         $result_1 = $mysql_1->query("SELECT stat_type1,stat_value1,stat_type2,stat_value2,stat_type3,stat_value3,stat_type4,
     52        $result_1 = $sql_1->query("SELECT stat_type1,stat_value1,stat_type2,stat_value2,stat_type3,stat_value3,stat_type4,
    5353                stat_value4,stat_type5,stat_value5,stat_type6,stat_value6,stat_type7,stat_value7,stat_type8,
    5454                stat_value8,stat_type9,stat_value9,stat_type10,stat_value10,armor,holy_res,fire_res,nature_res,
     
    6060                spellcharges_4,spellcharges_5,AllowableClass,socketColor_1,socketColor_2,socketColor_3,RandomProperty,RandomSuffix
    6161                FROM item_template WHERE entry = '$item_id' LIMIT 1");
    62         if ($item = $mysql_1->fetch_row($result_1)) {
     62        if ($item = $sql_1->fetch_row($result_1)) {
    6363                $tooltip = "";
    6464
     
    439439                        switch ($item[$p]) {
    440440                                case 1:
    441                                 $tooltip .= "<img src='img/socket_meta.gif' class='no_border' alt='' /><font color='gray'> {$lang_item['socket_meta']}</font><br />";
     441                                $tooltip .= "<img src='img/socket_meta.gif' alt='' /><font color='gray'> {$lang_item['socket_meta']}</font><br />";
    442442                                break;
    443443                                case 2:
    444                                 $tooltip .= "<img src='img/socket_red.gif' class='no_border' alt='' /><font color='red'> {$lang_item['socket_red']}</font><br />";
     444                                $tooltip .= "<img src='img/socket_red.gif' alt='' /><font color='red'> {$lang_item['socket_red']}</font><br />";
    445445                                break;
    446446                                case 4:
    447                                 $tooltip .= "<img src='img/socket_yellow.gif' class='no_border' alt='' /><font color='yellow'> {$lang_item['socket_yellow']}</font><br />";
     447                                $tooltip .= "<img src='img/socket_yellow.gif' alt='' /><font color='yellow'> {$lang_item['socket_yellow']}</font><br />";
    448448                                break;
    449449                                case 8:
    450                                 $tooltip .= "<img src='img/socket_blue.gif' class='no_border' alt='' /><font color='blue'> {$lang_item['socket_blue']}</font><br />";
     450                                $tooltip .= "<img src='img/socket_blue.gif' alt='' /><font color='blue'> {$lang_item['socket_blue']}</font><br />";
    451451                                break;
    452452                        default:
     
    595595                $tooltip .= "<br /><font color='orange'>{$lang_item['item_set']} : ".get_itemset_name($item[55])." ($item[55])</font>";
    596596                }
    597         if ($item[54]) $tooltip .= "<br /><font color='orange'>''$item[54]''</font>";
     597        if ($item[54]) $tooltip .= "<br /><font color='orange'>''".str_replace("\"", " '", $item[54])."''</font>";
    598598
    599599        } else $tooltip = "Item ID: $item_id Not Found" ;
    600600
    601         $mysql_1->close();
     601        $sql_1->close();
    602602        return $tooltip;
    603603 } else return(NULL);
  • minimanager/scripts/global_lib.php

    r5 r19  
    137137}
    138138
     139//##########################################################################################
     140function aasort(&$array, $field, $order = false){
     141        if(is_string($field)) $field = "'$field'";
     142        $order = ($order ? '<' : '>');
     143        usort($array,
     144                create_function('$a, $b',
     145                'return ($a['.$field.'] == $b['.$field.'] ? 0 :($a['.$field.'] '.$order.' $b['.$field.']) ? 1 : -1);')
     146        );
     147}
    139148?>
  • minimanager/scripts/id_tab.php

    r5 r19  
    185185////////////////////////////////////////////////////////////////////////////////////////////////
    186186//get zone name by mapid and players x,y
    187 // Y1 ,Y2,X1,X2 - Upper left Y Coord of Box, Lower Right Y Coord of Box, Lower Right X Coord of Box, Upper Left X Coord of Box
    188 $zone_0 = Array( //Azeroth
    189         0 => Array(700,10,1244,1873,$lang_id_tab['undercity'],1497),
    190         1 => Array(-840,-1330,-5050,-4560,$lang_id_tab['ironforge'],1537),
    191         2 => Array(1190,200,-9074,-8280,$lang_id_tab['stormwind_city'],1519),
    192         3 => Array(-2170,-4400,-7348,-6006,$lang_id_tab['badlands'],3),
    193         4 => Array(-500,-4400,-4485,-2367,$lang_id_tab['wetlands'],11),
    194         5 => Array(2220,-2250,-15422,-11299,$lang_id_tab['stranglethorn_vale'],33),
    195         6 => Array(-1724,-3540,-9918,-8667,$lang_id_tab['redridge_mountains'],44),
    196         7 => Array(-2480,-4400,-6006,-4485,$lang_id_tab['loch_modan'],38),
    197         8 => Array(662,-1638,-11299,-9990,$lang_id_tab['duskwood'],10),
    198         9 => Array(-1638,-2344,-11299,-9918,$lang_id_tab['deadwind_pass'],41),
    199         10 => Array(834,-1724,-9990,-8526,$lang_id_tab['elwynn_forest'],12),
    200         11 => Array(-500,-3100,-8667,-7348,$lang_id_tab['burning_steppes'],46),
    201         12 => Array(-608,-2170,-7348,-6285,$lang_id_tab['searing_gorge'],51),
    202         13 => Array(2000,-2480,-6612,-4485,$lang_id_tab['dun_morogh'],1),
    203         14 => Array(-1575,-5425,-432,805,$lang_id_tab['the_hinterlands'],47),
    204         15 => Array(3016,662,-11299,-9400,$lang_id_tab['westfall'],40),
    205         16 => Array(600,-1575,-1874,220,$lang_id_tab['hillsbrad_foothills'],267),
    206         17 => Array(-2725,-6056,805,3800,$lang_id_tab['eastern_plaguelands'],139),
    207         18 => Array(-850,-2725,805,3400,$lang_id_tab['western_plaguelands'],28),
    208         19 => Array(2200,600,-900,1525,$lang_id_tab['silverpine_forest'],130),
    209         20 => Array(2200,-850,1525,3400,$lang_id_tab['tirisfal_glades'],85),
    210         21 => Array(-2250,-3520,-12800,-10666,$lang_id_tab['blasted_lands'],4),
    211         22 => Array(-2344,-4516,-11070,-9600,$lang_id_tab['swamp_of_sorrows'],8),
    212         23 => Array(-1575,-3900,-2367,-432,$lang_id_tab['arathi_highlands'],45),
    213         24 => Array(600,-1575,220,1525,$lang_id_tab['alterac_mountains'],36)
     187$zone_id = Array(
     188 //Azeroth
     189        1497 => Array($lang_id_tab['undercity'],1497),
     190        1537 => Array($lang_id_tab['ironforge'],1537),
     191        1519 => Array($lang_id_tab['stormwind_city'],1519),
     192        3 => Array($lang_id_tab['badlands'],3),
     193        11 => Array($lang_id_tab['wetlands'],11),
     194        33 => Array($lang_id_tab['stranglethorn_vale'],33),
     195        44 => Array($lang_id_tab['redridge_mountains'],44),
     196        38 => Array($lang_id_tab['loch_modan'],38),
     197        10 => Array($lang_id_tab['duskwood'],10),
     198        41 => Array($lang_id_tab['deadwind_pass'],41),
     199        12 => Array($lang_id_tab['elwynn_forest'],12),
     200        46 => Array($lang_id_tab['burning_steppes'],46),
     201        51 => Array($lang_id_tab['searing_gorge'],51),
     202        1 => Array($lang_id_tab['dun_morogh'],1),
     203        47 => Array($lang_id_tab['the_hinterlands'],47),
     204        40 => Array($lang_id_tab['westfall'],40),
     205        267 => Array($lang_id_tab['hillsbrad_foothills'],267),
     206        139 => Array($lang_id_tab['eastern_plaguelands'],139),
     207        28 => Array($lang_id_tab['western_plaguelands'],28),
     208        130 => Array($lang_id_tab['silverpine_forest'],130),
     209        85 => Array($lang_id_tab['tirisfal_glades'],85),
     210        4 => Array($lang_id_tab['blasted_lands'],4),
     211        8 => Array($lang_id_tab['swamp_of_sorrows'],8),
     212        45 => Array($lang_id_tab['arathi_highlands'],45),
     213        36 => Array($lang_id_tab['alterac_mountains'],36),
     214 //Kalimdor
     215        1657 => Array($lang_id_tab['darnassus'],1657),
     216        1638 => Array($lang_id_tab['thunder_bluff'],1638),
     217        1637 => Array($lang_id_tab['orgrimmar'],1637),
     218        493 => Array($lang_id_tab['moonglade'],493),
     219        1377 => Array($lang_id_tab['silithus'],1377),
     220        618 => Array($lang_id_tab['winterspring'],618),
     221        490 => Array($lang_id_tab['un_goro_crater'],490),
     222        361 => Array($lang_id_tab['felwood'],361),
     223        16 => Array($lang_id_tab['azshara'],16),
     224        440 => Array($lang_id_tab['tanaris'],440),
     225        15 => Array($lang_id_tab['dustwallow_marsh'],15),
     226        215 => Array($lang_id_tab['mulgore'],215),
     227        357 => Array($lang_id_tab['feralas'],357),
     228        405 => Array($lang_id_tab['desolace'],405),
     229        400 => Array($lang_id_tab['thousand_needles'],400),
     230        14 => Array($lang_id_tab['durotar'],14),
     231        331 => Array($lang_id_tab['ashenvale'],331),
     232        148 => Array($lang_id_tab['darkshore'],148),
     233        141 => Array($lang_id_tab['teldrassil'],141),
     234        406 => Array($lang_id_tab['stonetalon_mountains'],406),
     235        17 => Array($lang_id_tab['the_barrens'],17),
     236 //Outland
     237        3703 => Array($lang_id_tab['shattrath_city'],3703),
     238        3487 => Array($lang_id_tab['silvermoon_city'],3487),
     239        3523 => Array($lang_id_tab['netherstorm'],3523),
     240        3519 => Array($lang_id_tab['terokkar_forest'],3519),
     241        3518 => Array($lang_id_tab['nagrand'],3518),
     242        3525 => Array($lang_id_tab['bloodmyst_isle'],3525),
     243        3522 => Array($lang_id_tab['blades_edge_mountains'],3522),
     244        3520 => Array($lang_id_tab['shadowmoon_valley'],3520),
     245        3557 => Array($lang_id_tab['the_exodar'],3557),
     246        3521 => Array($lang_id_tab['zangarmarsh'],3521),
     247        3483 => Array($lang_id_tab['hellfire_peninsula'],3483),
     248        3524 => Array($lang_id_tab['azuremyst_isle'],3524),
     249        3433 => Array($lang_id_tab['ghostlands'],3433),
     250        3430 => Array($lang_id_tab['eversong_woods'],3430)
    214251        );
    215252
    216 $zone_1 = Array( //Kalimdor
    217         0 => Array(2698,2030,9575,10267,$lang_id_tab['darnassus'],1657),
    218         1 => Array(326,-360,-1490,-910,$lang_id_tab['thunder_bluff'],1638),
    219         2 => Array(-3849,-4809,1387,2222,$lang_id_tab['orgrimmar'],1637),
    220         3 => Array(-1300,-3250,7142,8500,$lang_id_tab['moonglade'],493),
    221         4 => Array(2021,-400,-9000,-6016,$lang_id_tab['silithus'],1377),
    222         5 => Array(-2259,-7000,4150,8500,$lang_id_tab['winterspring'],618),
    223         6 => Array(-400,-2094,-8221,-6016,$lang_id_tab['un_goro_crater'],490),
    224         7 => Array(-590,-2259,3580,7142,$lang_id_tab['felwood'],361),
    225         8 => Array(-3787,-8000,1370,6000,$lang_id_tab['azshara'],16),
    226         9 => Array(-1900,-5500,-10475,-6825,$lang_id_tab['tanaris'],440),
    227         10 => Array(-2478,-5500,-5135,-2330,$lang_id_tab['dustwallow_marsh'],15),
    228         11 => Array(360,-1536,-3474,-412,$lang_id_tab['mulgore'],215),
    229         12 => Array(4000,-804,-6828,-2477,$lang_id_tab['feralas'],357),
    230         13 => Array(3500,360,-2477,372,$lang_id_tab['desolace'],405),
    231         14 => Array(-804,-5500,-6828,-4566,$lang_id_tab['thousand_needles'],400),
    232         15 => Array(-3758,-5500,-1300,1370,$lang_id_tab['durotar'],14),
    233         16 => Array(1000,-3787,1370,4150,$lang_id_tab['ashenvale'],331),
    234         17 => Array(2500,-1300,4150,8500,$lang_id_tab['darkshore'],148),
    235         18 => Array(3814,-1100,8600,11831,$lang_id_tab['teldrassil'],141),
    236         19 => Array(3500,-804,-412,3580,$lang_id_tab['stonetalon_mountains'],406),
    237         20 => Array(-804,-4200,-4566,1370,$lang_id_tab['the_barrens'],17)
    238         );
    239 
    240 $zone_530 = Array( //Outland
    241         0 => Array(6135.25,4829,-2344.78,-1473.95,$lang_id_tab['shattrath_city'],3703),
    242         1 => Array(-6400.75,-7612.20,9346.93,10153.70,$lang_id_tab['silvermoon_city'],3487),
    243         2 => Array(5483.33,-91.66,1739.58,5456.25,$lang_id_tab['netherstorm'],3523),
    244         3 => Array(7083.33,1683.33,-4600,-999.99,$lang_id_tab['terokkar_forest'],3519),
    245         4 => Array(10295.83,4770.83,-3641.66,41.66,$lang_id_tab['nagrand'],3518),
    246         5 => Array(-10075,-13337.49,-2933.33,-758.33,$lang_id_tab['bloodmyst_isle'],3525),
    247         6 => Array(8845.83,3420.83,791.66,4408.33,$lang_id_tab['blades_edge_mountains'],3522),
    248         7 => Array(4225,-1275,-5614.58,-1947.91,$lang_id_tab['shadowmoon_valley'],3520),
    249         8 => Array(-11066.36,-12123.13,-4314.37,-3609.68,$lang_id_tab['the_exodar'],3557),
    250         9 => Array(9475,4447.91,-1416.66,1935.41,$lang_id_tab['zangarmarsh'],3521),
    251         10 => Array(5539.58,375,-1962.49,1481.25,$lang_id_tab['hellfire_peninsula'],3483),
    252         11 => Array(-10500,-14570.83,-5508.33,-2793.75,$lang_id_tab['azuremyst_isle'],3524),
    253         12 => Array(-5283.33,-8583.33,6066.66,8266.66,$lang_id_tab['ghostlands'],3433),
    254         13 => Array(-4487.5,-9412.5,7758.33,11041.66,$lang_id_tab['eversong_woods'],3430)
    255 );
    256 
    257 // Y1 ,Y2,X1,X2 - Upper left Y Coord of Box, Lower Right Y Coord of Box, Upper Left X Coord of Box,  Lower Right X Coord of Box
    258 function get_zone_name($map_id,$player_x,$player_y){
    259  global $zone_0,$zone_1,$zone_530;
    260  switch ($map_id) {
    261         case 0:
    262         for ($i=0; $i < count($zone_0); $i++)
    263                 if (($zone_0[$i][2] < $player_x) && ($zone_0[$i][3] > $player_x) && ($zone_0[$i][1] < $player_y) && ($zone_0[$i][0] > $player_y)) return ($zone_0[$i][4]);
    264         break;
    265         case 1:
    266         for ($i=0; $i < count($zone_1); $i++)
    267                 if (($zone_1[$i][2] < $player_x) && ($zone_1[$i][3] > $player_x) && ($zone_1[$i][1] < $player_y) && ($zone_1[$i][0] > $player_y)) return ($zone_1[$i][4]);
    268         break;
    269         case 530:
    270         for ($i=0; $i < count($zone_530); $i++)
    271                 if (($zone_530[$i][2] < $player_x) && ($zone_530[$i][3] > $player_x) && ($zone_530[$i][1] < $player_y) && ($zone_530[$i][0] > $player_y)) return ($zone_530[$i][4]);
    272         break;
    273 
    274         default:
    275         return(" ");
    276         }
     253function get_zone_name($id){
     254 global $zone_id;
     255        if( isset($zone_id[$id])) return $zone_id[$id][0];
     256                else return(" ");
    277257}
    278258
  • minimanager/stat.php

    r5 r19  
    5555);
    5656
    57  $mysql = new MySQL;
    58  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    59  $query = $mysql->query("SELECT count(*) FROM account UNION SELECT count(*) FROM account WHERE gmlevel > 0");
    60  $total_acc = $mysql->result($query,0);
    61  $total_gms = $mysql->result($query,1);
     57 $sql = new SQL;
     58 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     59 $query = $sql->query("SELECT count(*) FROM account UNION SELECT count(*) FROM account WHERE gmlevel > 0");
     60 $total_acc = $sql->result($query,0);
     61 $total_gms = $sql->result($query,1);
    6262
    63  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    64  $query = $mysql->query("SELECT count(*) FROM `character`");
    65  $total_chars = $mysql->result($query,0);
     63 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     64 $query = $sql->query("SELECT count(*) FROM `character`");
     65 $total_chars = $sql->result($query,0);
    6666 
    67  $query = $mysql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime");
    68  $uptime = $mysql->fetch_row($query);
     67 $query = $sql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime");
     68 $uptime = $sql->fetch_row($query);
    6969 
    7070 if ($total_chars){
    7171 
    72  $order_race = (isset($_GET['race'])) ? "AND race =".$mysql->quote_smart($_GET['race']) : "";
    73  $order_class = (isset($_GET['class'])) ? "AND class =".$mysql->quote_smart($_GET['class']) : "";
     72 $order_race = (isset($_GET['race'])) ? "AND race =".$sql->quote_smart($_GET['race']) : "";
     73 $order_class = (isset($_GET['class'])) ? "AND class =".$sql->quote_smart($_GET['class']) : "";
    7474
    7575 if(isset($_GET['level'])){
    76         $lvl_min = $mysql->quote_smart($_GET['level']);
     76        $lvl_min = $sql->quote_smart($_GET['level']);
    7777        $lvl_max = $lvl_min + 4;
    7878        $order_level = "AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) >= $lvl_min AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) <= $lvl_max";
     
    8080       
    8181 if(isset($_GET['side'])) {
    82         if ($mysql->quote_smart($_GET['side']) == "h") $order_side = "AND race IN(2,5,6,8,10)";
    83                 elseif ($mysql->quote_smart($_GET['side']) == "a") $order_side = "AND race IN (1,3,4,7,11)";
     82        if ($sql->quote_smart($_GET['side']) == "h") $order_side = "AND race IN(2,5,6,8,10)";
     83                elseif ($sql->quote_smart($_GET['side']) == "a") $order_side = "AND race IN (1,3,4,7,11)";
    8484        } else $order_side = "";
    8585       
     
    8888 
    8989 //there is always less hordies
    90  $query = $mysql->query("SELECT count(guid) FROM `character` WHERE race IN(2,5,6,8,10)");
    91  $horde_chars = $mysql->result($query,0);
     90 $query = $sql->query("SELECT count(guid) FROM `character` WHERE race IN(2,5,6,8,10)");
     91 $horde_chars = $sql->result($query,0);
    9292 $horde_pros = round(($horde_chars*100)/$total_chars ,1);
    9393 $allies_chars = $total_chars - $horde_chars;
     
    117117// RACE
    118118foreach ($race as $id){
    119         $query = $mysql->query("SELECT count(guid) FROM `character` WHERE race = $id[0] $order_class $order_level $order_side");
    120         $race[$id[0]][2] = $mysql->result($query,0);
     119        $query = $sql->query("SELECT count(guid) FROM `character` WHERE race = $id[0] $order_class $order_level $order_side");
     120        $race[$id[0]][2] = $sql->result($query,0);
    121121        $race[$id[0]][3] = round((($race[$id[0]][2])*100)/$total_chars,1);
    122122 }
     
    140140// CLASS
    141141foreach ($class as $id){
    142                 $query = $mysql->query("SELECT count(guid) FROM `character` WHERE class = $id[0] $order_race $order_level $order_side");
    143                 $class[$id[0]][2] = $mysql->result($query,0);
     142                $query = $sql->query("SELECT count(guid) FROM `character` WHERE class = $id[0] $order_race $order_level $order_side");
     143                $class[$id[0]][2] = $sql->result($query,0);
    144144                $class[$id[0]][3] = round((($class[$id[0]][2])*100)/$total_chars,1);
    145145 }
     
    163163// LEVEL
    164164foreach ($level as $id){
    165                 $query = $mysql->query("SELECT count(guid) FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) >= $id[1]
     165                $query = $sql->query("SELECT count(guid) FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) >= $id[1]
    166166                                                                AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) <= $id[2] $order_race $order_class $order_side");
    167                 $level[$id[0]][3] = $mysql->result($query,0);
     167                $level[$id[0]][3] = $sql->result($query,0);
    168168                $level[$id[0]][4] = round((($level[$id[0]][3])*100)/$total_chars,1);
    169169 }
     
    189189        </center>";
    190190
    191  $mysql->close();
     191 $sql->close();
    192192 
    193193} else {
    194         $mysql->close();
     194        $sql->close();
    195195        error($lang_global['err_no_result']);
    196196        }
  • minimanager/tele.php

    r5 r19  
    1919 global $lang_tele, $lang_global, $output, $mangos_db, $realm_id, $itemperpage;
    2020
    21  $mysql = new MySQL;
    22  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    23  
    24  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    25  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "id";
    26 
    27  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     21 $sql = new SQL;
     22 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     23 
     24 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     25 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "id";
     26
     27 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    2828 $order_dir = ($dir) ? "ASC" : "DESC";
    2929 $dir = ($dir) ? 0 : 1;
    3030 
    3131//get total number of items
    32  $query_1 = $mysql->query("SELECT count(*) FROM game_tele");
    33  $all_record = $mysql->result($query_1,0);
    34  $query = $mysql->query("SELECT id, name, map, position_x, position_y, position_z, orientation
     32 $query_1 = $sql->query("SELECT count(*) FROM game_tele");
     33 $all_record = $sql->result($query_1,0);
     34 $query = $sql->query("SELECT id, name, map, position_x, position_y, position_z, orientation
    3535                 FROM game_tele ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    36  $this_page = $mysql->num_rows($query);
     36 $this_page = $sql->num_rows($query);
    3737
    3838//==========================top tage navigaion starts here========================
     
    5858//==========================top tage navigaion ENDS here ========================
    5959
    60  $output .= "<table class=\"lined\">
     60 $output .= "<script type=\"text/javascript\">
     61        answerbox.btn_ok='{$lang_global['yes_low']}';
     62        answerbox.btn_cancel='{$lang_global['no']}';
     63        var question = '{$lang_global['are_you_sure']}';
     64        var del_tele = 'tele.php?action=del_tele&amp;order_by=$order_by&amp;start=$start&amp;dir=$dir&amp;id=';
     65 </script>
     66 <table class=\"lined\">
    6167   <tr>
    62         <td width=\"5%\" class=\"head\">{$lang_global['delete']}</td>
    63         <td width=\"5%\" class=\"head\"><a href=\"tele.php?order_by=id&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['id']}</a></td>
    64         <td width=\"28%\" class=\"head\"><a href=\"tele.php?order_by=name&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['name']}</a></td>
    65         <td width=\"22%\" class=\"head\"><a href=\"tele.php?order_by=map&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['map']}</a></td>
    66         <td width=\"9%\" class=\"head\"><a href=\"tele.php?order_by=position_x&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['x']}</a></td>
    67         <td width=\"9%\" class=\"head\"><a href=\"tele.php?order_by=position_y&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['y']}</a></td>
    68         <td width=\"9%\" class=\"head\"><a href=\"tele.php?order_by=position_z&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['z']}</a></td>
    69         <td width=\"10%\" class=\"head\"><a href=\"tele.php?order_by=orientation&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_tele['orientation']}</a></td>
     68        <th width=\"5%\">{$lang_global['delete_short']}</th>
     69        <th width=\"5%\"><a href=\"tele.php?order_by=id&amp;start=$start&amp;dir=$dir\">".($order_by=='id' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['id']}</a></th>
     70        <th width=\"28%\"><a href=\"tele.php?order_by=name&amp;start=$start&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['name']}</a></th>
     71        <th width=\"22%\><a href=\"tele.php?order_by=map&amp;start=$start&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['map']}</a></th>
     72        <th width=\"9%\"><a href=\"tele.php?order_by=position_x&amp;start=$start&amp;dir=$dir\">".($order_by=='position_x' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['x']}</a></th>
     73        <th width=\"9%\"><a href=\"tele.php?order_by=position_y&amp;start=$start&amp;dir=$dir\">".($order_by=='position_y' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['y']}</a></th>
     74        <th width=\"9%\"><a href=\"tele.php?order_by=position_z&amp;start=$start&amp;dir=$dir\">".($order_by=='position_z' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['z']}</a></th>
     75        <th width=\"10%\"><a href=\"tele.php?order_by=orientation&amp;start=$start&amp;dir=$dir\">".($order_by=='orientation' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['orientation']}</a></th>
    7076   </tr>";
    7177
    72 while ($data = $mysql->fetch_row($query)){
     78while ($data = $sql->fetch_row($query)){
    7379        $output .= "<tr>
    74                         <td><a href=\"tele.php?action=del_tele&amp;id=$data[0]\"><img src=\"img/x.ico\" class=\"no_border\" alt=\"\" /></a></td>
     80                        <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$data[1]}</font> <br /> ' + question, del_tele + $data[0]);\" style=\"cursor:pointer;\" /></td>
    7581                        <td>$data[0]</td>
    7682                        <td><a href=\"tele.php?action=edit_tele&amp;id=$data[0]\">$data[1]</a></td>
     
    8692   </table></center>";
    8793
    88  $mysql->close();
     94 $sql->close();
    8995}
    9096
     
    98104 if(empty($_GET['search_value']) || empty($_GET['search_by'])) redirect("guild.php?error=2");
    99105
    100  $mysql = new MySQL;
    101  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    102  
    103  $search_value = $mysql->quote_smart($_GET['search_value']);
    104  $search_by = $mysql->quote_smart($_GET['search_by']);
    105 
    106  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "id";
    107  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     106 $sql = new SQL;
     107 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     108 
     109 $search_value = $sql->quote_smart($_GET['search_value']);
     110 $search_by = $sql->quote_smart($_GET['search_by']);
     111
     112 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "id";
     113 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    108114 $order_dir = ($dir) ? "ASC" : "DESC";
    109115 $dir = ($dir) ? 0 : 1;
    110116 
    111  $query = $mysql->query("SELECT id, name, map, position_x, position_y, position_z, orientation
     117 $query = $sql->query("SELECT id, name, map, position_x, position_y, position_z, orientation
    112118                FROM game_tele WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit");
    113  $total_found = $mysql->num_rows($query);
     119 $total_found = $sql->num_rows($query);
    114120
    115121//==========================top tage navigaion starts here========================
    116  $output .="<center><table class=\"top_hidden\">
     122 $output .="<script type=\"text/javascript\">
     123                        answerbox.btn_ok='{$lang_global['yes_low']}';
     124                        answerbox.btn_cancel='{$lang_global['no']}';
     125                        var question = '{$lang_global['are_you_sure']}';
     126                        var del_tele = 'tele.php?action=del_tele&amp;order_by=$order_by&amp;dir=$dir&amp;id=';
     127                 </script>
     128                 <center><table class=\"top_hidden\">
    117129                        <tr><td>";
    118130                        makebutton($lang_tele['add_new'], "tele.php?action=add_tele",90);
     
    133145 $output .= "<table class=\"lined\">
    134146   <tr>
    135         <td width=\"5%\" class=\"head\">{$lang_global['delete']}</td>
    136         <td width=\"5%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=id&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['id']}</a></td>
    137         <td width=\"28%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=name&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['name']}</a></td>
    138         <td width=\"22%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=map&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['map']}</a></td>
    139         <td width=\"9%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_x&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['x']}</a></td>
    140         <td width=\"9%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_y&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['y']}</a></td>
    141         <td width=\"9%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_z&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['z']}</a></td>
    142         <td width=\"10%\" class=\"head\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=orientation&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\" class=\"head_link\">{$lang_tele['orientation']}</a></td>
     147        <th width=\"5%\">{$lang_global['delete_short']}</th>
     148        <th width=\"5%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=id&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='id' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['id']}</a></th>
     149        <th width=\"28%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=name&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['name']}</a></th>
     150        <th width=\"22%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=map&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['map']}</a></th>
     151        <th width=\"9%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_x&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='position_x' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['x']}</a></th>
     152        <th width=\"9%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_y&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='position_y' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['y']}</a></th>
     153        <th width=\"9%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=position_z&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='position_z' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['z']}</a></th>
     154        <th width=\"10%\"><a href=\"tele.php?action=search&amp;error=4&amp;order_by=orientation&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='orientation' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_tele['orientation']}</a></th>
    143155   </tr>";
    144156
    145 while ($data = $mysql->fetch_row($query)){
     157while ($data = $sql->fetch_row($query)){
    146158        $output .= "<tr>
    147                 <td><a href=\"tele.php?action=del_tele&amp;id=$data[0]\"><img src=\"img/x.ico\" class=\"no_border\" alt=\"\" /></a></td>
     159                <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$data[1]}</font> <br /> ' + question, del_tele + $data[0]);\" style=\"cursor:pointer;\" /></td>
    148160                <td>$data[0]</td>
    149161                <td><a href=\"tele.php?action=edit_tele&amp;id=$data[0]\">$data[1]</a></td>
     
    161173   </table></center>";
    162174
    163  $mysql->close();
     175 $sql->close();
    164176}
    165177
     
    171183 global $mangos_db, $realm_id;
    172184
    173  $mysql = new MySQL;
    174  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    175  
    176  if(isset($_GET['id'])) $id = $mysql->quote_smart($_GET['id']);
     185 $sql = new SQL;
     186 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     187 
     188 if(isset($_GET['id'])) $id = $sql->quote_smart($_GET['id']);
    177189        else redirect("Location: tele.php?error=1");
    178190
    179  $mysql->query("DELETE FROM game_tele WHERE id = '$id'");
    180 
    181  if ($mysql->affected_rows() != 0) {
    182         $mysql->close();
    183         redirect("tele.php?error=3");
     191 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     192 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "id";
     193 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
     194 $dir = ($dir) ? 0 : 1;
     195 
     196 $sql->query("DELETE FROM game_tele WHERE id = '$id'");
     197
     198 if ($sql->affected_rows() != 0) {
     199        $sql->close();
     200        redirect("tele.php?error=3&order_by=$order_by&start=$start&dir=$dir");
    184201    } else {
    185          $mysql->close();
     202         $sql->close();
    186203         redirect("tele.php?error=5");
    187204        }
     
    195212 global  $lang_tele, $lang_global, $output, $mangos_db, $realm_id, $map_id;
    196213
    197  $mysql = new MySQL;
    198  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    199  
    200  if(isset($_GET['id'])) $id = $mysql->quote_smart($_GET['id']);
     214 $sql = new SQL;
     215 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     216 
     217 if(isset($_GET['id'])) $id = $sql->quote_smart($_GET['id']);
    201218        else redirect("tele.php?error=1");
    202219
    203  $query = $mysql->query("SELECT id, name, map, position_x, position_y, position_z, orientation FROM game_tele WHERE id = '$id'");
    204 
    205  if ($mysql->num_rows($query) == 1) {
    206         $tele = $mysql->fetch_row($query);
     220 $query = $sql->query("SELECT id, name, map, position_x, position_y, position_z, orientation FROM game_tele WHERE id = '$id'");
     221
     222 if ($sql->num_rows($query) == 1) {
     223        $tele = $sql->fetch_row($query);
    207224
    208225        $output .= "<center>
     
    261278  } else error($lang_global['err_no_records_found']);
    262279 
    263  $mysql->close();
     280 $sql->close();
    264281}
    265282
     
    275292  redirect("tele.php?error=1");
    276293
    277  $mysql = new MySQL;
    278  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    279  
    280  $id = $mysql->quote_smart($_GET['id']);
    281  $new_name = $mysql->quote_smart($_GET['new_name']);
    282  $new_map = $mysql->quote_smart($_GET['new_map']);
    283  $new_x = $mysql->quote_smart($_GET['new_x']);
    284  $new_y = $mysql->quote_smart($_GET['new_y']);
    285  $new_z = $mysql->quote_smart($_GET['new_z']);
    286  $new_orientation = $mysql->quote_smart($_GET['new_orientation']);
    287 
    288  $mysql->query("UPDATE game_tele SET position_x='$new_x', position_y ='$new_y', position_z ='$new_z', orientation ='$new_orientation', map ='$new_map', name ='$new_name' WHERE id = '$id'");
    289 
    290  if (mysql_affected_rows()) {
    291         $mysql->close();
     294 $sql = new SQL;
     295 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     296 
     297 $id = $sql->quote_smart($_GET['id']);
     298 $new_name = $sql->quote_smart($_GET['new_name']);
     299 $new_map = $sql->quote_smart($_GET['new_map']);
     300 $new_x = $sql->quote_smart($_GET['new_x']);
     301 $new_y = $sql->quote_smart($_GET['new_y']);
     302 $new_z = $sql->quote_smart($_GET['new_z']);
     303 $new_orientation = $sql->quote_smart($_GET['new_orientation']);
     304
     305 $sql->query("UPDATE game_tele SET position_x='$new_x', position_y ='$new_y', position_z ='$new_z', orientation ='$new_orientation', map ='$new_map', name ='$new_name' WHERE id = '$id'");
     306
     307 if ($sql->affected_rows()) {
     308        $sql->close();
    292309        redirect("tele.php?error=3");
    293310    } else {
    294                 $mysql->close();
     311                $sql->close();
    295312                redirect("tele.php?error=5");
    296313        }
     
    360377  redirect("tele.php?error=1");
    361378
    362  $mysql = new MySQL;
    363  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    364 
    365  $name = $mysql->quote_smart($_GET['name']);
    366  $map = $mysql->quote_smart($_GET['map']);
    367  $x = $mysql->quote_smart($_GET['x']);
    368  $y = $mysql->quote_smart($_GET['y']);
    369  $z = $mysql->quote_smart($_GET['z']);
    370  $orientation = $mysql->quote_smart($_GET['orientation']);
    371 
    372  $mysql->query("INSERT INTO game_tele VALUES (NULL,'$x','$y', '$z' ,'$orientation' ,'$map' ,'$name')");
    373 
    374  if (mysql_affected_rows()) {
    375         $mysql->close();
     379 $sql = new SQL;
     380 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     381
     382 $name = $sql->quote_smart($_GET['name']);
     383 $map = $sql->quote_smart($_GET['map']);
     384 $x = $sql->quote_smart($_GET['x']);
     385 $y = $sql->quote_smart($_GET['y']);
     386 $z = $sql->quote_smart($_GET['z']);
     387 $orientation = $sql->quote_smart($_GET['orientation']);
     388
     389 $sql->query("INSERT INTO game_tele VALUES (NULL,'$x','$y', '$z' ,'$orientation' ,'$map' ,'$name')");
     390
     391 if ($sql->affected_rows()) {
     392        $sql->close();
    376393        redirect("tele.php?error=3");
    377394    } else {
    378                 $mysql->close();
     395                $sql->close();
    379396                redirect("tele.php?error=5");
    380397        }
  • minimanager/templates/Malachite/Malachite_1024.css

    r5 r19  
    77 * License: GNU General Public License (GPL)
    88 */
    9 
    10 html,body {
    11         background:#76827B;
     9html{
     10        overflow-x:auto;        /* fixes MSIE scrollbar bug DO NOT REMOVE,has no effect in Mozilla,or Opera */
     11                                                /* http://www.blooberry.com/indexdot/css/properties/position/overflowx.htm */
     12}
     13html,body{
     14        background-color:#76827B;
    1215        color:#000000;
    1316        height:100%;
     
    1518        margin:0;
    1619        font:9pt Verdana,sans-serif;
    17         cursor: default;
     20        cursor:default;
    1821}
    1922
     
    5053        left:25px;
    5154        top:37px;
    52         z-index:40;
     55        z-index:100;
    5356        width: 36em; /*total len*/
    5457        text-align: left;
     
    131134}
    132135h1{
    133     margin:0;
     136    margin:0px;
    134137    font:16pt Trebuchet MS,sans-serif;
    135138    font-weight:bold;
     
    160163        background-color: #b2c2b9;
    161164        }
    162 
     165img {
     166        border: 0px;
     167        padding: 0px;
     168}
     169input[type="radio"],input[type="checkbox"]{
     170        background:none;
     171        border:0px;
     172}
    163173a.button {   
    164174        background:#869c8f;
     
    186196        position: relative;
    187197        margin-top:20px;
    188         padding-top:10px;
     198        padding-top:20px;
    189199        padding-bottom:10px;
    190200        top: 5px;
     
    199209        padding: 2px 6px;
    200210        position:absolute;
    201         top: -5px;
     211        top: -15px;
    202212        left: 5px;
    203213}
    204214
    205215/*****TABLES******/
    206 a.head_link:link, a.head_link:visited{ color: #d4ddd8; text-decoration: none }
    207 a.head_link:hover, a.head_link:focus{ color: #A47236; text-decoration: none }
    208 
    209216table.flat {
    210217        border-width: 5px;
     
    240247        text-align: center;
    241248}
    242 table.lined, table.lined td, table.lined td.head, table.lined td.hidden{
     249table.lined, table.lined td, table.lined td.hidden, table.lined th{
    243250        border: 1px solid  #d4ddd8;
    244251        padding: 5px;
    245252}
    246 table.lined td.head {
     253table.lined th{
    247254        background-color: #374341;
    248255        font-weight: bold;
    249256        font-size: 11px;
    250257        color:#d4ddd8;
     258        padding: 5px;
     259}
     260table.lined th a:link, table.lined th a:visited{
     261 color:#d4ddd8;
     262}
     263 table.lined th a:hover,table.lined th a:focus{
     264        color: #A47236;
     265        text-decoration: none;
    251266}
    252267table.lined td{
     
    276291        height: 24px;
    277292        border: 1px solid #585858;
    278 }
    279 
    280 tr td.bag div {
     293        margin-left: 5px;
     294}
     295
     296tr td.bag div,
     297tr td.bank div {
    281298        position: relative;
    282299        border: 0px;
    283300        margin: 2px;
    284         background: url(../../img/INV/Slot_Bag.gif) repeat;
    285 }
    286 tr td.bag div div{ position: absolute; }
    287 tr td.bag div div img{
     301        background-image: url(../../img/INV/Slot_Bag.gif);
     302        background-repeat: repeat;
     303        background-color: #242424;
     304}
     305tr td.bank div {
     306        background-image: url(../../img/INV/Slot_Bank.gif);
     307        background-color: #858585;
     308}
     309tr td.bag div div,
     310tr td.bank div div{
     311        position: absolute;
     312        background: none;
     313}
     314tr td.bag div div img,
     315tr td.bank div div img{
    288316        border: 0px;
    289317        padding: 1px;
     
    291319        height: 35px;
    292320}
    293 tr td.bag div.no_slot{
     321tr td.bag div.no_slot,
     322tr td.bank div.no_slot{
    294323        position: absolute;
    295         margin: -1px;
     324        margin: 0px;
    296325        width: 86px;
    297326        height: 41px;
    298         background: #b2c2b9;
     327        background-image: url(../../img/INV/Slot_Bag_Out.gif);
     328}
     329tr td.bank div.no_slot{
     330        background-image: url(../../img/INV/Slot_Bank_Out.gif);
    299331}
    300332/*****TABLES END******/
     
    337369        position:relative;
    338370    padding:7px 0px;
    339     background:#d4ddd8;
     371    background-color:#d4ddd8;
    340372    margin-bottom:15px;
    341373        text-align: left;
     
    343375div.bubble div.top {
    344376        text-align: center;
    345         background:#b2c2b9;
     377        background-color:#b2c2b9;
    346378        padding:7px 15px;
    347379    margin:-7px -0px 12px -0px;
     
    415447        padding: 6px;
    416448}
    417 .no_border {
    418         border: 0px;
    419         padding: 0px;
    420 }
     449
    421450.icon_border {
    422451        border: 0px;
    423452        padding: 0px;
    424         width: 32px; height: 32px;
     453        width: 32px;
     454        height: 32px;
    425455}
    426456
     
    439469        background: url(gridline.gif) 15px bottom;
    440470}
     471.bargraph th {
     472        background: #d4ddd8;
     473}
    441474
    442475a.graph_link:link, a.graph_link:visited{ color: #000000; text-decoration: none }
     
    477510        width:60%;
    478511        text-align:right;
     512        margin-top: 3px;
     513        color: #fff !important;
    479514}
    480515tr td.skill_bar{
    481         background-image: url(../../img/skill_bar.png);
     516        background-image: url(../../img/bar_skill.png);
    482517}
    483518
     
    497532        background: #d4ddd8;
    498533        padding: 1em 2em;
    499 
    500534}
    501535#tab a:hover {
     
    559593/*** item tooltips***/
    560594.item_tooltip  td{
    561         float:none;
    562         font-size:11px;
    563         color:#d4d4d4;
     595        float: none;
     596        font-size: 11px;
     597        color: #d4d4d4;
    564598        border:1px solid #F0D070;
    565599        padding:10px;
    566         width:220px;
     600        width:auto;
    567601        background-color:#000;
    568         text-align:left;
     602        text-align: left;
    569603        filter:alpha(opacity=80);
    570604        -moz-opacity:.80;
     
    572606}
    573607.info_tooltip  td{
    574         float:none;
    575         font-size:11px;
    576         color:#d4d4d4;
     608        float: none;
     609        font-size: 11px;
     610        color: #d4d4d4;
    577611        border:0px solid #F0D070;
    578612        padding:10px;
    579         width:220px;
     613        width:240px;
    580614        background-color:#000;
    581615        text-align:left;
     
    584618        opacity:0.85;
    585619}
     620.answerbox {
     621        font-size: 11px;
     622        color: #d4d4d4;
     623        border:1px solid #F0D070;
     624        padding:10px;
     625        width:auto;
     626        background-color:#000;
     627        text-align:center;
     628        filter:alpha(opacity=85);
     629        -moz-opacity:.85;
     630        opacity:0.85;
     631}
     632.answerbox th {
     633        font:16pt Trebuchet MS,sans-serif;
     634    font-weight:bold;
     635        color:#f6b620;
     636        line-height:1.2em;
     637}
     638.answerbox td a {
     639        float:none;
     640        display: block;
     641}
  • minimanager/templates/Malachite/Malachite_1280.css

    r5 r19  
    77 * License: GNU General Public License (GPL)
    88 */
    9 
    10 html,body {
    11         background:#76827B;
     9html{
     10        overflow-x:auto;        /* fixes MSIE scrollbar bug DO NOT REMOVE,has no effect in Mozilla,or Opera */
     11                                                /* http://www.blooberry.com/indexdot/css/properties/position/overflowx.htm */
     12}
     13html,body{
     14        background-color:#76827B;
    1215        color:#000000;
    1316        height:100%;
     
    1518        margin:0;
    1619        font:10pt Verdana,sans-serif;
    17         cursor: default;
     20        cursor:default;
    1821}
    1922
     
    5053        left:22px;
    5154        top:37px;
    52         z-index:40;
     55        z-index:100;
    5356        width: 36em; /*total len*/
    5457        text-align: left;
     
    131134}
    132135h1{
    133     margin:0;
     136    margin:0px;
    134137    font:16pt Trebuchet MS,sans-serif;
    135138    font-weight:bold;
     
    141144}
    142145input, input.mouseover, a.button {
    143         border: 1px solid #76827B;
     146        border-width: 1px;
     147        border-style: solid;
     148        border-color: #76827B;
    144149        background:#76827B;
    145150        font:10pt Verdana,sans-serif;
     
    148153}
    149154input {
    150     background:#869c8f;
     155    background-color:#869c8f;
    151156    color:#414D4C;
    152157    padding:2px 1px;
     
    154159        margin-left: 2px;
    155160}
    156 select,textarea {
     161select,textarea{
    157162        border:1px solid #76827B;
    158163        background-color: #b2c2b9;
    159164        }
    160 
     165img {
     166        border: 0px;
     167        padding: 0px;
     168}
     169input[type="radio"],input[type="checkbox"]{
     170        background:none;
     171        border:0px;
     172}
    161173a.button {   
    162         /*background:transparent;*/
    163174        background:#869c8f;
    164175        color: #414D4C;
     
    170181        margin-left: 3px;
    171182}
    172 
    173183a.button:visited{   
    174184        background-color: #869c8f;
     
    186196        position: relative;
    187197        margin-top:20px;
    188         padding-top:10px;
     198        padding-top:20px;
    189199        padding-bottom:10px;
    190200        top: 5px;
     
    199209        padding: 2px 6px;
    200210        position:absolute;
    201         top: -5px;
     211        top: -15px;
    202212        left: 5px;
    203213}
    204214
    205215/*****TABLES******/
    206 a.head_link:link, a.head_link:visited{ color: #d4ddd8; text-decoration: none }
    207 a.head_link:hover, a.head_link:focus{ color: #A47236; text-decoration: none }
    208 
    209216table.flat {
    210217        border-width: 5px;
     
    240247        text-align: center;
    241248}
    242 table.lined, table.lined td, table.lined td.head, table.lined td.hidden{
     249table.lined, table.lined td, table.lined td.hidden, table.lined th{
    243250        border: 1px solid  #d4ddd8;
    244251        padding: 5px;
    245252}
    246 table.lined td.head {
     253table.lined th{
    247254        background-color: #374341;
    248255        font-weight: bold;
    249         font-size: 12px;
     256        font-size: 11px;
    250257        color:#d4ddd8;
     258        padding: 5px;
     259}
     260table.lined th a:link, table.lined th a:visited{
     261 color:#d4ddd8;
     262}
     263 table.lined th a:hover,table.lined th a:focus{
     264        color: #A47236;
     265        text-decoration: none;
    251266}
    252267table.lined td{
     
    276291        height: 24px;
    277292        border: 1px solid #585858;
    278 }
    279 
    280 tr td.bag div {
     293        margin-left: 5px;
     294}
     295
     296tr td.bag div,
     297tr td.bank div {
    281298        position: relative;
    282299        border: 0px;
    283300        margin: 2px;
    284         background: url(../../img/INV/Slot_Bag.gif) repeat;
    285 }
    286 tr td.bag div div{ position: absolute; }
    287 tr td.bag div div img{
     301        background-image: url(../../img/INV/Slot_Bag.gif);
     302        background-repeat: repeat;
     303        background-color: #242424;
     304}
     305tr td.bank div {
     306        background-image: url(../../img/INV/Slot_Bank.gif);
     307        background-color: #858585;
     308}
     309tr td.bag div div,
     310tr td.bank div div{
     311        position: absolute;
     312        background: none;
     313}
     314tr td.bag div div img,
     315tr td.bank div div img{
    288316        border: 0px;
    289317        padding: 1px;
     
    291319        height: 35px;
    292320}
    293 tr td.bag div.no_slot{
     321tr td.bag div.no_slot,
     322tr td.bank div.no_slot{
    294323        position: absolute;
    295         margin: -1px;
     324        margin: 0px;
    296325        width: 86px;
    297326        height: 41px;
    298         background: #b2c2b9;
     327        background-image: url(../../img/INV/Slot_Bag_Out.gif);
     328}
     329tr td.bank div.no_slot{
     330        background-image: url(../../img/INV/Slot_Bank_Out.gif);
    299331}
    300332/*****TABLES END******/
     
    337369        position:relative;
    338370    padding:7px 0px;
    339     background:#d4ddd8;
     371    background-color:#d4ddd8;
    340372    margin-bottom:15px;
    341373        text-align: left;
     
    343375div.bubble div.top {
    344376        text-align: center;
    345         background:#b2c2b9;
     377        background-color:#b2c2b9;
    346378        padding:7px 15px;
    347379    margin:-7px -0px 12px -0px;
     
    415447        padding: 6px;
    416448}
    417 .no_border {
    418         border: 0px;
    419         padding: 0px;
    420 }
     449
    421450.icon_border {
    422451        border: 0px;
    423452        padding: 0px;
    424         width: 32px; height: 32px;
     453        width: 32px;
     454        height: 32px;
    425455}
    426456
     
    480510        width:60%;
    481511        text-align:right;
     512        margin-top: 3px;
     513        color: #fff !important;
    482514}
    483515tr td.skill_bar{
    484         background-image: url(../../img/skill_bar.png);
     516        background-image: url(../../img/bar_skill.png);
    485517}
    486518
     
    566598        border:1px solid #F0D070;
    567599        padding:10px;
    568         width:220px;
     600        width:auto;
    569601        background-color:#000;
    570602        text-align: left;
     
    573605        opacity:0.80;
    574606}
    575 
    576607.info_tooltip  td{
    577608        float: none;
     
    580611        border:0px solid #F0D070;
    581612        padding:10px;
    582         width:220px;
     613        width:240px;
    583614        background-color:#000;
    584         text-align: left;
     615        text-align:left;
    585616        filter:alpha(opacity=85);
    586617        -moz-opacity:.85;
    587618        opacity:0.85;
    588619}
     620.answerbox {
     621        font-size: 11px;
     622        color: #d4d4d4;
     623        border:1px solid #F0D070;
     624        padding:10px;
     625        width:auto;
     626        background-color:#000;
     627        text-align:center;
     628        filter:alpha(opacity=85);
     629        -moz-opacity:.85;
     630        opacity:0.85;
     631}
     632.answerbox th {
     633        font:16pt Trebuchet MS,sans-serif;
     634    font-weight:bold;
     635        color:#f6b620;
     636        line-height:1.2em;
     637}
     638.answerbox td a {
     639        float:none;
     640        display: block;
     641}
  • minimanager/templates/Sulfur/Sulfur_1024.css

    r5 r19  
    77 * License: GNU General Public License (GPL)
    88 */
    9 
    10 html,body {
    11         background:#2a2a2a;
     9html{
     10        overflow-x:auto;        /* fixes MSIE scrollbar bug DO NOT REMOVE,has no effect in Mozilla,or Opera */
     11                                                /* http://www.blooberry.com/indexdot/css/properties/position/overflowx.htm */
     12}
     13html,body{
     14        background-color:#2a2a2a;
    1215        height:100%;
    13         padding:0;
     16        padding:0px; /* required for Opera to have 0 margin */
    1417        margin:0;
    1518        font:11pt Verdana,sans-serif;
    16         cursor: default;
     19        cursor:default;
    1720}
    1821
     
    4952        left:25px;
    5053        top:37px;
    51         z-index:40;
     54        z-index:100;
    5255        width: 36em; /*total len*/
    5356        text-align: left;
     
    133136}
    134137h1{
    135     margin:0;
     138    margin:0px;
    136139    font:16pt Trebuchet MS,sans-serif;
    137140    font-weight:bold;
     
    143146        border: 1px solid #565656;
    144147        background:#2a2a2a;
    145         font:10pt Verdana,sans-serif;
     148        font: 10pt Verdana,sans-serif;
    146149        font-weight: bold;
    147150        line-height:100%;
    148151}
    149152input {
    150     background:#a2a2a;
     153    background:#2a2a2a;
    151154    color:#d4d4d4;
    152155    padding:2px 1px;
     
    154157        margin-left: 2px;
    155158}
    156 select,textarea {
     159input[type="text"],input[type="password"]{
     160        background:#a2a2a;
     161}
     162input[type="text"]:hover, input[type="password"]:hover {
     163    background:#2c2c2c;
     164        border-color:#bbb;
     165        cursor: default;
     166}
     167input[type="text"]:focus,input[type="password"]:focus {
     168        background:#2a2a2a;
     169        border-color:#f6b620;
     170}
     171input[type="radio"],input[type="checkbox"]{
     172        background:none;
     173        border:0px;
     174}
     175select,textarea{
    157176        color:#d4d4d4;
    158177        border:1px solid #565656;
    159178        background-color: #2a2a2a;
    160179        }
    161 
     180img {
     181        border: 0px;
     182        padding: 0px;
     183}
    162184a.button {
    163185        background:#2a2a2a;
     
    203225
    204226/*****TABLES******/
    205 a.head_link:link, a.head_link:visited{ color: #f6b620; text-decoration: none }
    206 a.head_link:hover, a.head_link:focus{ color: #ffee40; text-decoration: none }
    207 
    208227table.flat {
    209228        border-width: 5px;
     
    244263        padding: 5px;
    245264}
    246 table.lined, table.lined tr, tr.head, table.lined tr.hidden{
     265table.lined, table.lined tr, table.lined tr.hidden{
    247266        border-left: 1px solid  #383838;
    248267        border-right: 1px solid  #383838;
    249268}
    250 table.lined td.head, table.lined tr th{
     269table.lined tr th{
    251270        background-color: #484848;
    252271        font-weight: bold;
    253272        font-size: 11px;
    254273        color:#f6b620;
     274        padding: 5px;
    255275}
    256276table.lined td.hidden {
     
    280300        height: 24px;
    281301        border: 1px solid #585858;
    282 }
    283 
    284 tr td.bag div {
     302        margin-left: 5px;
     303}
     304
     305tr td.bag div,
     306tr td.bank div {
    285307        position: relative;
    286308        border: 0px;
    287309        margin: 2px;
    288         background: url(../../img/INV/Slot_Bag.gif) repeat;
    289 }
    290 tr td.bag div div{ position: absolute; }
    291 tr td.bag div div img{
     310        background-image: url(../../img/INV/Slot_Bag.gif);
     311        background-repeat: repeat;
     312        background-color: #242424;
     313}
     314tr td.bank div {
     315        background-image: url(../../img/INV/Slot_Bank.gif);
     316        background-color: #858585;
     317}
     318tr td.bag div div,
     319tr td.bank div div{
     320        position: absolute;
     321        background: none;
     322}
     323tr td.bag div div img,
     324tr td.bank div div img{
    292325        border: 0px;
    293326        padding: 1px;
     
    295328        height: 35px;
    296329}
    297 tr td.bag div.no_slot{
     330tr td.bag div.no_slot,
     331tr td.bank div.no_slot{
    298332        position: absolute;
    299         margin: -1px;
     333        margin: 0px;
    300334        width: 86px;
    301335        height: 41px;
    302         background: #565656;
     336        background-image: url(../../img/INV/Slot_Bag_Out.gif);
     337}
     338tr td.bank div.no_slot{
     339        background-image: url(../../img/INV/Slot_Bank_Out.gif);
    303340}
    304341/*****TABLES END******/
     
    341378        position:relative;
    342379    padding:7px 0px;
    343     background:#383838;
     380    background-color:#383838;
    344381    margin-bottom:15px;
    345382        text-align: left;
     
    348385div.bubble div.top {
    349386        text-align: center;
    350         background:#565656;
     387        background-color:#565656;
    351388        padding:7px 15px;
    352389    margin:-7px -0px 12px -0px;
     
    413450        padding: 6px;
    414451}
    415 .no_border {
    416         border: 0px;
    417         padding: 0px;
    418 }
     452
    419453.icon_border {
    420454        border: 0px;
     
    472506tr td.bar span{
    473507        float: left;
    474         width:60%;
     508        width:55%;
    475509        text-align:right;
     510        margin-top: 3px;
     511        color: #fff !important;
    476512}
    477513tr td.skill_bar{
    478         background-image: url(../../img/skill_bar.png);
     514        background-image: url(../../img/bar_skill.png);
    479515}
    480516
     
    558594        border:1px solid #F0D070;
    559595        padding:10px;
    560         width:220px;
     596        width:auto;
    561597        background-color:#000;
    562598        text-align:left;
     
    571607        border:0px solid #F0D070;
    572608        padding:10px;
    573         width:220px;
     609        width:240px;
    574610        background-color:#000;
    575611        text-align:left;
     
    578614        opacity:0.85;
    579615}
     616
     617.answerbox {
     618        font-size: 11px;
     619        color: #d4d4d4;
     620        border:1px solid #F0D070;
     621        padding:10px;
     622        width:auto;
     623        background-color:#000;
     624        text-align:center;
     625        filter:alpha(opacity=85);
     626        -moz-opacity:.85;
     627        opacity:0.85;
     628}
     629.answerbox th {
     630        font:16pt Trebuchet MS,sans-serif;
     631    font-weight:bold;
     632        color:#f6b620;
     633        line-height:1.2em;
     634}
     635.answerbox td a {
     636        float:none;
     637        display: block;
     638}
  • minimanager/templates/Sulfur/Sulfur_1280.css

    r5 r19  
    77 * License: GNU General Public License (GPL)
    88 */
    9 
    10 html,body {
    11         background:#2a2a2a;
     9html{
     10        overflow-x:auto;        /* fixes MSIE scrollbar bug DO NOT REMOVE,has no effect in Mozilla,or Opera */
     11                                                /* http://www.blooberry.com/indexdot/css/properties/position/overflowx.htm */
     12}
     13html,body{
     14        background-color:#2a2a2a;
    1215        height:100%;
    13         padding:0;
     16        padding:0px; /* required for Opera to have 0 margin */
    1417        margin:0;
    1518        font:11pt Verdana,sans-serif;
    16         cursor: default;
     19        cursor:default;
    1720}
    1821
     
    4952        left:25px;
    5053        top:37px;
    51         z-index:40;
     54        z-index:100;
    5255        width: 36em; /*total len*/
    5356        text-align: left;
     
    6770        padding: 5px 15px 5px 15px;
    6871        border-right: 1px solid #565656;
    69         font-size: .85em;
     72        font-size: .90em;
    7073        color: #f6b620; /*main menu text color*/
    7174}
     
    133136}
    134137h1{
    135     margin:0;
     138    margin:0px;
    136139    font:16pt Trebuchet MS,sans-serif;
    137140    font-weight:bold;
     
    143146        border: 1px solid #565656;
    144147        background:#2a2a2a;
    145         font:10pt Verdana,sans-serif;
     148        font: 11pt Verdana,sans-serif;
    146149        font-weight: bold;
    147150        line-height:100%;
    148151}
    149152input {
    150     background:#a2a2a;
     153    background:#2a2a2a;
    151154    color:#d4d4d4;
    152155    padding:2px 1px;
     
    154157        margin-left: 2px;
    155158}
    156 select,textarea {
     159input[type="text"],input[type="password"]{
     160        background-color:#a2a2a;
     161}
     162input[type="text"]:hover, input[type="password"]:hover {
     163    background-color:#2c2c2c;
     164        border-color:#bbb;
     165        cursor: default;
     166}
     167input[type="text"]:focus,input[type="password"]:focus {
     168        background:#2a2a2a;
     169        border-color:#f6b620;
     170}
     171input[type="radio"],input[type="checkbox"]{
     172        background:none;
     173        border:0px;
     174}
     175select,textarea{
    157176        color:#d4d4d4;
    158177        border:1px solid #565656;
    159178        background-color: #2a2a2a;
    160179        }
    161 
     180img {
     181        border: 0px;
     182        padding: 0px;
     183}
    162184a.button {
    163185        background:#2a2a2a;
     
    203225
    204226/*****TABLES******/
    205 a.head_link:link, a.head_link:visited{ color: #f6b620; text-decoration: none }
    206 a.head_link:hover, a.head_link:focus{ color: #ffee40; text-decoration: none }
    207 
    208227table.flat {
    209228        border-width: 5px;
     
    239258        text-align: center;
    240259}
    241 table.lined, table.lined td, table.lined td.head, table.lined td.hidden{
     260table.lined, table.lined td, table.lined td.hidden{
    242261        border-bottom: 1px solid  #383838;
    243262        border-top: 1px solid  #383838;
    244263        padding: 5px;
    245264}
    246 table.lined, table.lined tr, tr.head, table.lined tr.hidden{
     265table.lined, table.lined tr, table.lined tr.hidden{
    247266        border-left: 1px solid  #383838;
    248267        border-right: 1px solid  #383838;
    249268}
    250 table.lined td.head, table.lined tr th{
     269table.lined tr th{
    251270        background-color: #484848;
    252271        font-weight: bold;
    253         font-size: 11px;
     272        font-size: 12px;
    254273        color:#f6b620;
     274        padding: 5px;
    255275}
    256276table.lined td.hidden {
     
    280300        height: 24px;
    281301        border: 1px solid #585858;
    282 }
    283 
    284 tr td.bag div {
     302        margin-left: 5px;
     303}
     304
     305tr td.bag div,
     306tr td.bank div {
    285307        position: relative;
    286308        border: 0px;
    287309        margin: 2px;
    288         background: url(../../img/INV/Slot_Bag.gif) repeat;
    289 }
    290 tr td.bag div div{ position: absolute; }
    291 tr td.bag div div img{
     310        background-image: url(../../img/INV/Slot_Bag.gif);
     311        background-repeat: repeat;
     312        background-color: #242424;
     313}
     314tr td.bank div {
     315        background-image: url(../../img/INV/Slot_Bank.gif);
     316        background-color: #858585;
     317}
     318tr td.bag div div,
     319tr td.bank div div{
     320        position: absolute;
     321        background: none;
     322}
     323tr td.bag div div img,
     324tr td.bank div div img{
    292325        border: 0px;
    293326        padding: 1px;
     
    295328        height: 35px;
    296329}
    297 tr td.bag div.no_slot{
     330tr td.bag div.no_slot,
     331tr td.bank div.no_slot{
    298332        position: absolute;
    299         margin: -1px;
     333        margin: 0px;
    300334        width: 86px;
    301335        height: 41px;
    302         background: #565656;
     336        background-image: url(../../img/INV/Slot_Bag_Out.gif);
     337}
     338tr td.bank div.no_slot{
     339        background-image: url(../../img/INV/Slot_Bank_Out.gif);
    303340}
    304341/*****TABLES END******/
     
    341378        position:relative;
    342379    padding:7px 0px;
    343     background:#383838;
     380    background-color:#383838;
    344381    margin-bottom:15px;
    345382        text-align: left;
     
    348385div.bubble div.top {
    349386        text-align: center;
    350         background:#565656;
     387        background-color:#565656;
    351388        padding:7px 15px;
    352389    margin:-7px -0px 12px -0px;
     
    413450        padding: 6px;
    414451}
    415 .no_border {
    416         border: 0px;
    417         padding: 0px;
    418 }
    419452.icon_border {
    420453        border: 0px;
     
    472505tr td.bar span{
    473506        float: left;
    474         width:60%;
     507        width:55%;
    475508        text-align:right;
     509        margin-top: 3px;
     510        color: #fff !important;
     511}
     512tr td.bar span.rank{
     513        position: absolute;
     514        text-align: left;
     515        width: auto;
    476516}
    477517tr td.skill_bar{
    478         background-image: url(../../img/skill_bar.png);
     518        background-image: url(../../img/bar_skill.png);
    479519}
    480520
     
    558598        border:1px solid #F0D070;
    559599        padding:10px;
    560         width:220px;
     600        width:auto;
    561601        background-color:#000;
    562602        text-align:left;
     
    571611        border:0px solid #F0D070;
    572612        padding:10px;
    573         width:220px;
     613        width:240px;
    574614        background-color:#000;
    575615        text-align:left;
     
    578618        opacity:0.85;
    579619}
     620.answerbox {
     621        float: none;
     622        font-size: 11px;
     623        color: #d4d4d4;
     624        border:1px solid #F0D070;
     625        padding:10px;
     626        width:auto;
     627        background-color:#000;
     628        text-align:center;
     629        filter:alpha(opacity=85);
     630        -moz-opacity:.85;
     631        opacity:0.85;
     632}
     633.answerbox th {
     634        font:16pt Trebuchet MS,sans-serif;
     635    font-weight:bold;
     636        color:#f6b620;
     637        line-height:1.2em;
     638}
     639.answerbox td a {
     640        float:none;
     641        display: block;
     642}
  • minimanager/ticket.php

    r5 r19  
    3131function browse_tickets() {
    3232 global  $lang_global, $lang_ticket, $output, $mangos_db, $realm_id, $itemperpage, $ticket_type;
    33 $itemperpage = 2;
    34  $mysql = new MySQL;
    35  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    36  
    37  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    38 
    39  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "ticket_id";
    40  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     33
     34 $sql = new SQL;
     35 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     36 
     37 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     38
     39 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "ticket_id";
     40 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    4141 $order_dir = ($dir) ? "ASC" : "DESC";
    4242 $dir = ($dir) ? 0 : 1;
    4343 
    4444 //get total number of items
    45  $query_1 = $mysql->query("SELECT count(*) FROM character_ticket");
    46  $all_record = $mysql->result($query_1,0);
    47 
    48  $query = $mysql->query("SELECT character_ticket.ticket_id, character_ticket.guid,SUBSTRING_INDEX(character_ticket.ticket_text,' ',6),
     45 $query_1 = $sql->query("SELECT count(*) FROM character_ticket");
     46 $all_record = $sql->result($query_1,0);
     47
     48 $query = $sql->query("SELECT character_ticket.ticket_id, character_ticket.guid,SUBSTRING_INDEX(character_ticket.ticket_text,' ',6),
    4949                                                character_ticket.ticket_category,`character`.name
    5050                                                FROM character_ticket,`character`
     
    5252                                                WHERE character_ticket.guid = `character`.`guid`
    5353                                                ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    54  $this_page = $mysql->num_rows($query);
     54 $this_page = $sql->num_rows($query);
    5555
    5656 $output .="<script type=\"text/javascript\" src=\"js/check.js\"></script>
     
    6565 <table class=\"lined\">
    6666   <tr>
    67         <td width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></td>
    68         <td width=\"5%\" class=\"head\">{$lang_global['edit']}</td>
    69         <td width=\"8%\" class=\"head\"><a href=\"ticket.php?order_by=ticket_id&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_ticket['id']}</a></td>
    70         <td width=\"15%\" class=\"head\"><a href=\"ticket.php?order_by=guid&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_ticket['sender']}</a></td>
    71         <td width=\"55%\" class=\"head\"><a href=\"ticket.php?order_by=ticket_text&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_ticket['ticket_text']}</a></td>
    72     <td width=\"13%\" class=\"head\"><a href=\"ticket.php?order_by=ticket_category&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_ticket['category']}</a></td>
     67        <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></th>
     68        <th width=\"5%\">{$lang_global['edit']}</th>
     69        <th width=\"8%\"><a href=\"ticket.php?order_by=ticket_id&amp;start=$start&amp;dir=$dir\">".($order_by=='ticket_id' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_ticket['id']}</a></th>
     70        <th width=\"15%\"><a href=\"ticket.php?order_by=guid&amp;start=$start&amp;dir=$dir\">".($order_by=='guid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_ticket['sender']}</a></th>
     71        <th width=\"55%\">{$lang_ticket['ticket_text']}</th>
     72    <th width=\"13%\"><a href=\"ticket.php?order_by=ticket_category&amp;start=$start&amp;dir=$dir\">".($order_by=='ticket_category' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_ticket['category']}</a></tthd>
    7373  </tr>";
    7474
    75  while ($ticket = $mysql->fetch_row($query)){
     75 while ($ticket = $sql->fetch_row($query)){
    7676        $output .= "<tr>
    7777                    <td><input type=\"checkbox\" name=\"check[]\" value=\"$ticket[0]\" onclick=\"CheckCheckAll(document.form);\" /></td>
     
    9494 </form><br /></center>";
    9595 
    96 $mysql->close();
     96$sql->close();
    9797}
    9898
     
    104104global $lang_global, $mangos_db, $realm_id;
    105105
    106  $mysql = new MySQL;
    107  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    108 
    109  if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     106 $sql = new SQL;
     107 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     108
     109 if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    110110        else redirect("ticket.php?error=1");
    111111
     
    114114 for ($i=0; $i<count($check); $i++) {
    115115    if ($check[$i] != "" ) {
    116                 $query = $mysql->query("DELETE FROM character_ticket WHERE ticket_id = '$check[$i]'");
     116                $query = $sql->query("DELETE FROM character_ticket WHERE ticket_id = '$check[$i]'");
    117117                $deleted_tickets++;
    118118                }
    119119        }
    120120
    121  $mysql->close();
     121 $sql->close();
    122122
    123123 if ($deleted_tickets == 0) redirect("ticket.php?error=3");
     
    132132 global  $lang_global, $lang_ticket, $output, $mangos_db, $realm_id, $ticket_type;
    133133
    134  $mysql = new MySQL;
    135  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    136  
    137  if(isset($_GET['id'])) $id = $mysql->quote_smart($_GET['id']);
     134 $sql = new SQL;
     135 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     136 
     137 if(isset($_GET['id'])) $id = $sql->quote_smart($_GET['id']);
    138138        else redirect("ticket.php?error=1");
    139139
    140  $query = $mysql->query("SELECT character_ticket.guid, character_ticket.ticket_text,
     140 $query = $sql->query("SELECT character_ticket.guid, character_ticket.ticket_text,
    141141                                                character_ticket.ticket_category,`character`.name
    142142                                                FROM character_ticket,`character`
     
    144144                                                WHERE character_ticket.guid = `character`.`guid` AND character_ticket.ticket_id = '$id'");
    145145
    146  if ($ticket = $mysql->fetch_row($query)) {
     146 if ($ticket = $sql->fetch_row($query)) {
    147147        $output .= "<center>
    148148        <fieldset style=\"width: 550px;\">
     
    189189  } else error($lang_global['err_no_records_found']);
    190190 
    191  $mysql->close();
     191 $sql->close();
    192192}
    193193
     
    203203 }
    204204
    205  $mysql = new MySQL;
    206  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    207  
    208  $new_category = $mysql->quote_smart($_POST['new_category']);
    209  $new_text = $mysql->quote_smart($_POST['new_text']);
    210  $id = $mysql->quote_smart($_POST['id']);
    211 
    212  $query = $mysql->query("UPDATE character_ticket SET ticket_text='$new_text', ticket_category ='$new_category' WHERE ticket_id = '$id'");
    213 
    214  if (mysql_affected_rows()) {
    215         $mysql->close();
     205 $sql = new SQL;
     206 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     207 
     208 $new_category = $sql->quote_smart($_POST['new_category']);
     209 $new_text = $sql->quote_smart($_POST['new_text']);
     210 $id = $sql->quote_smart($_POST['id']);
     211
     212 $query = $sql->query("UPDATE character_ticket SET ticket_text='$new_text', ticket_category ='$new_category' WHERE ticket_id = '$id'");
     213
     214 if ($sql->affected_rows()) {
     215        $sql->close();
    216216        redirect("ticket.php?error=5");
    217217    } else {
    218                 $mysql->close();
     218                $sql->close();
    219219                redirect("ticket.php?error=6");
    220220        }
  • minimanager/user.php

    r5 r19  
    1919 global $lang_global, $lang_user, $output, $realm_db, $itemperpage, $user_lvl, $user_name, $gm_level_arr;
    2020
    21  $mysql = new MySQL;
    22  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    23  
    24  $start = (isset($_GET['start'])) ? $mysql->quote_smart($_GET['start']) : 0;
    25  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "id";
     21 $sql = new SQL;
     22 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     23 
     24 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
     25 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "id";
    2626       
    27  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     27 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    2828 $order_dir = ($dir) ? "ASC" : "DESC";
    2929 $dir = ($dir) ? 0 : 1;
    3030       
    3131//get total number of items
    32  $query_1 = $mysql->query("SELECT count(*) FROM account");
    33  $all_record = $mysql->result($query_1,0);
    34 
    35  $query = $mysql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
     32 $query_1 = $sql->query("SELECT count(*) FROM account");
     33 $all_record = $sql->result($query_1,0);
     34
     35 $query = $sql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
    3636                FROM account ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
    37  $this_page = $mysql->num_rows($query);
     37 $this_page = $sql->num_rows($query);
    3838
    3939//==========================top tage navigaion starts here========================
     
    5656           <input type=\"text\" size=\"42\" maxlength=\"50\" name=\"search_value\" />
    5757           <select name=\"search_by\">
     58            <option value=\"username\">{$lang_user['by_name']}</option>
    5859                <option value=\"id\">{$lang_user['by_id']}</option>
    59                 <option value=\"username\">{$lang_user['by_name']}</option>
    6060                <option value=\"gmlevel\">{$lang_user['by_gm_level']}</option>
    6161                <option value=\"greater_gmlevel\">{$lang_user['greater_gm_level']}</option>
     
    8282 <table class=\"lined\">
    8383   <tr>
    84         <td width=\"1%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    85         <td width=\"5%\" class=\"head\"><a href=\"user.php?order_by=id&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['id']}</a></td>
    86         <td width=\"23%\" class=\"head\"><a href=\"user.php?order_by=username&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['username']}</a></td>
    87         <td width=\"5%\" class=\"head\"><a href=\"user.php?order_by=gmlevel&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['gm_level']}</a></td>
    88     <td width=\"17%\" class=\"head\"><a href=\"user.php?order_by=email&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['email']}</a></td>
    89         <td width=\"14%\" class=\"head\"><a href=\"user.php?order_by=joindate&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['join_date']}</a></td>
    90         <td width=\"10%\" class=\"head\"><a href=\"user.php?order_by=last_ip&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['ip']}</a></td>
    91         <td width=\"5%\" class=\"head\"><a href=\"user.php?order_by=failed_logins&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['failed_logins']}</a></td>
    92         <td width=\"3%\" class=\"head\"><a href=\"user.php?order_by=locked&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['locked']}</a></td>
    93         <td width=\"14%\" class=\"head\"><a href=\"user.php?order_by=last_login&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['last_login']}</a></td>
    94         <td width=\"3%\" class=\"head\"><a href=\"user.php?order_by=online&amp;start=$start&amp;dir=$dir\" class=\"head_link\">{$lang_user['online']}</a></td>
     84        <th width=\"1%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></th>
     85        <th width=\"5%\"><a href=\"user.php?order_by=id&amp;start=$start&amp;dir=$dir\">".($order_by=='id' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['id']}</a></th>
     86        <th width=\"23%\"><a href=\"user.php?order_by=username&amp;start=$start&amp;dir=$dir\">".($order_by=='username' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['username']}</a></th>
     87        <th width=\"5%\"><a href=\"user.php?order_by=gmlevel&amp;start=$start&amp;dir=$dir\">".($order_by=='gmlevel' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['gm_level']}</a></th>
     88    <th width=\"17%\"><a href=\"user.php?order_by=email&amp;start=$start&amp;dir=$dir\">".($order_by=='email' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['email']}</a></th>
     89        <th width=\"14%\"><a href=\"user.php?order_by=joindate&amp;start=$start&amp;dir=$dir\">".($order_by=='joindate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['join_date']}</a></th>
     90        <th width=\"10%\"><a href=\"user.php?order_by=last_ip&amp;start=$start&amp;dir=$dir\">".($order_by=='last_ip' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['ip']}</a></th>
     91        <th width=\"5%\"><a href=\"user.php?order_by=failed_logins&amp;start=$start&amp;dir=$dir\">".($order_by=='failed_logins' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['failed_logins']}</a></th>
     92        <th width=\"3%\"><a href=\"user.php?order_by=locked&amp;start=$start&amp;dir=$dir\">".($order_by=='locked' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['locked']}</a></th>
     93        <th width=\"14%\"><a href=\"user.php?order_by=last_login&amp;start=$start&amp;dir=$dir\">".($order_by=='last_login' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['last_login']}</a></th>
     94        <th width=\"3%\"><a href=\"user.php?order_by=online&amp;start=$start&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['online']}</a></th>
    9595   </tr>";
    9696
    97  $looping = ($this_page < $itemperpage) ? $this_page : $itemperpage;
    98 
    99  for ($i=1; $i<=$looping; $i++) {
    100    $data = $mysql->fetch_row($query);
     97 while ($data = $sql->fetch_row($query)){
     98
    10199        if (($user_lvl >= $data[2])||($user_name == $data[1])){
    102100                $output .= "<tr>";
     
    113111                        <td>".(($data[7]) ? $lang_global['yes_low'] : "-")."</td>
    114112                        <td class=\"small\">$data[8]</td>
    115                         <td>".(($data[9]) ? "ON" : "-")."</td>
     113                        <td>".(($data[9]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    116114            </tr>";
    117115        } else {
     
    130128 </table></form><br /></center>";
    131129
    132  $mysql->close();
     130 $sql->close();
    133131}
    134132
     
    142140 if(!isset($_GET['search_value']) || !isset($_GET['search_by'])) redirect("user.php?error=2");
    143141
    144  $mysql = new MySQL;
    145  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    146  
    147  $search_value = $mysql->quote_smart($_GET['search_value']);
    148  $search_by = $mysql->quote_smart($_GET['search_by']);
    149 
    150  $order_by = (isset($_GET['order_by'])) ? $mysql->quote_smart($_GET['order_by']) : "id";
    151  $dir = (isset($_GET['dir'])) ? $mysql->quote_smart($_GET['dir']) : 1;
     142 $sql = new SQL;
     143 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     144 
     145 $search_value = $sql->quote_smart($_GET['search_value']);
     146 $search_by = $sql->quote_smart($_GET['search_by']);
     147
     148 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "id";
     149 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    152150 $order_dir = ($dir) ? "ASC" : "DESC";
    153151 $dir = ($dir) ? 0 : 1;
     
    156154 
    157155 case "greater_gmlevel":
    158          $sql = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
     156         $sql_query = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
    159157                 FROM account WHERE gmlevel > $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    160158 break;
    161159 
    162160 case "banned":
    163         $sql = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
     161        $sql_query = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
    164162                 FROM account WHERE id = 0 ";
    165         $que = $mysql->query("SELECT id FROM account_banned");
    166         while ($banned = mysql_fetch_row($que)) $sql .= "OR id =$banned[0] ";
    167          $sql .= " ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
     163        $que = $sql->query("SELECT id FROM account_banned");
     164        while ($banned = $sql->fetch_row($que)) $sql_query .= "OR id =$banned[0] ";
     165         $sql_query .= " ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    168166 break;
    169167 
    170168 case "failed_logins":
    171          $sql = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
     169         $sql_query = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
    172170                 FROM account WHERE failed_logins > $search_value ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    173171 break;
    174172 
    175173 default:
    176     $sql = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
     174    $sql_query = "SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online
    177175                 FROM account WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit";
    178176 }
    179177
    180  $query = $mysql->query($sql);
    181  $total_found = $mysql->num_rows($query);
     178 $query = $sql->query($sql_query);
     179 $total_found = $sql->num_rows($query);
    182180
    183181//==========================top tage navigaion starts here========================
     
    192190           <input type=\"text\" size=\"32\" maxlength=\"50\" name=\"search_value\" />
    193191           <select name=\"search_by\">
     192            <option value=\"username\">{$lang_user['by_name']}</option>
    194193            <option value=\"id\">{$lang_user['by_id']}</option>
    195                 <option value=\"username\">{$lang_user['by_name']}</option>
    196194                <option value=\"gmlevel\">{$lang_user['by_gm_level']}</option>
    197195                <option value=\"greater_gmlevel\">{$lang_user['greater_gm_level']}</option>
     
    216214 <table class=\"lined\">
    217215   <tr>
    218         <td width=\"1%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></td>
    219         <td width=\"5%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=id&amp;dir=$dir\" class=\"head_link\">{$lang_user['id']}</a></td>
    220         <td width=\"23%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=username&amp;dir=$dir\" class=\"head_link\">{$lang_user['username']}</a></td>
    221         <td width=\"5%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=gmlevel&amp;dir=$dir\" class=\"head_link\">{$lang_user['gm_level']}</a></td>
    222     <td width=\"17%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=email&amp;dir=$dir\" class=\"head_link\">{$lang_user['email']}</a></td>
    223         <td width=\"14%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=joindate&amp;dir=$dir\" class=\"head_link\">{$lang_user['join_date']}</a></td>
    224         <td width=\"10%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=last_ip&amp;dir=$dir\" class=\"head_link\">{$lang_user['ip']}</a></td>
    225         <td width=\"5%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=failed_logins&amp;dir=$dir\" class=\"head_link\">{$lang_user['failed_logins']}</a></td>
    226         <td width=\"3%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=locked&amp;dir=$dir\" class=\"head_link\">{$lang_user['locked']}</a></td>
    227         <td width=\"14%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=last_login&amp;dir=$dir\" class=\"head_link\">{$lang_user['last_login']}</a></td>
    228         <td width=\"3%\" class=\"head\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\" class=\"head_link\">{$lang_user['online']}</a></td>
     216        <th width=\"1%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form1);\" /></th>
     217        <th width=\"5%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=id&amp;dir=$dir\">".($order_by=='id' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['id']}</a></th>
     218        <th width=\"23%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=username&amp;dir=$dir\">".($order_by=='username' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['username']}</a></th>
     219        <th width=\"5%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=gmlevel&amp;dir=$dir\">".($order_by=='gmlevel' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['gm_level']}</a></th>
     220    <th width=\"17%\><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=email&amp;dir=$dir\">".($order_by=='email' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['email']}</a></th>
     221        <th width=\"14%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=joindate&amp;dir=$dir\">".($order_by=='joindate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['join_date']}</a></th>
     222        <th width=\"10%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=last_ip&amp;dir=$dir\">".($order_by=='last_ip' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['ip']}</a></th>
     223        <th width=\"5%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=failed_logins&amp;dir=$dir\">".($order_by=='failed_logins' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['failed_logins']}</a></th>
     224        <th width=\"3%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=locked&amp;dir=$dir\">".($order_by=='locked' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['locked']}</a></th>
     225        <th width=\"14%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=last_login&amp;dir=$dir\">".($order_by=='last_login' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['last_login']}</a></th>
     226        <th width=\"3%\"><a href=\"user.php?action=search&amp;error=3&amp;search_value=$search_value&amp;search_by=$search_by&amp;order_by=online&amp;dir=$dir\">".($order_by=='online' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_user['online']}</a></th>
    229227   </tr>";
    230228
    231  for ($i=1; $i<=$total_found; $i++){
    232         $data = $mysql->fetch_row($query);
    233  
    234         //to disalow lower lvl gm to  view accounts of other gms same or bigger lvl
     229 while ($data = $sql->fetch_row($query)){
     230
    235231        if (($user_lvl >= $data[2])||($user_name == $data[1])){
    236232                $output .= "<tr>";
     
    247243                        <td>".(($data[7]) ? $lang_global['yes_low'] : "-")."</td>
    248244                        <td class=\"small\">$data[8]</td>
    249                         <td>".(($data[9]) ? "ON" : "-")."</td>
     245                        <td>".(($data[9]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td>
    250246            </tr>";
    251247        }else{
     
    265261 </form><br /></center>";
    266262 
    267  $mysql->close();
     263 $sql->close();
    268264}
    269265
     
    273269//#######################################################################################################
    274270function del_user() {
    275 global $lang_global, $lang_user, $output;
     271global $lang_global, $lang_user, $output, $realm_db;
    276272 if(isset($_GET['check'])) $check = $_GET['check'];
    277273        else redirect("user.php?error=1");
     
    287283        }
    288284
    289  $output .= "<center><h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />";
    290  $output .= "<font class=\"bold\">{$lang_user['acc_ids']}: ";
    291 
     285 $output .= "<center><img src=\"img/warn_red.gif\" width=\"48\" height=\"48\" alt=\"\" />
     286                        <h1><font class=\"error\">{$lang_global['are_you_sure']}</font></h1><br />
     287                        <font class=\"bold\">{$lang_user['acc_ids']}: ";
     288
     289 $sql = new SQL;
     290 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     291                       
    292292 for ($i=0; $i<count($check); $i++){
    293         $output .= "<a href=\"user.php?action=edit_user&amp;id=$check[$i]\" target=\"_blank\">$check[$i], </a>";
     293        $username = $sql->result($sql->query("SELECT username FROM `account` WHERE id = {$check[$i]}"),0);
     294        $output .= "<a href=\"user.php?action=edit_user&amp;id=$check[$i]\" target=\"_blank\">$username, </a>";
    294295        $pass_array .= "&amp;check%5B%5D=$check[$i]";
    295296        }
    296 
    297  $output .= "{$lang_global['will_be_erased']}</font><br /><br />";
    298  $output .= "<table class=\"hidden\">
     297 $sql->close();
     298
     299 $output .= "<br />{$lang_global['will_be_erased']}</font><br /><br />
     300                <table class=\"hidden\">
    299301          <tr><td>";
    300302                        makebutton($lang_global['yes'], "user.php?action=dodel_user$pass_array",120);
     
    302304 $output .= "</td></tr>
    303305        </table></center><br />";
     306
    304307}
    305308
     
    312315                $tab_del_user_mangos, $tab_del_user_realmd;
    313316
    314  $mysql = new MySQL;
    315  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    316  
    317  if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     317 $sql = new SQL;
     318 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     319 
     320 if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    318321        else redirect("user.php?error=1");
    319322
     
    331334  }
    332335 }
    333  $mysql->close();
     336 $sql->close();
    334337 $output .= "<center>";
    335338 if ($deleted_acc == 0) $output .= "<h1><font class=\"error\">{$lang_user['no_acc_deleted']}</font></h1>";
     
    353356 global $lang_global, $lang_user, $output, $realm_db, $mangos_db, $realm_id, $user_lvl,$backup_dir;
    354357
    355  $mysql = new MySQL;
    356  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    357  
    358  if(isset($_GET['check'])) $check = $mysql->quote_smart($_GET['check']);
     358 $sql = new SQL;
     359 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     360 
     361 if(isset($_GET['check'])) $check = $sql->quote_smart($_GET['check']);
    359362        else redirect("user.php?error=1");
    360363
     
    365368 for ($t=0; $t<count($check); $t++) {
    366369  if ($check[$t] != "" ) {
    367         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    368 
    369         $query = $mysql->query("SELECT id FROM account WHERE id = $check[$t]");
    370         $acc = $mysql->fetch_array($query);
     370        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     371
     372        $query = $sql->query("SELECT id FROM account WHERE id = $check[$t]");
     373        $acc = $sql->fetch_array($query);
    371374
    372375        $file_name_new = $acc[0]."_{$realm_db['name']}.sql";
     
    377380
    378381        foreach ($tab_backup_user_realmd as $value) {
    379                         $acc_query = $mysql->query("SELECT * FROM $value[0] WHERE $value[1] = $acc[0]");
    380                         $num_fields =$mysql->num_fields($acc_query);
    381                         $numrow = $mysql->num_rows($acc_query);
     382                        $acc_query = $sql->query("SELECT * FROM $value[0] WHERE $value[1] = $acc[0]");
     383                        $num_fields = $sql->num_fields($acc_query);
     384                        $numrow = $sql->num_rows($acc_query);
    382385       
    383386                        $result = "-- Dumping data for $value[0] ".date("m.d.y_H.i.s")."\n";
     
    389392                                               
    390393                                for($count = 0; $count < $num_fields; $count++) {
    391                                         $result .= "`".mysql_field_name($acc_query,$count)."`";
     394                                        $result .= "`".$sql->field_name($acc_query,$count)."`";
    392395                                        if ($count < ($num_fields-1)) $result .= ",";
    393396                                        }
     
    396399                                for ($i =0; $i<$numrow; $i++) {
    397400                                        $result .= "\t(";
    398                                         $row = $mysql->fetch_row($acc_query);
     401                                        $row = $sql->fetch_row($acc_query);
    399402                                        for($j=0; $j<$num_fields; $j++) {
    400403                                                $row[$j] = addslashes($row[$j]);
    401404                                                $row[$j] = ereg_replace("\n","\\n",$row[$j]);
    402405                                                if (isset($row[$j])) {
    403                                                         if (mysql_field_type($acc_query,$j) == "int") $result .= "$row[$j]";
     406                                                        if ($sql->field_type($acc_query,$j) == "int") $result .= "$row[$j]";
    404407                                                                else $result .= "'$row[$j]'" ;
    405408                                                }else $result .= "''";
     
    422425                fwrite($fp, "USE {$db['name']};\n\n")or die (error($lang_backup['file_write_err']));
    423426               
    424                 $mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    425                 $all_char_query = $mysql->query("SELECT guid,name FROM `character` WHERE account = $acc[0]");
     427                $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
     428                $all_char_query = $sql->query("SELECT guid,name FROM `character` WHERE account = $acc[0]");
    426429               
    427                 while ($char = $mysql->fetch_array($all_char_query)){
     430                while ($char = $sql->fetch_array($all_char_query)){
    428431                                fwrite($fp, "-- Dumping data for character $char[1]\n")or die (error($lang_backup['file_write_err']));
    429432                                foreach ($tab_backup_user_mangos as $value) {
    430                                         $char_query = $mysql->query("SELECT * FROM $value[0] WHERE $value[1] = $char[0]");
    431                                         $num_fields = $mysql->num_fields($char_query);
    432                                         $numrow = $mysql->num_rows($char_query);
     433                                        $char_query = $sql->query("SELECT * FROM $value[0] WHERE $value[1] = $char[0]");
     434                                        $num_fields = $sql->num_fields($char_query);
     435                                        $numrow = $sql->num_rows($char_query);
    433436       
    434437                                        $result = "LOCK TABLES $value[0] WRITE;\n";
     
    439442                                               
    440443                                                for($count = 0; $count < $num_fields; $count++) {
    441                                                         $result .= "`".mysql_field_name($char_query,$count)."`";
     444                                                        $result .= "`".$sql->field_name($char_query,$count)."`";
    442445                                                        if ($count < ($num_fields-1)) $result .= ",";
    443446                                                        }
     
    446449                                                for ($i =0; $i<$numrow; $i++) {
    447450                                                        $result .= "\t(";
    448                                                         $row = $mysql->fetch_row($char_query);
     451                                                        $row = $sql->fetch_row($char_query);
    449452                                                        for($j=0; $j<$num_fields; $j++) {
    450453                                                                $row[$j] = addslashes($row[$j]);
    451454                                                                $row[$j] = ereg_replace("\n","\\n",$row[$j]);
    452455                                                                if (isset($row[$j])) {
    453                                                                         if (mysql_field_type($char_query,$j) == "int") $result .= "$row[$j]";
     456                                                                        if ($sql->field_type($char_query,$j) == "int") $result .= "$row[$j]";
    454457                                                                                else $result .= "'$row[$j]'" ;
    455458                                                                }else $result .= "''";
     
    470473  }
    471474 }
    472  $mysql->close();
     475 $sql->close();
    473476 
    474477redirect("user.php?error=15");
     
    547550   redirect("user.php?action=add_new&error=4");
    548551
    549  $mysql = new MySQL;
    550  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    551 
    552  $new_user = $mysql->quote_smart(trim($_GET['new_user']));
    553  $pass = $mysql->quote_smart($_GET['pass']);
     552 $sql = new SQL;
     553 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     554
     555 $new_user = $sql->quote_smart(trim($_GET['new_user']));
     556 $pass = $sql->quote_smart($_GET['pass']);
    554557
    555558 //make sure username/pass at least 4 chars long and less than max
    556559 if ((strlen($new_user) < 4) || (strlen($new_user) > 15)){
    557                 $mysql->close();
     560                $sql->close();
    558561        redirect("user.php?action=add_new&error=8");
    559562        }
     
    562565 //make sure it doesnt contain non english chars.
    563566 if (!alphabetic($new_user)) {
    564                 $mysql->close();
     567                $sql->close();
    565568        redirect("user.php?action=add_new&error=9");
    566569        }
    567570
    568  $result = $mysql->query("SELECT username FROM account WHERE username = '$new_user'");
     571 $result = $sql->query("SELECT username FROM account WHERE username = '$new_user'");
    569572
    570573 //there is already someone with same username
    571  if ($mysql->num_rows($result)){
    572                 $mysql->close();
     574 if ($sql->num_rows($result)){
     575                $sql->close();
    573576        redirect("user.php?action=add_new&error=7");
    574577 } else {
    575578    $last_ip = "0.0.0.0";
    576         $new_mail = (isset($_GET['new_mail'])) ? $mysql->quote_smart(trim($_GET['new_mail'])) : NULL;
    577 
    578         $locked = (isset($_GET['new_locked'])) ? $mysql->quote_smart($_GET['new_locked']) : 0;
    579         $tbc = (isset($_GET['new_tbc'])) ? $mysql->quote_smart($_GET['new_tbc']) : 0;
    580 
    581         $result = $mysql->query("INSERT INTO account (username,I,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online,tbc)
     579        $new_mail = (isset($_GET['new_mail'])) ? $sql->quote_smart(trim($_GET['new_mail'])) : NULL;
     580
     581        $locked = (isset($_GET['new_locked'])) ? $sql->quote_smart($_GET['new_locked']) : 0;
     582        $tbc = (isset($_GET['new_tbc'])) ? $sql->quote_smart($_GET['new_tbc']) : 0;
     583
     584        $result = $sql->query("INSERT INTO account (username,I,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online,tbc)
    582585                                                                VALUES ('$new_user','$pass',0 ,'$new_mail',current_date() ,'$last_ip',0, $locked ,NULL, 0, $tbc)");
    583         $mysql->close();
     586        $sql->close();
    584587
    585588        if ($result) redirect("user.php?error=5");
     
    596599 if (empty($_GET['id'])) redirect("user.php?error=10");
    597600
    598  $mysql = new MySQL;
    599  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     601 $sql = new SQL;
     602 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    600603       
    601  $id = $mysql->quote_smart($_GET['id']);
    602 
    603  $result = $mysql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online,tbc FROM account WHERE id = '$id'");
    604  $data = $mysql->fetch_row($result);
    605  
    606  if ($mysql->num_rows($result)){
     604 $id = $sql->quote_smart($_GET['id']);
     605
     606 $result = $sql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online,tbc FROM account WHERE id = '$id'");
     607 $data = $sql->fetch_row($result);
     608 
     609 if ($sql->num_rows($result)){
    607610        //restricting accsess to lower gmlvl
    608611        if (($user_lvl <= $data[2])&&($user_name != $data[1])){
    609                 $mysql->close();
     612                $sql->close();
    610613                redirect("user.php?error=14");
    611614                }
     
    668671        <td>{$lang_user['banned']}</td>";
    669672
    670         $que = $mysql->query("SELECT bandate, unbandate, bannedby FROM account_banned WHERE id = $id");
    671         if ($mysql->num_rows($que)){
    672                 $banned = mysql_fetch_row($que);
     673        $que = $sql->query("SELECT bandate, unbandate, bannedby FROM account_banned WHERE id = $id");
     674        if ($sql->num_rows($que)){
     675                $banned = $sql->fetch_row($que);
    673676                $ban_info = " - from:".date('d-m-Y G:i', $banned[0])." till:".date('d-m-Y G:i', $banned[1])."<br />by $banned[2]";
    674677                $ban_checked = " checked=\"checked\"";
     
    710713      </tr>";
    711714
    712         $query = $mysql->query("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '$id'");
    713     $tot_chars = $mysql->result($query, 0);
    714 
    715         $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    716         $query = $mysql->query("SELECT count(*) FROM `character` WHERE account = $id");
    717         $chars_on_realm = $mysql->result($query, 0);
     715        $query = $sql->query("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '$id'");
     716    $tot_chars = $sql->result($query, 0);
     717
     718        $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     719        $query = $sql->query("SELECT count(*) FROM `character` WHERE account = $id");
     720        $chars_on_realm = $sql->result($query, 0);
    718721
    719722        $output .= "<tr>
     
    728731        //if there is any chars to display
    729732        if ($chars_on_realm){
    730                 $char_array = $mysql->query("SELECT guid,name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) FROM `character` WHERE account = $id");
    731                 while ($char = $mysql->fetch_array($char_array)){
     733                $char_array = $sql->query("SELECT guid,name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) FROM `character` WHERE account = $id");
     734                while ($char = $sql->fetch_array($char_array)){
    732735                        $output .= "<tr>
    733736                        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'---></td>
     
    747750
    748751  } else error($lang_global['err_no_user']);
    749  $mysql->close();
     752 $sql->close();
    750753}
    751754
     
    760763   redirect("user.php?action=edit_user&&id={$_POST['id']}&error=1");
    761764 
    762  $mysql = new MySQL;
    763  $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    764 
    765  $id = $mysql->quote_smart($_POST['id']);
    766  $username = $mysql->quote_smart($_POST['username']);
    767  $pass = $mysql->quote_smart($_POST['pass']);
     765 $sql = new SQL;
     766 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     767
     768 $id = $sql->quote_smart($_POST['id']);
     769 $username = $sql->quote_smart($_POST['username']);
     770 $pass = $sql->quote_smart($_POST['pass']);
    768771 $user_pass_change = ($pass != sha1(strtoupper($username).":******")) ? "username='$username',I='$pass'," : "";
    769772 
    770  $mail = (isset($_POST['mail']) && $_POST['mail'] != '') ? $mysql->quote_smart($_POST['mail']) : "";
    771  $failed = (isset($_POST['failed'])) ? $mysql->quote_smart($_POST['failed']) : 0;
    772  $gmlevel = (isset($_POST['gmlevel'])) ? $mysql->quote_smart($_POST['gmlevel']) : 0;
    773  $tbc = (isset($_POST['tbc'])) ? $mysql->quote_smart($_POST['tbc']) : 1;
    774  $banned = (isset($_POST['banned'])) ? $mysql->quote_smart($_POST['banned']) : 0;
    775  $locked = (isset($_POST['locked'])) ? $mysql->quote_smart($_POST['locked']) : 0;
     773 $mail = (isset($_POST['mail']) && $_POST['mail'] != '') ? $sql->quote_smart($_POST['mail']) : "";
     774 $failed = (isset($_POST['failed'])) ? $sql->quote_smart($_POST['failed']) : 0;
     775 $gmlevel = (isset($_POST['gmlevel'])) ? $sql->quote_smart($_POST['gmlevel']) : 0;
     776 $tbc = (isset($_POST['tbc'])) ? $sql->quote_smart($_POST['tbc']) : 1;
     777 $banned = (isset($_POST['banned'])) ? $sql->quote_smart($_POST['banned']) : 0;
     778 $locked = (isset($_POST['locked'])) ? $sql->quote_smart($_POST['locked']) : 0;
    776779
    777780 //make sure username/pass at least 4 chars long and less than max
    778781 if ((strlen($username) < 4) || (strlen($username) > 15)){
    779         $mysql->close();
     782        $sql->close();
    780783    redirect("user.php?action=edit_user&id=$id&error=8");
    781784   }
    782785
    783786 if ($gmlevel >= $user_lvl) {
    784         $mysql->close();
     787        $sql->close();
    785788    redirect("user.php?action=edit_user&&id={$_POST['id']}&error=16");
    786789   }
     
    789792 //make sure it doesnt contain non english chars.
    790793 if (!alphabetic($username)) {
    791         $mysql->close();
     794        $sql->close();
    792795    redirect("user.php?action=edit_user&error=9&id=$id");
    793796   }
    794797
    795798 //restricting accsess to lower gmlvl
    796  $result = $mysql->query("SELECT gmlevel,username FROM account WHERE id = '$id'");
    797  if (($user_lvl <= $mysql->result($result, 0, 'gmlevel'))&&($user_name != $mysql->result($result, 0, 'username'))){
    798         $mysql->close();
     799 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id = '$id'");
     800 if (($user_lvl <= $sql->result($result, 0, 'gmlevel'))&&($user_name != $sql->result($result, 0, 'username'))){
     801        $sql->close();
    799802        redirect("user.php?error=14");
    800803        }
    801804
    802  if (!$banned) $mysql->query("DELETE FROM account_banned WHERE id='$id'");
     805 if (!$banned) $sql->query("DELETE FROM account_banned WHERE id='$id'");
    803806        else {
    804                         $result = $mysql->query("SELECT count(*) FROM account_banned WHERE id = '$id'");
    805                         if(!$mysql->result($result, 0))
    806                                 $mysql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active)
     807                        $result = $sql->query("SELECT count(*) FROM account_banned WHERE id = '$id'");
     808                        if(!$sql->result($result, 0))
     809                                $sql->query("INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active)
    807810                                                           VALUES ($id, ".time().",".(time()+(365*24*3600)).",'$user_name','none', 1)");                                               
    808811                 }
    809812
    810  $mysql->query("UPDATE account SET email='$mail', $user_pass_change failed_logins='$failed',locked='$locked',gmlevel='$gmlevel',tbc='$tbc' WHERE id=$id");
    811 
    812  $mysql->close();
     813 $sql->query("UPDATE account SET email='$mail', $user_pass_change failed_logins='$failed',locked='$locked',gmlevel='$gmlevel',tbc='$tbc' WHERE id=$id");
     814
     815 $sql->close();
    813816 redirect("user.php?action=edit_user&error=13&id=$id");
    814817}
Note: See TracChangeset for help on using the changeset viewer.