Changeset 304 for minimanager/char.php
- Timestamp:
- Mar 13, 2008, 7:39:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/char.php
r292 r304 12 12 require_once("scripts/id_tab.php"); 13 13 require_once("scripts/get_lib.php"); 14 require_once("scripts/talents.php"); 14 15 require_once("scripts/defines.php"); 15 16 //resetování postavy17 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` SET30 `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 data45 $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 63 16 64 17 //######################################################################################################################## … … 102 55 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)){ 103 56 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'"); 105 58 $char = $sql->fetch_row($result); 106 59 $char_data = explode(' ',$char[0]); … … 111 64 $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'"); 112 65 $guild_name = $sql->result($query, 0, 'name'); 113 if ($user_lvl > 0 )$guild_name = "<a href=\"guild.php?action=view_guild&error=3&id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>";66 $guild_name = "<a href=\"guild.php?action=view_guild&error=3&id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>"; 114 67 if ($char_data[CHAR_DATA_OFFSET_GUILD_RANK]){ 115 68 $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]}'"); … … 164 117 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 165 118 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 119 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 166 120 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 167 121 $output .= "</ul> … … 170 124 171 125 <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 /> 173 127 {$lang_char['guild']}: $guild_name | {$lang_char['rank']}: $guild_rank<br />$online</td></tr> 174 128 <tr> 175 129 <td width=\"6%\">"; 176 130 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=\"\" />"; 178 132 $output .= "</td> 179 133 <td class=\"half_line\" colspan=\"4\">".get_map_name($char[5])." - ".get_zone_name($char[4])."</td> 180 134 <td width=\"6%\">"; 181 135 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=\"\" />"; 183 137 $output .= "</td> 184 138 </tr> … … 186 140 <td>"; 187 141 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=\"\" />"; 189 143 $output .= "</td> 190 144 <td class=\"half_line\" colspan=\"4\"> … … 192 146 <td>"; 193 147 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=\"\" />"; 195 149 $output .= "</td> 196 150 </tr> … … 198 152 <td>"; 199 153 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=\"\" />"; 201 155 $output .= "</td> 202 156 <td class=\"half_line\" colspan=\"2\"> … … 210 164 <td>"; 211 165 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=\"\" />"; 213 167 $output .= "</td> 214 168 </tr> … … 216 170 <td>"; 217 171 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=\"\" />"; 219 173 $output .= "</td> 220 174 <td class=\"half_line\" colspan=\"2\" rowspan=\"3\" align=\"center\"> … … 256 210 <td>"; 257 211 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=\"\" />"; 259 213 $output .= "</td> 260 214 </tr> … … 262 216 <td>"; 263 217 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=\"\" />"; 265 219 $output .= "</td> 266 220 <td>"; 267 221 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=\"\" />"; 269 223 $output .= "</td> 270 224 </tr> … … 272 226 <td>"; 273 227 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=\"\" />"; 275 229 $output .= "</td> 276 230 <td>"; 277 231 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=\"\" />"; 279 233 $output .= "</td> 280 234 </tr> … … 282 236 <td>"; 283 237 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=\"\" />"; 285 239 $output .= "</td> 286 240 <td class=\"half_line\" colspan=\"2\" rowspan=\"2\" align=\"center\"> … … 314 268 <td>"; 315 269 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=\"\" />"; 317 271 $output .= "</td> 318 272 </tr> … … 320 274 <td>"; 321 275 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=\"\" />"; 323 277 $output .= "</td> 324 278 325 279 <td>"; 326 280 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=\"\" />"; 328 282 $output .= "</td> 329 283 </tr> … … 332 286 <td width=\"15%\">"; 333 287 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=\"\" />"; 335 289 $output .= "</td> 336 290 <td width=\"15%\">"; 337 291 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=\"\" />"; 339 293 $output .= "</td> 340 294 <td width=\"15%\">"; 341 295 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=\"\" />"; 343 297 $output .= "</td> 344 298 <td width=\"15%\"></td> … … 418 372 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 419 373 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 421 376 $char = $sql->fetch_row($result); 422 377 … … 496 451 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 497 452 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 453 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 498 454 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li> 499 455 </ul> … … 501 457 502 458 <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> 504 464 505 465 <table class=\"lined\" style=\"width: 700px;\"> … … 717 677 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 718 678 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 679 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 719 680 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li> 720 681 </ul> … … 826 787 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 827 788 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 789 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 828 790 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li> 829 791 </ul> … … 932 894 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 933 895 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 896 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 934 897 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li> 935 898 </ul> … … 1047 1010 } 1048 1011 1012 //######################################################################################################################## 1013 // SHOW CHARACTER TALENTS 1014 //######################################################################################################################## 1015 function 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 1019 if (empty($_GET['id'])) error($lang_global['empty_fields']); 1020 1021 //check for php gmp extension 1022 if (extension_loaded('gmp')) { $GMP=1; } 1023 else { $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 1036 if ($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&action=char_inv\">{$lang_char['inventory']}</a></li> 1056 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 1057 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 1058 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 1059 <li><a href=\"char.php?id=$id&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&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&check%5B%5D=$id",140); 1120 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&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 } 1049 1134 1050 1135 //######################################################################################################################## … … 1069 1154 char_skill(); 1070 1155 break; 1156 case "char_talent": 1157 char_talent(); 1158 break; 1071 1159 default: 1072 1160 char_main();
Note:
See TracChangeset
for help on using the changeset viewer.