Changeset 304 for minimanager/char.php


Ignore:
Timestamp:
Mar 13, 2008, 7:39:11 PM (17 years ago)
Author:
george
Message:

Aktualizace na minimanager 0.1.6d.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/char.php

    r292 r304  
    1212require_once("scripts/id_tab.php");
    1313require_once("scripts/get_lib.php");
     14require_once("scripts/talents.php");
    1415require_once("scripts/defines.php");
    15 
    16   //resetování postavy
    17   if (array_key_exists('reset', $_GET)) {
    18       $sql = new SQL;
    19       $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    20      
    21       $sql_home = mysql_query("SELECT * FROM `character_homebind` WHERE `guid` = '".$_GET['id']."' LIMIT 1");
    22       $load_home = mysql_fetch_array($sql_home);
    23       $home_char_map         = $load_home["map"];
    24       $home_char_position_x  = $load_home["position_x"];
    25       $home_char_position_y  = $load_home["position_y"];
    26       $home_char_position_z  = $load_home["position_z"];
    27         if (isset($home_char_map) AND isset ($home_char_position_x) AND isset ($home_char_position_y) AND isset ($home_char_position_z))
    28         {
    29           mysql_query("UPDATE `character` SET
    30           `map` = '".$home_char_map."' ,
    31           `position_x` ='".$home_char_position_x."' ,
    32           `position_y` = '".$home_char_position_y."' ,
    33           `position_z` = '".$home_char_position_z."'
    34            WHERE `guid` ='".$_GET['id']."' LIMIT 1");
    35         }
    36     echo '
    37     <script>
    38       alert("Pozice postavy byla resetována!");
    39     </script>';
    40   }
    41  
    42   if (array_key_exists('reset_xp', $_GET))
    43   {
    44               // poradi v data
    45               $poradi = 862;
    46       $sql = new SQL;
    47       $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    48       $sql_res = mysql_query("SELECT * FROM `character` WHERE `guid` = '".$_GET['id']."' LIMIT 1");
    49       $load_res = mysql_fetch_array($sql_res);
    50       $data_old = $load_res["data"];
    51       $pole = explode(" " , $data_old);
    52       $pole[$poradi] = "0";
    53       $save = mysql_query("UPDATE `character` SET  `data` = '".implode(" ",$pole)."' WHERE `guid` ='".$_GET['id']."' LIMIT 1");
    54       $sql_res_k = mysql_query("SELECT * FROM `character` WHERE `guid` = '".$_GET['id']."' LIMIT 1");
    55       $load_res_k = mysql_fetch_array($sql_res_k);
    56       $pole_k = explode(" ",$load_res_k["data"]);
    57           if ($pole_k[$poradi] == "0")
    58           {
    59           echo "<script>alert(\"XP postavy bylo resetováno!\");</script>";
    60           }
    61   }
    62 
    6316
    6417//########################################################################################################################
     
    10255 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)){
    10356
    104         $result = $sql->query("SELECT data,name,race,class,zone,map,online,totaltime FROM `character` WHERE guid = '$id'");
     57        $result = $sql->query("SELECT data,name,race,class,zone,map,online,totaltime, mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".(36+1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `character` WHERE guid = '$id'");
    10558        $char = $sql->fetch_row($result);
    10659        $char_data = explode(' ',$char[0]);
     
    11164                $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");
    11265                $guild_name = $sql->result($query, 0, 'name');
    113                 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>";
     66                $guild_name = "<a href=\"guild.php?action=view_guild&amp;error=3&amp;id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>";
    11467                if ($char_data[CHAR_DATA_OFFSET_GUILD_RANK]){
    11568                        $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]}'");
     
    164117                                <li><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
    165118                                <li><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     119                                <li><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
    166120                                <li><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>";
    167121$output .= "</ul>
     
    170124
    171125<table class=\"lined\" style=\"width: 580px;\">
    172   <tr><td colspan=\"6\"><font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])." (lvl {$char_data[CHAR_DATA_OFFSET_LEVEL]})</font><br />
     126  <tr><td colspan=\"6\"><div><img src=".get_image_dir($char_data[CHAR_DATA_OFFSET_LEVEL],$char[8],$char[2],$char[3],$owner_gmlvl)."></div><font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])." (lvl {$char_data[CHAR_DATA_OFFSET_LEVEL]})</font><br />
    173127  {$lang_char['guild']}: $guild_name | {$lang_char['rank']}: $guild_rank<br />$online</td></tr>
    174128  <tr>
    175129    <td width=\"6%\">";
    176130    if (!empty($equiped_items[1][1])) $output .= maketooltip("<img src=\"{$equiped_items[1][1]}\" class=\"{$equiped_items[1][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_HEAD]}", $equiped_items[1][0], "item_tooltip", "target=\"_blank\"");
    177       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     131      else $output .= "<img src=\"img/Char_INV/INV_empty_head.png\" class=\"icon_border_0\" alt=\"\" />";
    178132$output .= "</td>
    179133    <td class=\"half_line\" colspan=\"4\">".get_map_name($char[5])." - ".get_zone_name($char[4])."</td>
    180134    <td width=\"6%\">";
    181135    if (!empty($equiped_items[10][1])) $output .= maketooltip("<img src=\"{$equiped_items[10][1]}\" class=\"{$equiped_items[10][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_GLOVES]}", $equiped_items[10][0], "item_tooltip", "target=\"_blank\"");
    182       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     136      else $output .= "<img src=\"img/Char_INV/INV_empty_gloves.png\" class=\"icon_border_0\" alt=\"\" />";
    183137$output .= "</td>
    184138  </tr>
     
    186140    <td>";
    187141    if (!empty($equiped_items[2][1])) $output .= maketooltip("<img src=\"{$equiped_items[2][1]}\" class=\"{$equiped_items[2][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_NECK]}", $equiped_items[2][0], "item_tooltip", "target=\"_blank\"");
    188       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     142      else $output .= "<img src=\"img/Char_INV/INV_empty_neck.png\" class=\"icon_border_0\" alt=\"\" />";
    189143$output .= "</td>
    190144    <td class=\"half_line\" colspan=\"4\">
     
    192146    <td>";
    193147    if (!empty($equiped_items[6][1])) $output .= maketooltip("<img src=\"{$equiped_items[6][1]}\" class=\"{$equiped_items[6][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_BELT]}", $equiped_items[6][0], "item_tooltip", "target=\"_blank\"");
    194       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     148      else $output .= "<img src=\"img/Char_INV/INV_empty_waist.png\" class=\"icon_border_0\" alt=\"\" />";
    195149$output .= "</td>
    196150  </tr>
     
    198152    <td>";
    199153    if (!empty($equiped_items[3][1])) $output .= maketooltip("<img src=\"{$equiped_items[3][1]}\" class=\"{$equiped_items[3][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]}", $equiped_items[3][0], "item_tooltip", "target=\"_blank\"");
    200       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     154      else $output .= "<img src=\"img/Char_INV/INV_empty_shoulder.png\" class=\"icon_border_0\" alt=\"\" />";
    201155$output .= "</td>
    202156    <td class=\"half_line\" colspan=\"2\">
     
    210164    <td>";
    211165    if (!empty($equiped_items[7][1])) $output .= maketooltip("<img src=\"{$equiped_items[7][1]}\" class=\"{$equiped_items[7][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_LEGS]}", $equiped_items[7][0], "item_tooltip", "target=\"_blank\"");
    212       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     166      else $output .= "<img src=\"img/Char_INV/INV_empty_legs.png\" class=\"icon_border_0\" alt=\"\" />";
    213167$output .= "</td>
    214168  </tr>
     
    216170    <td>";
    217171    if (!empty($equiped_items[15][1])) $output .= maketooltip("<img src=\"{$equiped_items[15][1]}\" class=\"{$equiped_items[15][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_BACK]}", $equiped_items[15][0], "item_tooltip", "target=\"_blank\"");
    218       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     172      else $output .= "<img src=\"img/Char_INV/INV_empty_chest_back.png\" class=\"icon_border_0\" alt=\"\" />";
    219173    $output .= "</td>
    220174    <td class=\"half_line\" colspan=\"2\" rowspan=\"3\" align=\"center\">
     
    256210    <td>";
    257211    if (!empty($equiped_items[8][1])) $output .= maketooltip("<img src=\"{$equiped_items[8][1]}\" class=\"{$equiped_items[8][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_FEET]}", $equiped_items[8][0], "item_tooltip", "target=\"_blank\"");
    258       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     212      else $output .= "<img src=\"img/Char_INV/INV_empty_feet.png\" class=\"icon_border_0\" alt=\"\" />";
    259213$output .= "</td>
    260214  </tr>
     
    262216    <td>";
    263217    if (!empty($equiped_items[5][1])) $output .= maketooltip("<img src=\"{$equiped_items[5][1]}\" class=\"{$equiped_items[5][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_CHEST]}", $equiped_items[5][0], "item_tooltip", "target=\"_blank\"");
    264       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     218      else $output .= "<img src=\"img/Char_INV/INV_empty_chest_back.png\" class=\"icon_border_0\" alt=\"\" />";
    265219$output .= "</td>
    266220    <td>";
    267221    if (!empty($equiped_items[11][1])) $output .= maketooltip("<img src=\"{$equiped_items[11][1]}\" class=\"{$equiped_items[11][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_FINGER1]}", $equiped_items[11][0], "item_tooltip", "target=\"_blank\"");
    268       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     222      else $output .= "<img src=\"img/Char_INV/INV_empty_finger.png\" class=\"icon_border_0\" alt=\"\" />";
    269223$output .= "</td>
    270224  </tr>
     
    272226    <td>";
    273227    if (!empty($equiped_items[4][1])) $output .= maketooltip("<img src=\"{$equiped_items[4][1]}\" class=\"{$equiped_items[4][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_SHIRT]}", $equiped_items[4][0], "item_tooltip", "target=\"_blank\"");
    274       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     228      else $output .= "<img src=\"img/Char_INV/INV_empty_shirt.png\" class=\"icon_border_0\" alt=\"\" />";
    275229$output .= "</td>
    276230    <td>";
    277231    if (!empty($equiped_items[12][1])) $output .= maketooltip("<img src=\"{$equiped_items[12][1]}\" class=\"{$equiped_items[12][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_FINGER2]}", $equiped_items[12][0], "item_tooltip", "target=\"_blank\"");
    278       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     232      else $output .= "<img src=\"img/Char_INV/INV_empty_finger.png\" class=\"icon_border_0\" alt=\"\" />";
    279233$output .= "</td>
    280234  </tr>
     
    282236    <td>";
    283237    if (!empty($equiped_items[19][1])) $output .= maketooltip("<img src=\"{$equiped_items[19][1]}\" class=\"{$equiped_items[19][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_TABARD]}", $equiped_items[19][0], "item_tooltip", "target=\"_blank\"");
    284       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     238      else $output .= "<img src=\"img/Char_INV/INV_empty_tabard.png\" class=\"icon_border_0\" alt=\"\" />";
    285239$output .= "</td>
    286240    <td class=\"half_line\" colspan=\"2\" rowspan=\"2\" align=\"center\">
     
    314268    <td>";
    315269    if (!empty($equiped_items[13][1])) $output .= maketooltip("<img src=\"{$equiped_items[13][1]}\" class=\"{$equiped_items[13][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]}", $equiped_items[13][0], "item_tooltip", "target=\"_blank\"");
    316       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     270      else $output .= "<img src=\"img/Char_INV/INV_empty_trinket.png\" class=\"icon_border_0\" alt=\"\" />";
    317271$output .= "</td>
    318272  </tr>
     
    320274    <td>";
    321275    if (!empty($equiped_items[9][1])) $output .= maketooltip("<img src=\"{$equiped_items[9][1]}\" class=\"{$equiped_items[9][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_WRIST]}", $equiped_items[9][0], "item_tooltip", "target=\"_blank\"");
    322       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     276      else $output .= "<img src=\"img/Char_INV/INV_empty_wrist.png\" class=\"icon_border_0\" alt=\"\" />";
    323277$output .= "</td>
    324278
    325279    <td>";
    326280    if (!empty($equiped_items[14][1])) $output .= maketooltip("<img src=\"{$equiped_items[14][1]}\" class=\"{$equiped_items[14][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]}", $equiped_items[14][0], "item_tooltip", "target=\"_blank\"");
    327       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     281      else $output .= "<img src=\"img/Char_INV/INV_empty_trinket.png\" class=\"icon_border_0\" alt=\"\" />";
    328282    $output .= "</td>
    329283  </tr>
     
    332286    <td width=\"15%\">";
    333287    if (!empty($equiped_items[16][1])) $output .= maketooltip("<img src=\"{$equiped_items[16][1]}\" class=\"{$equiped_items[16][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]}", $equiped_items[16][0], "item_tooltip", "target=\"_blank\"");
    334       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     288      else $output .= "<img src=\"img/Char_INV/INV_empty_main_hand.png\" class=\"icon_border_0\" alt=\"\" />";
    335289    $output .= "</td>
    336290    <td width=\"15%\">";
    337291    if (!empty($equiped_items[17][1])) $output .= maketooltip("<img src=\"{$equiped_items[17][1]}\" class=\"{$equiped_items[17][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]}", $equiped_items[17][0], "item_tooltip", "target=\"_blank\"");
    338       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     292      else $output .= "<img src=\"img/Char_INV/INV_empty_off_hand.png\" class=\"icon_border_0\" alt=\"\" />";
    339293$output .= "</td>
    340294    <td width=\"15%\">";
    341295    if (!empty($equiped_items[18][1])) $output .= maketooltip("<img src=\"{$equiped_items[18][1]}\" class=\"{$equiped_items[18][2]}\" alt=\"\" />", "$item_datasite{$char_data[CHAR_DATA_OFFSET_EQU_RANGED]}", $equiped_items[18][0], "item_tooltip", "target=\"_blank\"");
    342       else $output .= "<img src=\"img/INV/INV_empty_32.gif\" class=\"icon_border_0\" alt=\"\" />";
     296      else $output .= "<img src=\"img/Char_INV/INV_empty_ranged.png\" class=\"icon_border_0\" alt=\"\" />";
    343297$output .= "</td>
    344298<td width=\"15%\"></td>
     
    418372        $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    419373
    420         $result = $sql->query("SELECT name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1) FROM `character` WHERE guid = '$id'");
     374        $result = $sql->query("SELECT name,race,class,SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GOLD+1)."), ' ', -1), SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1), mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".(36+1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `character` WHERE guid = '$id'");
     375
    421376        $char = $sql->fetch_row($result);
    422377
     
    496451        <li><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
    497452        <li><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     453        <li><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
    498454        <li><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>
    499455</ul>
     
    501457
    502458<div id=\"tab_content\">
    503 <font class=\"bold\">$char[0] - ".get_player_race($char[1])." ".get_player_class($char[2])."</font><br /><br />
     459 <img src=".get_image_dir($char[4],$char[5],$char[1],$char[2],$owner_gmlvl).">
     460 <br>
     461 <font class=\"bold\">$char[0] - ".get_player_race($char[1])." ".get_player_class($char[2])." (lvl {$char[4]})
     462 <br>
     463 <br>
    504464
    505465<table class=\"lined\" style=\"width: 700px;\">
     
    717677                <li id=\"selected\"><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
    718678                <li><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     679                <li><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
    719680                <li><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>
    720681                </ul>
     
    826787                <li><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
    827788                <li><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     789                <li><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
    828790                <li id=\"selected\"><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>
    829791 </ul>
     
    932894                <li><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
    933895                <li id=\"selected\"><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     896                <li><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
    934897                <li><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>
    935898        </ul>
     
    10471010}
    10481011
     1012//########################################################################################################################
     1013// SHOW CHARACTER TALENTS
     1014//########################################################################################################################
     1015function char_talent() {
     1016 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db,
     1017        $user_name, $talent_datasite, $talent_calculator_datasite;
     1018
     1019if (empty($_GET['id'])) error($lang_global['empty_fields']);
     1020
     1021//check for php gmp extension
     1022if (extension_loaded('gmp')) { $GMP=1; }
     1023else { $GMP=0; }
     1024//end of gmp check
     1025
     1026$sql = new SQL;
     1027$sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
     1028
     1029$id = $sql->quote_smart($_GET['id']);
     1030$order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : 1;
     1031$dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
     1032$dir = ($dir) ? 0 : 1;
     1033
     1034$result = $sql->query("SELECT account FROM `character` WHERE guid = '$id'");
     1035
     1036if ($sql->num_rows($result) == 1){
     1037    $owner_acc_id = $sql->result($result, 0, 'account');
     1038    $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     1039    $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'");
     1040    $owner_gmlvl = $sql->result($result, 0, 'gmlevel');
     1041    $owner_name = $sql->result($result, 0, 'username');
     1042
     1043 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){
     1044
     1045    $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
     1046
     1047    $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'");
     1048    $char = $sql->fetch_row($result);
     1049    $char_data = explode(' ',$char[0]);
     1050
     1051    $output .= "<center>
     1052        <div id=\"tab\">
     1053    <ul>
     1054        <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li>
     1055        <li><a href=\"char.php?id=$id&amp;action=char_inv\">{$lang_char['inventory']}</a></li>
     1056        <li><a href=\"char.php?id=$id&amp;action=char_quest\">{$lang_char['quests']}</a></li>
     1057        <li><a href=\"char.php?id=$id&amp;action=char_skill\">{$lang_char['skills']}</a></li>
     1058        <li id=\"selected\"><a href=\"char.php?id=$id&amp;action=char_talent\">{$lang_char['talents']}</a></li>
     1059        <li><a href=\"char.php?id=$id&amp;action=char_rep\">{$lang_char['reputation']}</a></li>
     1060    </ul>
     1061    </div>
     1062    <div id=\"tab_content\">
     1063    <font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])." <br /><br /> ".get_player_class($char[3])." Talents </font><br /><br />
     1064
     1065    <table class=\"lined\" style=\"width: 550px;\">
     1066    <tr>"
     1067        ."<th>{$lang_char['talent_id']}</th>"
     1068        ."<th align=left>{$lang_char['talent_name']}</th>
     1069    </tr>";
     1070
     1071    $result = $sql->query("SELECT spell FROM `character_spell` WHERE guid = '$id' AND active = '1'");
     1072
     1073    if ($sql->num_rows($result)){
     1074        if ($GMP) { $talent_sum = gmp_init(0); }
     1075        while ($talent = $sql->fetch_row($result)){
     1076            if( get_talent_value($talent[0]) )
     1077            {
     1078                $output .= "<tr>";
     1079                $output .= "<td>$talent[0]</td>";
     1080                                 $output .= "<td align=left><a href=\"$talent_datasite$talent[0]\">".get_talent_name($talent[0])."</a></td>";
     1081                if ($GMP) { $talent_sum = gmp_add($talent_sum,sprintf('%s',get_talent_value($talent[0]))); }
     1082                $output .= "</tr>";
     1083            }
     1084        }
     1085        $playerclass = strtolower(get_player_class($char[3]));
     1086        switch ($playerclass) {
     1087            case "shaman":
     1088                $padlength = 61;
     1089                break;
     1090            case "druid":
     1091                $padlength = 62;
     1092                break;
     1093            case "warlock":
     1094            case "paladin":
     1095            case "hunter":
     1096            case "priest":
     1097                $padlength = 64;
     1098                break;
     1099            case "warrior":
     1100                $padlength = 66;
     1101                break;
     1102            case "rogue":
     1103            case "mage":
     1104                $padlength = 67;
     1105                break;
     1106        }
     1107        if ($GMP) { $output .= "<tr><td><a href=\"$talent_calculator_datasite/$playerclass/talents.html?".str_pad(sprintf('%s',gmp_strval($talent_sum)), $padlength, "0", STR_PAD_LEFT)."\">Talent Calculator</a></td></tr>"; }
     1108
     1109    }
     1110
     1111    $output .= "</table></div><br />
     1112        <table class=\"hidden\">
     1113          <tr><td>";
     1114        if ($user_lvl > $owner_gmlvl){
     1115            makebutton($lang_char['chars_acc'], "user.php?action=edit_user&amp;id=$owner_acc_id",140);
     1116            makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140);
     1117            }
     1118        if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){
     1119            makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&amp;check%5B%5D=$id",140);
     1120            makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&amp;to=$char[1]",140);
     1121            }
     1122        makebutton($lang_global['back'], "javascript:window.history.back()",140);
     1123    $output .= "</td></tr>
     1124        </table><br /></center>";
     1125
     1126 } else {
     1127        $sql->close();
     1128        error($lang_char['no_permission']);
     1129        }
     1130
     1131} else error($lang_char['no_char_found']);
     1132$sql->close();
     1133}
    10491134
    10501135//########################################################################################################################
     
    10691154   char_skill();
    10701155   break;
     1156case "char_talent":
     1157   char_talent();
     1158   break;
    10711159default:
    10721160    char_main();
Note: See TracChangeset for help on using the changeset viewer.