Changeset 374 for minimanager/char.php
- Timestamp:
- Sep 11, 2008, 9:10:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/char.php
r307 r374 9 9 */ 10 10 require_once("header.php"); 11 valid_login( 0);11 valid_login($action_permission['read']); 12 12 require_once("scripts/id_tab.php"); 13 13 require_once("scripts/get_lib.php"); … … 20 20 // SHOW GENERAL CHARACTERS INFO 21 21 //######################################################################################################################## 22 function char_main() { 23 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 24 $user_name, $item_datasite, $server, $user_id, $char_aura, $talent_datasite; 25 26 if (empty($_GET['id'])) error($lang_global['empty_fields']); 27 28 $sql = new SQL; 29 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 30 31 $id = $sql->quote_smart($_GET['id']); 32 33 $result = $sql->query("SELECT account,race FROM `characters` WHERE guid = $id LIMIT 1"); 34 35 if ($sql->num_rows($result)){ 36 //resrict by owner's gmlvl 37 $owner_acc_id = $sql->result($result, 0, 'account'); 38 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 39 $query = $sql->query("SELECT gmlevel,username FROM account WHERE id = $owner_acc_id"); 40 $owner_gmlvl = $sql->result($query, 0, 'gmlevel'); 41 $owner_name = $sql->result($query, 0, 'username'); 42 43 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 44 45 if( !$user_lvl && !$server[$realm_id]['both_factions']){ 46 $side_p = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2; 47 $result_1 = $sql->query("SELECT race FROM `characters` WHERE account = '$user_id' LIMIT 1"); 48 if ($sql->num_rows($result)){ 49 $side_v = (in_array($sql->result($result_1, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2; 50 } else $side_v = 0; 51 unset($result_1); 52 } else { 53 $side_v = 0; 54 $side_p = 0; 22 function char_main() 23 { 24 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 25 $user_name, $item_datasite, $server, $user_id, $char_aura, $talent_datasite; 26 27 if (empty($_GET['id'])) error($lang_global['empty_fields']); 28 29 $sql = new SQL; 30 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 31 32 $id = $sql->quote_smart($_GET['id']); 33 if (!is_numeric($id)) $id = 0; 34 35 $result = $sql->query("SELECT account, race FROM `characters` WHERE guid = $id LIMIT 1"); 36 37 if ($sql->num_rows($result)) 38 { 39 //resrict by owner's gmlvl 40 $owner_acc_id = $sql->result($result, 0, 'account'); 41 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 42 $query = $sql->query("SELECT gmlevel,username FROM account WHERE id = $owner_acc_id"); 43 $owner_gmlvl = $sql->result($query, 0, 'gmlevel'); 44 $owner_name = $sql->result($query, 0, 'username'); 45 46 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 47 48 if(!$user_lvl && !$server[$realm_id]['both_factions']) 49 { 50 $side_p = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? 1 : 2; 51 $result_1 = $sql->query("SELECT race FROM `characters` WHERE account = $user_id LIMIT 1"); 52 if ($sql->num_rows($result)) 53 $side_v = (in_array($sql->result($result_1, 0, 'race'), array(2,5,6,8,10))) ? 1 : 2; 54 else 55 $side_v = 0; 56 unset($result_1); 57 } 58 else 59 { 60 $side_v = 0; 61 $side_p = 0; 62 } 63 64 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)) 65 { 66 67 $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 `characters` WHERE guid = $id"); 68 $char = $sql->fetch_row($result); 69 $char_data = explode(' ',$char[0]); 70 71 $online = ($char[6]) ? $lang_char['online'] : $lang_char['offline']; 72 73 if($char_data[CHAR_DATA_OFFSET_GUILD_ID]) 74 { 75 $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'"); 76 $guild_name = $sql->result($query, 0, 'name'); 77 $guild_name = "<a href=\"guild.php?action=view_guild&error=3&id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>"; 78 $mrank = $char_data[CHAR_DATA_OFFSET_GUILD_RANK] + 1; 79 $guild_rank_query = $sql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$mrank}'"); 80 $guild_rank = $sql->result($guild_rank_query, 0, 'rname'); 81 } 82 else 83 { 84 $guild_name = $lang_global['none']; 85 $guild_rank = $lang_global['none']; 86 } 87 88 $block = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_BLOCK])); 89 $block = round($block[1],2); 90 $dodge = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_DODGE])); 91 $dodge = round($dodge[1],2); 92 $parry = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_PARRY])); 93 $parry = round($parry[1],2); 94 $crit = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_CRIT])); 95 $crit = round($crit[1],2); 96 $range_crit = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_RANGE_CRIT])); 97 $range_crit = round($range_crit[1],2); 98 99 $EQU_HEAD = $char_data[CHAR_DATA_OFFSET_EQU_HEAD]; 100 $EQU_NECK = $char_data[CHAR_DATA_OFFSET_EQU_NECK]; 101 $EQU_SHOULDER = $char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]; 102 $EQU_SHIRT = $char_data[CHAR_DATA_OFFSET_EQU_SHIRT]; 103 $EQU_CHEST = $char_data[CHAR_DATA_OFFSET_EQU_CHEST]; 104 $EQU_BELT = $char_data[CHAR_DATA_OFFSET_EQU_BELT]; 105 $EQU_LEGS = $char_data[CHAR_DATA_OFFSET_EQU_LEGS]; 106 $EQU_FEET = $char_data[CHAR_DATA_OFFSET_EQU_FEET]; 107 $EQU_WRIST = $char_data[CHAR_DATA_OFFSET_EQU_WRIST]; 108 $EQU_GLOVES = $char_data[CHAR_DATA_OFFSET_EQU_GLOVES]; 109 $EQU_FINGER1 = $char_data[CHAR_DATA_OFFSET_EQU_FINGER1]; 110 $EQU_FINGER2 = $char_data[CHAR_DATA_OFFSET_EQU_FINGER2]; 111 $EQU_TRINKET1 = $char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]; 112 $EQU_TRINKET2 = $char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]; 113 $EQU_BACK = $char_data[CHAR_DATA_OFFSET_EQU_BACK]; 114 $EQU_MAIN_HAND = $char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]; 115 $EQU_OFF_HAND = $char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]; 116 $EQU_RANGED = $char_data[CHAR_DATA_OFFSET_EQU_RANGED]; 117 $EQU_TABARD = $char_data[CHAR_DATA_OFFSET_EQU_TABARD]; 118 119 $equiped_items = array( 120 1 => array(($EQU_HEAD ? get_item_tooltip($EQU_HEAD) : 0), ($EQU_HEAD ? get_icon($EQU_HEAD) : 0),($EQU_HEAD ? get_item_border($EQU_HEAD) : 0)), 121 2 => array(($EQU_NECK ? get_item_tooltip($EQU_NECK) : 0), ($EQU_NECK ? get_icon($EQU_NECK) : 0),($EQU_NECK ? get_item_border($EQU_NECK) : 0)), 122 3 => array(($EQU_SHOULDER ? get_item_tooltip($EQU_SHOULDER) : 0), ($EQU_SHOULDER ? get_icon($EQU_SHOULDER) : 0),($EQU_SHOULDER ? get_item_border($EQU_SHOULDER) : 0)), 123 4 => array(($EQU_SHIRT ? get_item_tooltip($EQU_SHIRT) : 0), ($EQU_SHIRT ? get_icon($EQU_SHIRT) : 0),($EQU_SHIRT ? get_item_border($EQU_SHIRT) : 0)), 124 5 => array(($EQU_CHEST ? get_item_tooltip($EQU_CHEST) : 0), ($EQU_CHEST ? get_icon($EQU_CHEST) : 0),($EQU_CHEST ? get_item_border($EQU_CHEST) : 0)), 125 6 => array(($EQU_BELT ? get_item_tooltip($EQU_BELT) : 0), ($EQU_BELT ? get_icon($EQU_BELT) : 0),($EQU_BELT ? get_item_border($EQU_BELT) : 0)), 126 7 => array(($EQU_LEGS ? get_item_tooltip($EQU_LEGS) : 0), ($EQU_LEGS ? get_icon($EQU_LEGS) : 0),($EQU_LEGS ? get_item_border($EQU_LEGS) : 0)), 127 8 => array(($EQU_FEET ? get_item_tooltip($EQU_FEET) : 0), ($EQU_FEET ? get_icon($EQU_FEET) : 0),($EQU_FEET ? get_item_border($EQU_FEET) : 0)), 128 9 => array(($EQU_WRIST ? get_item_tooltip($EQU_WRIST) : 0), ($EQU_WRIST ? get_icon($EQU_WRIST) : 0),($EQU_WRIST ? get_item_border($EQU_WRIST) : 0)), 129 10 => array(($EQU_GLOVES ? get_item_tooltip($EQU_GLOVES) : 0), ($EQU_GLOVES ? get_icon($EQU_GLOVES) : 0),($EQU_GLOVES ? get_item_border($EQU_GLOVES) : 0)), 130 11 => array(($EQU_FINGER1 ? get_item_tooltip($EQU_FINGER1) : 0), ($EQU_FINGER1 ? get_icon($EQU_FINGER1) : 0),($EQU_FINGER1 ? get_item_border($EQU_FINGER1) : 0)), 131 12 => array(($EQU_FINGER2 ? get_item_tooltip($EQU_FINGER2) : 0), ($EQU_FINGER2 ? get_icon($EQU_FINGER2) : 0),($EQU_FINGER2 ? get_item_border($EQU_FINGER2) : 0)), 132 13 => array(($EQU_TRINKET1 ? get_item_tooltip($EQU_TRINKET1) : 0), ($EQU_TRINKET1 ? get_icon($EQU_TRINKET1) : 0),($EQU_TRINKET1 ? get_item_border($EQU_TRINKET1) : 0)), 133 14 => array(($EQU_TRINKET2 ? get_item_tooltip($EQU_TRINKET2) : 0), ($EQU_TRINKET2 ? get_icon($EQU_TRINKET2) : 0),($EQU_TRINKET2 ? get_item_border($EQU_TRINKET2) : 0)), 134 15 => array(($EQU_BACK ? get_item_tooltip($EQU_BACK) : 0), ($EQU_BACK ? get_icon($EQU_BACK) : 0),($EQU_BACK ? get_item_border($EQU_BACK) : 0)), 135 16 => array(($EQU_MAIN_HAND ? get_item_tooltip($EQU_MAIN_HAND) : 0), ($EQU_MAIN_HAND ? get_icon($EQU_MAIN_HAND) : 0),($EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND) : 0)), 136 17 => array(($EQU_OFF_HAND ? get_item_tooltip($EQU_OFF_HAND) : 0), ($EQU_OFF_HAND ? get_icon($EQU_OFF_HAND) : 0),($EQU_OFF_HAND ? get_item_border($EQU_OFF_HAND) : 0)), 137 18 => array(($EQU_RANGED ? get_item_tooltip($EQU_RANGED) : 0), ($EQU_RANGED ? get_icon($EQU_RANGED) : 0),($EQU_RANGED ? get_item_border($EQU_RANGED) : 0)), 138 19 => array(($EQU_TABARD ? get_item_tooltip($EQU_TABARD) : 0), ($EQU_TABARD ? get_icon($EQU_TABARD) : 0),($EQU_TABARD ? get_item_border($EQU_TABARD) : 0)) 139 ); 140 141 $output .= "<center><div id=\"tab\"><ul><li id=\"selected\"><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li>"; 142 143 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)) 144 { 145 $output .= "<li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 146 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 147 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 148 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 149 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 150 if (get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 151 } 152 $output .= "</ul></div><div id=\"tab_content\"><table class=\"lined\" style=\"width: 580px;\"> 153 <tr><td colspan=\"6\"><div><img src=".get_image_dir($char_data[CHAR_DATA_OFFSET_LEVEL],$char[8],$char[2],$char[3],0)."></div><div>"; 154 155 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 156 $a_results = $sql->query("SELECT DISTINCT spell,remaintime FROM `character_aura` WHERE guid = $id"); 157 if ($sql->num_rows($a_results)) 158 { 159 while ($aura = $sql->fetch_row($a_results)) 160 { 161 // $output .= "<a style=\"padding:2px;\" onmouseover=\"toolTip('<font color=\'white\'>".get_char_aura_name($aura[0])."<br />Id: $aura[0]</font>','item_tooltip')\" onmouseout=\"toolTip()\" href=\"$talent_datasite$aura[0]\"><img src=\"".get_aura_icon($aura[0])."\" width=24 height=24></a>"; 162 $output .= "<a style=\"padding:2px;\" href=\"$talent_datasite$aura[0]\"><img src=\"".get_aura_icon($aura[0])."\" width=24 height=24></a>"; 55 163 } 56 57 if ($user_lvl >= $owner_gmlvl && (($side_v == $side_p) || !$side_v)){58 59 $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 `characters` WHERE guid = '$id'");60 $char = $sql->fetch_row($result);61 $char_data = explode(' ',$char[0]);62 63 $online = ($char[6]) ? $lang_char['online'] : $lang_char['offline'];64 65 if($char_data[CHAR_DATA_OFFSET_GUILD_ID]){66 $query = $sql->query("SELECT name FROM guild WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}'");67 $guild_name = $sql->result($query, 0, 'name');68 $guild_name = "<a href=\"guild.php?action=view_guild&error=3&id={$char_data[CHAR_DATA_OFFSET_GUILD_ID]}\" >$guild_name</a>";69 $mrank = $char_data[CHAR_DATA_OFFSET_GUILD_RANK] + 1;70 $guild_rank_query = $sql->query("SELECT rname FROM guild_rank WHERE guildid ='{$char_data[CHAR_DATA_OFFSET_GUILD_ID]}' AND rid='{$mrank}'");71 $guild_rank = $sql->result($guild_rank_query, 0, 'rname');72 } else {73 $guild_name = $lang_global['none'];74 $guild_rank = $lang_global['none'];75 }76 77 $block = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_BLOCK]));78 $block = round($block[1],2);79 $dodge = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_DODGE]));80 $dodge = round($dodge[1],2);81 $parry = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_PARRY]));82 $parry = round($parry[1],2);83 $crit = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_CRIT]));84 $crit = round($crit[1],2);85 $range_crit = unpack("f", pack("L", $char_data[CHAR_DATA_OFFSET_RANGE_CRIT]));86 $range_crit = round($range_crit[1],2);87 88 $equiped_items = array(89 1 => array(($char_data[CHAR_DATA_OFFSET_EQU_HEAD]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_HEAD]):0),($char_data[CHAR_DATA_OFFSET_EQU_HEAD]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_HEAD]):0),($char_data[CHAR_DATA_OFFSET_EQU_HEAD]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_HEAD]):0)),90 2 => array(($char_data[CHAR_DATA_OFFSET_EQU_NECK]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_NECK]):0),($char_data[CHAR_DATA_OFFSET_EQU_NECK]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_NECK]):0),($char_data[CHAR_DATA_OFFSET_EQU_NECK]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_NECK]):0)),91 3 => array(($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]):0),($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]):0),($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]):0)),92 4 => array(($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]):0),($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]):0),($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]):0)),93 5 => array(($char_data[CHAR_DATA_OFFSET_EQU_CHEST]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_CHEST]):0),($char_data[CHAR_DATA_OFFSET_EQU_CHEST]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_CHEST]):0),($char_data[CHAR_DATA_OFFSET_EQU_CHEST]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_CHEST]):0)),94 6 => array(($char_data[CHAR_DATA_OFFSET_EQU_BELT]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_BELT]):0),($char_data[CHAR_DATA_OFFSET_EQU_BELT]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_BELT]):0),($char_data[CHAR_DATA_OFFSET_EQU_BELT]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_BELT]):0)),95 7 => array(($char_data[CHAR_DATA_OFFSET_EQU_LEGS]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_LEGS]):0),($char_data[CHAR_DATA_OFFSET_EQU_LEGS]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_LEGS]):0),($char_data[CHAR_DATA_OFFSET_EQU_LEGS]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_LEGS]):0)),96 8 => array(($char_data[CHAR_DATA_OFFSET_EQU_FEET]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_FEET]):0),($char_data[CHAR_DATA_OFFSET_EQU_FEET]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_FEET]):0),($char_data[CHAR_DATA_OFFSET_EQU_FEET]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_FEET]):0)),97 9 => array(($char_data[CHAR_DATA_OFFSET_EQU_WRIST]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_WRIST]):0),($char_data[CHAR_DATA_OFFSET_EQU_WRIST]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_WRIST]):0),($char_data[CHAR_DATA_OFFSET_EQU_WRIST]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_WRIST]):0)),98 10 => array(($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]):0),($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]):0),($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]):0)),99 11 => array(($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]):0),($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]):0),($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]):0)),100 12 => array(($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]):0),($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]):0),($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]):0)),101 13 => array(($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]):0),($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]):0),($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]):0)),102 14 => array(($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]):0),($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]):0),($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]):0)),103 15 => array(($char_data[CHAR_DATA_OFFSET_EQU_BACK]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_BACK]):0),($char_data[CHAR_DATA_OFFSET_EQU_BACK]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_BACK]):0),($char_data[CHAR_DATA_OFFSET_EQU_BACK]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_BACK]):0)),104 16 => array(($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]):0),($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]):0),($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]):0)),105 17 => array(($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]):0),($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]):0),($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]):0)),106 18 => array(($char_data[CHAR_DATA_OFFSET_EQU_RANGED]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_RANGED]):0),($char_data[CHAR_DATA_OFFSET_EQU_RANGED]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_RANGED]):0),($char_data[CHAR_DATA_OFFSET_EQU_RANGED]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_RANGED]):0)),107 19 => array(($char_data[CHAR_DATA_OFFSET_EQU_TABARD]?get_item_tooltip($char_data[CHAR_DATA_OFFSET_EQU_TABARD]):0),($char_data[CHAR_DATA_OFFSET_EQU_TABARD]?get_icon($char_data[CHAR_DATA_OFFSET_EQU_TABARD]):0),($char_data[CHAR_DATA_OFFSET_EQU_TABARD]?get_item_border($char_data[CHAR_DATA_OFFSET_EQU_TABARD]):0))108 );109 110 111 $output .= "<center>112 <div id=\"tab\">113 <ul>114 <li id=\"selected\"><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li>";115 116 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name))117 { $output .= "<li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li>118 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li>119 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li>120 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li>121 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>";122 if( get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; }123 }124 $output .= "</ul>125 </div>126 <div id=\"tab_content\">127 128 <table class=\"lined\" style=\"width: 580px;\">129 <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><div>";130 131 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);132 $a_results = $sql->query("SELECT DISTINCT spell,remaintime FROM `character_aura` WHERE guid = '$id'");133 if ($sql->num_rows($a_results)){134 while ($aura = $sql->fetch_row($a_results)){135 if( isset($char_aura[$aura[0]]) )136 {137 $output .= "<a style=\"padding:2px;\" onmouseover=\"toolTip('<font color=\'white\'>".get_char_aura_name($aura[0])."<br />Id: $aura[0]</font>','item_tooltip')\" onmouseout=\"toolTip()\" href=\"$talent_datasite$aura[0]\"><img src=\"img/Char_AURA/".get_char_aura_image($aura[0])."\" width=24 height=24></a>";138 }139 else { $output .= ": <a href=\"$talent_datasite$aura[0]\">aura $aura[0]</a> :"; }140 }141 164 } 142 143 144 165 145 166 $output .="</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 /> … … 320 341 321 342 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 322 323 324 325 326 327 328 343 //total time played 344 $tot_time = $char[7]; 345 $tot_days = (int)($tot_time/86400); 346 $tot_time = $tot_time - ($tot_days*86400); 347 $total_hours = (int)($tot_time/3600); 348 $tot_time = $tot_time - ($total_hours*3600); 349 $total_min = (int)($tot_time/60); 329 350 330 351 $output .= "<table class=\"lined\" style=\"width: 580px;\"> … … 334 355 $output .= "<table class=\"hidden\"> 335 356 <tr><td>"; 336 if ($user_lvl > $owner_gmlvl){ 337 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 338 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 339 } 340 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 341 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 342 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 343 } 344 makebutton($lang_global['back'], "javascript:window.history.back()",140); 357 if ($user_lvl > $owner_gmlvl){ 358 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 359 $output .= "</td><td>"; 360 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 361 $output .= "</td><td>"; 362 } 363 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 364 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 365 $output .= "</td><td>"; 366 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 367 $output .= "</td><td>"; 368 } 369 makebutton($lang_global['back'], "javascript:window.history.back()",140); 345 370 $output .= "</td></tr> 346 371 </table><br /></center>"; 347 372 348 349 350 351 352 353 354 355 373 //end of admin options 374 } else { 375 $output .= "<table class=\"hidden\"> 376 <tr><td>"; 377 makebutton($lang_global['back'], "javascript:window.history.back()",200); 378 $output .= "</td></tr> 379 </table><br /></center>"; 380 } 356 381 } else { 357 358 359 382 $sql->close(); 383 error($lang_char['no_permission']); 384 } 360 385 361 386 } else error($lang_char['no_char_found']); 362 387 $sql->close(); 363 388 } 364 365 389 366 390 //######################################################################################################################## … … 369 393 function char_inv() { 370 394 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 371 395 $user_name,$item_datasite; 372 396 373 397 if (empty($_GET['id'])) error($lang_global['empty_fields']); … … 378 402 $id = $sql->quote_smart($_GET['id']); 379 403 380 $result = $sql->query("SELECT account FROM `characters` WHERE guid = '$id'LIMIT 1");404 $result = $sql->query("SELECT account FROM `characters` WHERE guid = $id LIMIT 1"); 381 405 382 406 if ($sql->num_rows($result)){ 383 384 385 386 387 407 $owner_acc_id = $sql->result($result, 0, 'account'); 408 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 409 $query = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'"); 410 $owner_gmlvl = $sql->result($query, 0, 'gmlevel'); 411 $owner_name = $sql->result($query, 0, 'username'); 388 412 389 413 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 390 414 391 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 392 393 $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 `characters` WHERE guid = '$id'"); 394 395 $char = $sql->fetch_row($result); 396 397 $result = $sql->query("SELECT bag,slot,item,item_template FROM character_inventory WHERE guid = '$id' ORDER BY bag,slot"); 398 $bag = array( 399 0=>array(), 400 1=>array(), 401 2=>array(), 402 3=>array(), 403 4=>array() 404 ); 405 406 $bank = array( 407 0=>array(), 408 1=>array(), 409 2=>array(), 410 3=>array(), 411 4=>array(), 412 5=>array(), 413 6=>array(), 414 7=>array() 415 ); 416 417 $bank_bag_id = array(); 418 $bag_id = array(); 419 $equiped_bag_id = array(0,0,0,0,0); 420 $equip_bnk_bag_id = array(0,0,0,0,0,0,0,0); 421 422 423 while ($slot = $sql->fetch_row($result)) 424 { 425 if ($slot[0] == 0 && $slot[1] > 18) 426 { 427 if($slot[1] < 23) // SLOT 19 TO 22 (Bags) 428 { 429 $bag_id[$slot[2]] = ($slot[1]-18); 430 $equiped_bag_id[$slot[1]-18] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots')); 431 } 432 elseif($slot[1] < 39) // SLOT 23 TO 38 (BackPack) 433 { 434 if(isset($bag[0][$slot[1]-23])) 435 $bag[0][$slot[1]-23][0]++; 436 else $bag[0][$slot[1]-23] = array($slot[3],0); 437 } 438 elseif($slot[1] < 67) // SLOT 39 TO 66 (Bank) 439 { 440 $bank[0][$slot[1]-39] = $slot[3]; 441 } 442 elseif($slot[1] < 74) // SLOT 67 TO 73 (Bank Bags) 443 { 444 $bank_bag_id[$slot[2]] = ($slot[1]-66); 445 $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots')); 446 } 447 } 448 else 449 { 450 // Bags 451 if (isset($bag_id[$slot[0]])) 452 { 453 if(isset($bag[$bag_id[$slot[0]]][$slot[1]])) 454 $bag[$bag_id[$slot[0]]][$slot[1]][1]++; 455 else $bag[$bag_id[$slot[0]]][$slot[1]] = array($slot[3],0); 456 } 457 // Bank Bags 458 elseif (isset($bank_bag_id[$slot[0]])) 459 { 460 $bank[$bank_bag_id[$slot[0]]][$slot[1]] = $slot[3]; 461 } 462 } 463 } 464 465 $output .= "<center> 466 <div id=\"tab\"> 415 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 416 417 $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 `characters` WHERE guid = $id"); 418 419 $char = $sql->fetch_row($result); 420 421 $result = $sql->query("SELECT ci.bag,ci.slot,ci.item,ci.item_template, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 15), ' ', -1) as stack_count FROM character_inventory ci INNER JOIN item_instance ii on ii.guid = ci.item WHERE ci.guid = $id ORDER BY ci.bag,ci.slot"); 422 $bag = array( 423 0=>array(), 424 1=>array(), 425 2=>array(), 426 3=>array(), 427 4=>array() 428 ); 429 430 $bank = array( 431 0=>array(), 432 1=>array(), 433 2=>array(), 434 3=>array(), 435 4=>array(), 436 5=>array(), 437 6=>array(), 438 7=>array() 439 ); 440 441 $bank_bag_id = array(); 442 $bag_id = array(); 443 $equiped_bag_id = array(0,0,0,0,0); 444 $equip_bnk_bag_id = array(0,0,0,0,0,0,0,0); 445 446 while ($slot = $sql->fetch_row($result)) 447 { 448 if ($slot[0] == 0 && $slot[1] > 18) 449 { 450 if($slot[1] < 23) // SLOT 19 TO 22 (Bags) 451 { 452 $bag_id[$slot[2]] = ($slot[1]-18); 453 $equiped_bag_id[$slot[1]-18] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'), $slot[4]); 454 } 455 elseif($slot[1] < 39) // SLOT 23 TO 38 (BackPack) 456 { 457 if(isset($bag[0][$slot[1]-23])) 458 $bag[0][$slot[1]-23][0]++; 459 else $bag[0][$slot[1]-23] = array($slot[3],0,$slot[4]); 460 } 461 elseif($slot[1] < 67) // SLOT 39 TO 66 (Bank) 462 { 463 $bank[0][$slot[1]-39] = array($slot[3],0,$slot[4]); 464 } 465 elseif($slot[1] < 74) // SLOT 67 TO 73 (Bank Bags) 466 { 467 $bank_bag_id[$slot[2]] = ($slot[1]-66); 468 $equip_bnk_bag_id[$slot[1]-66] = array($slot[3], $sql->result($sql->query("SELECT ContainerSlots FROM `".$mangos_db[$realm_id]['name']."`.`item_template` WHERE entry ='{$slot[3]}'"), 0, 'ContainerSlots'), $slot[4]); 469 } 470 } 471 else 472 { 473 // Bags 474 if (isset($bag_id[$slot[0]])) 475 { 476 if(isset($bag[$bag_id[$slot[0]]][$slot[1]])) 477 $bag[$bag_id[$slot[0]]][$slot[1]][1]++; 478 else $bag[$bag_id[$slot[0]]][$slot[1]] = array($slot[3],0,$slot[4]); 479 } 480 // Bank Bags 481 elseif (isset($bank_bag_id[$slot[0]])) 482 { 483 $bank[$bank_bag_id[$slot[0]]][$slot[1]] = array($slot[3],0,$slot[4]); 484 } 485 } 486 } 487 488 $output .= "<center><div id=\"tab\"> 467 489 <ul> 468 469 470 471 472 473 474 if( get_player_class($char[2]) == 'Hunter' ) { $output .= "<li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; }490 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 491 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 492 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 493 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 494 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 495 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 496 if( get_player_class($char[2]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 475 497 $output .= "</ul> 476 498 </div> 477 499 478 500 <div id=\"tab_content\"> 479 <img src=".get_image_dir($char[4],$char[5],$char[1],$char[2], $owner_gmlvl).">480 <br >501 <img src=".get_image_dir($char[4],$char[5],$char[1],$char[2],0)." /> 502 <br \> 481 503 <font class=\"bold\">$char[0] - ".get_player_race($char[1])." ".get_player_class($char[2])." (lvl {$char[4]}) 482 <br >483 <br >504 <br \> 505 <br \> 484 506 485 507 <table class=\"lined\" style=\"width: 700px;\"> 486 508 <tr> 487 509 <th>"; 488 if($equiped_bag_id[1]){ 489 $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\""); 490 $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equiped_bag_id[1][1]} {$lang_item['slots']})</font"; 491 } 510 511 if($equiped_bag_id[1]){ 512 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[1][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[1][0]}", get_item_tooltip($equiped_bag_id[1][0]), "item_tooltip", "target=\"_blank\""); 513 $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equiped_bag_id[1][1]} {$lang_item['slots']})</font>"; 514 } 492 515 $output .= "</th><th>"; 493 494 $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\"");495 496 516 if($equiped_bag_id[2]){ 517 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[2][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[2][0]}", get_item_tooltip($equiped_bag_id[2][0]), "item_tooltip", "target=\"_blank\""); 518 $output .= "{$lang_item['bag']} II<br /><font class=\"small\">({$equiped_bag_id[2][1]} {$lang_item['slots']})</font>"; 519 } 497 520 $output .= "</th><th>"; 498 499 $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\"");500 501 521 if($equiped_bag_id[3]){ 522 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[3][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[3][0]}", get_item_tooltip($equiped_bag_id[3][0]), "item_tooltip", "target=\"_blank\""); 523 $output .= "{$lang_item['bag']} III<br /><font class=\"small\">({$equiped_bag_id[3][1]} {$lang_item['slots']})</font>"; 524 } 502 525 $output .= "</th><th>"; 503 504 $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\"");505 506 526 if($equiped_bag_id[4]){ 527 $output .= maketooltip("<img class=\"bag_icon\" src=\"".get_icon($equiped_bag_id[4][0])."\" alt=\"\" />", "$item_datasite{$equiped_bag_id[4][0]}", get_item_tooltip($equiped_bag_id[4][0]), "item_tooltip", "target=\"_blank\""); 528 $output .= "{$lang_item['bag']} IV<br /><font class=\"small\">({$equiped_bag_id[4][1]} {$lang_item['slots']})</font>"; 529 } 507 530 $output .= "</th> 508 531 </tr> 509 532 <tr>"; 510 533 // adds equipped bag slots 511 534 for($t = 1; $t < count($bag); $t++){ 512 535 $output .= "<td class=\"bag\" valign=\"bottom\" align=\"center\"> 513 <div style=\"width:".(4*43)."px;height:".(ceil($equiped_bag_id[$t][1]/4)*41)."px;\">"; 514 515 $dsp = $equiped_bag_id[$t][1]%4; 516 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; 517 foreach ($bag[$t] as $pos => $item){ 518 $output .= "<div style=\"left:".(($pos+$dsp)%4*42)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">"; 519 $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\""); 520 $output .= "</div>"; 536 <div style=\"width:".(4*43)."px;height:".(ceil($equiped_bag_id[$t][1]/4)*41)."px;\">"; 537 538 $dsp = $equiped_bag_id[$t][1]%4; 539 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; 540 foreach ($bag[$t] as $pos => $item){ 541 $output .= "<div style=\"left:".(($pos+$dsp)%4*42)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">"; 542 $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />".($item[1] ? ($item[1]+1) : ""), "$item_datasite{$item[0]}", get_item_tooltip($item[0]), "item_tooltip", "target=\"_blank\""); 543 $item[2] = $item[2] == 1 ? '' : $item[2]; 544 $output .= "<div style=\"width:25px;margin:-20px 0px 0px 18px;color: black; font-size:14px\">$item[2]</div><div style=\"width:25px;margin:-21px 0px 0px 17px;font-size:14px\">$item[2]</div></div>"; 545 } 546 $output .= "</td>"; 547 } 548 549 $output .= "</tr> 550 <tr> 551 <th colspan=\"2\" align=\"left\"> 552 <img class=\"bag_icon\" src=\"".get_icon(3960)."\" alt=\"\" align=\"absmiddle\" style=\"margin-left:100px;\" /> 553 <font style=\"margin-left:30px;\">{$lang_char['backpack']}</font> 554 </th> 555 <th colspan=\"2\"> 556 {$lang_char['bank_items']} 557 </th> 558 </tr> 559 <tr> 560 <td colspan=\"2\" class=\"bag\" align=\"center\" height=\"220px\"> 561 <div style=\"width:".(4*43)."px;height:".(ceil(16/4)*41)."px;\">"; 562 // inventory items 563 foreach ($bag[0] as $pos => $item){ 564 $output .= "<div style=\"left:".($pos%4*42)."px;top:".(floor($pos/4)*41)."px;\">"; 565 $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />".($item[1] ? ($item[1]+1) : ""), "$item_datasite{$item[0]}", get_item_tooltip($item[0]), "item_tooltip", "target=\"_blank\""); 566 $item[2] = $item[2] == 1 ? '' : $item[2]; 567 $output .= "<div style=\"width:25px;margin:-20px 0px 0px 18px;color: black; font-size:14px\">$item[2]</div><div style=\"width:25px;margin:-21px 0px 0px 17px;font-size:14px\">$item[2]</div></div>"; 568 } 569 570 $money_gold = (int)($char[3]/10000); 571 $money_silver = (int)(($char[3]-$money_gold*10000)/100); 572 $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100); 573 574 $output .= "</div> 575 <div style=\"text-align:right;width:168px;background-image:none;background-color:#393936;padding:2px;\"> 576 <b> 577 $money_gold <img src=\"img/gold.gif\" alt=\"\" align=\"absmiddle\" /> 578 $money_silver <img src=\"img/silver.gif\" alt=\"\" align=\"absmiddle\" /> 579 $money_cooper <img src=\"img/copper.gif\" alt=\"\" align=\"absmiddle\" /> 580 </b> 581 "; 582 583 $output .= "</div> 584 </td> 585 <td colspan=\"2\" class=\"bank\" align=\"center\"> 586 <div style=\"width:".(7*43)."px;height:".(ceil(24/7)*41)."px;\">"; 587 // bank items 588 foreach ($bank[0] as $pos => $item){ 589 $output .= "<div style=\"left:".($pos%7*43)."px;top:".(floor($pos/7)*41)."px;\">"; 590 $output .= maketooltip("<img src=\"".get_icon($item[0])."\" class=\"inv_icon\" alt=\"\" />", "$item_datasite{$item[0]}", get_item_tooltip($item[0]), "item_tooltip", "target=\"_blank\""); 591 $item[2] = $item[2] == 1 ? '' : $item[2]; 592 $output .= "<div style=\"width:25px;margin:-20px 0px 0px 18px;color: black; font-size:14px\">$item[2]</div><div style=\"width:25px;margin:-21px 0px 0px 17px;font-size:14px\">$item[2]</div></div>"; 593 } 594 595 $output .= "</div> 596 </td> 597 </tr> 598 <tr> 599 <th>"; 600 if($equip_bnk_bag_id[1]){ 601 $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_tooltip($equip_bnk_bag_id[1][0]), "item_tooltip", "target=\"_blank\""); 602 $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equip_bnk_bag_id[1][1]} {$lang_item['slots']})</font>"; 603 } 604 $output .= "</th><th>"; 605 if($equip_bnk_bag_id[2]){ 606 $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_tooltip($equip_bnk_bag_id[2][0]), "item_tooltip", "target=\"_blank\""); 607 $output .= "{$lang_item['bag']} II<br /><font class=\"small\">({$equip_bnk_bag_id[2][1]} {$lang_item['slots']})</font>"; 608 } 609 $output .= "</th><th>"; 610 if($equip_bnk_bag_id[3]){ 611 $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_tooltip($equip_bnk_bag_id[3][0]), "item_tooltip", "target=\"_blank\""); 612 $output .= "{$lang_item['bag']} III<br /><font class=\"small\">({$equip_bnk_bag_id[3][1]} {$lang_item['slots']})</font>"; 613 } 614 $output .= "</th><th>"; 615 if($equip_bnk_bag_id[4]){ 616 $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_tooltip($equip_bnk_bag_id[4][0]), "item_tooltip", "target=\"_blank\""); 617 $output .= "{$lang_item['bag']} IV<br /><font class=\"small\">({$equip_bnk_bag_id[4][1]} {$lang_item['slots']})</font>"; 618 } 619 $output .= "</th> 620 </tr> 621 <tr>"; 622 623 for($t=1; $t < count($bank); $t++){ 624 if($t==5){ 625 $output .= "</tr> 626 <tr> 627 <th>"; 628 if($equip_bnk_bag_id[5]){ 629 $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_tooltip($equip_bnk_bag_id[5][0]), "item_tooltip", "target=\"_blank\""); 630 $output .= "{$lang_item['bag']} V<br /><font class=\"small\">({$equip_bnk_bag_id[5][1]} {$lang_item['slots']})</font>"; 631 } 632 $output .= "</th><th>"; 633 if($equip_bnk_bag_id[6]){ 634 $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_tooltip($equip_bnk_bag_id[6][0]), "item_tooltip", "target=\"_blank\""); 635 $output .= "{$lang_item['bag']} VI<br /><font class=\"small\">({$equip_bnk_bag_id[6][1]} {$lang_item['slots']})</font>"; 636 } 637 $output .= "</th><th>"; 638 if($equip_bnk_bag_id[7]){ 639 $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_tooltip($equip_bnk_bag_id[7][0]), "item_tooltip", "target=\"_blank\""); 640 $output .= "{$lang_item['bag']} VII<br /><font class=\"small\">({$equip_bnk_bag_id[7][1]} {$lang_item['slots']})</font>"; 641 } 642 $output .= "</th> 643 <th></th> 644 </tr> 645 <tr>"; 646 } 647 648 $output .= "<td class=\"bank\" align=\"center\"> 649 <div style=\"width:".(4*43)."px;height:".(ceil($equip_bnk_bag_id[$t][1]/4)*41)."px;\">"; 650 651 $dsp=$equip_bnk_bag_id[$t][1]%4; 652 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; 653 foreach ($bank[$t] as $pos => $item){ 654 $output .= "<div style=\"left:".(($pos+$dsp)%4*43)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">"; 655 $output .= maketooltip("<img src=\"".get_icon($item[0])."\" alt=\"\" />", "$item_datasite{$item[0]}", get_item_tooltip($item[0]), "item_tooltip", "target=\"_blank\""); 656 $item[2] = $item[2] == 1 ? '' : $item[2]; 657 $output .= "<div style=\"width:25px;margin:-20px 0px 0px 18px;color: black; font-size:14px\">$item[2]</div><div style=\"width:25px;margin:-21px 0px 0px 17px;font-size:14px\">$item[2]</div></div>"; 521 658 } 522 $output .= "</td>"; 523 } 524 525 $output .= "</tr> 526 <tr> 527 <th colspan=\"2\" align=\"left\"> 528 <img class=\"bag_icon\" src=\"".get_icon(3960)."\" alt=\"\" align=\"absmiddle\" style=\"margin-left:100px;\" /> 529 <font style=\"margin-left:30px;\">{$lang_char['backpack']}</font> 530 </th> 531 <th colspan=\"2\"> 532 {$lang_char['bank_items']} 533 </th> 534 </tr> 535 <tr> 536 <td colspan=\"2\" class=\"bag\" align=\"center\" height=\"220px\"> 537 <div style=\"width:".(4*43)."px;height:".(ceil(16/4)*41)."px;\">"; 538 539 foreach ($bag[0] as $pos => $item){ 540 $output .= "<div style=\"left:".($pos%4*42)."px;top:".(floor($pos/4)*41)."px;\">"; 541 $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\""); 542 $output .= "</div>"; 543 } 544 545 $money_gold = (int)($char[3]/10000); 546 $money_silver = (int)(($char[3]-$money_gold*10000)/100); 547 $money_cooper = (int)($char[3]-$money_gold*10000-$money_silver*100); 548 549 $output .= "</div> 550 <div style=\"text-align:right;width:168px;background-image:none;background-color:#393936;padding:2px;\"> 551 <b> 552 $money_gold <img src=\"img/gold.gif\" alt=\"\" align=\"absmiddle\" /> 553 $money_silver <img src=\"img/silver.gif\" alt=\"\" align=\"absmiddle\" /> 554 $money_cooper <img src=\"img/copper.gif\" alt=\"\" align=\"absmiddle\" /> 555 </b> 556 "; 557 558 $output .= "</div> 559 </td> 560 <td colspan=\"2\" class=\"bank\" align=\"center\"> 561 <div style=\"width:".(7*43)."px;height:".(ceil(24/7)*41)."px;\">"; 562 563 foreach ($bank[0] as $pos => $item){ 564 $output .= "<div style=\"left:".($pos%7*43)."px;top:".(floor($pos/7)*41)."px;\">"; 565 $output .= maketooltip("<img src=\"".get_icon($item)."\" class=\"inv_icon\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\""); 566 $output .= "</div>"; 567 } 568 569 $output .= "</div> 570 </td> 571 </tr> 572 <tr> 573 <th>"; 574 if($equip_bnk_bag_id[1]){ 575 $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\""); 576 $output .= "{$lang_item['bag']} I<br /><font class=\"small\">({$equip_bnk_bag_id[1][1]} {$lang_item['slots']})</font>"; 577 } 578 $output .= "</th><th>"; 579 if($equip_bnk_bag_id[2]){ 580 $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\""); 581 $output .= "{$lang_item['bag']} II<br /><font class=\"small\">({$equip_bnk_bag_id[2][1]} {$lang_item['slots']})</font>"; 582 } 583 $output .= "</th><th>"; 584 if($equip_bnk_bag_id[3]){ 585 $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\""); 586 $output .= "{$lang_item['bag']} III<br /><font class=\"small\">({$equip_bnk_bag_id[3][1]} {$lang_item['slots']})</font>"; 587 } 588 $output .= "</th><th>"; 589 if($equip_bnk_bag_id[4]){ 590 $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\""); 591 $output .= "{$lang_item['bag']} IV<br /><font class=\"small\">({$equip_bnk_bag_id[4][1]} {$lang_item['slots']})</font>"; 592 } 593 $output .= "</th> 594 </tr> 595 <tr>"; 596 597 for($t=1; $t < count($bank); $t++){ 598 if($t==5){ 599 $output .= "</tr> 600 <tr> 601 <th>"; 602 if($equip_bnk_bag_id[5]){ 603 $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\""); 604 $output .= "{$lang_item['bag']} V<br /><font class=\"small\">({$equip_bnk_bag_id[5][1]} {$lang_item['slots']})</font>"; 605 } 606 $output .= "</th><th>"; 607 if($equip_bnk_bag_id[6]){ 608 $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\""); 609 $output .= "{$lang_item['bag']} VI<br /><font class=\"small\">({$equip_bnk_bag_id[6][1]} {$lang_item['slots']})</font>"; 610 } 611 $output .= "</th><th>"; 612 if($equip_bnk_bag_id[7]){ 613 $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\""); 614 $output .= "{$lang_item['bag']} VII<br /><font class=\"small\">({$equip_bnk_bag_id[7][1]} {$lang_item['slots']})</font>"; 615 } 616 $output .= "</th> 617 <th></th> 618 </tr> 619 <tr>"; 620 } 621 622 $output .= "<td class=\"bank\" align=\"center\"> 623 <div style=\"width:".(4*43)."px;height:".(ceil($equip_bnk_bag_id[$t][1]/4)*41)."px;\">"; 624 625 $dsp=$equip_bnk_bag_id[$t][1]%4; 626 if ($dsp) $output .= "<div class=\"no_slot\" /></div>"; 627 foreach ($bank[$t] as $pos => $item){ 628 $output .= "<div style=\"left:".(($pos+$dsp)%4*43)."px;top:".(floor(($pos+$dsp)/4)*41)."px;\">"; 629 $output .= maketooltip("<img src=\"".get_icon($item)."\" alt=\"\" />", "$item_datasite$item", get_item_name($item), "item_tooltip", "target=\"_blank\""); 630 $output .= "</div>"; 631 } 632 $output .= "</td>"; 659 $output .= "</td>"; 633 660 } 634 661 635 662 $output .= "<td class=\"bank\"></td></tr> 636 637 638 663 </table> 664 </div><br /> 665 <table class=\"hidden\"> 639 666 <tr><td>"; 640 if ($user_lvl > $owner_gmlvl){ 641 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 642 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 643 } 644 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 645 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 646 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 647 } 648 makebutton($lang_global['back'], "javascript:window.history.back()",140); 667 if ($user_lvl > $owner_gmlvl){ 668 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 669 $output .= "</td><td>"; 670 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 671 $output .= "</td><td>"; 672 } 673 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 674 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 675 $output .= "</td><td>"; 676 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 677 $output .= "</td><td>"; 678 } 679 makebutton($lang_global['back'], "javascript:window.history.back()",140); 649 680 $output .= "</td></tr> 650 681 </table><br /></center>"; 651 682 652 683 } else { 653 654 655 684 $sql->close(); 685 error($lang_char['no_permission']); 686 } 656 687 657 688 } else error($lang_char['no_char_found']); … … 665 696 function char_quest(){ 666 697 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 667 698 $user_name, $quest_datasite, $language; 668 699 669 700 if (empty($_GET['id'])) error($lang_global['empty_fields']); … … 676 707 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 0; 677 708 $dir = ($dir) ? 0 : 1; 678 $result = $sql->query("SELECT account,name,race,class FROM `characters` WHERE guid = '$id'LIMIT 1");709 $result = $sql->query("SELECT account,name,race,class FROM `characters` WHERE guid = $id LIMIT 1"); 679 710 680 711 if ($sql->num_rows($result)){ 681 $char = $sql->fetch_row($result); 682 683 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 684 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'"); 685 $owner_gmlvl = $sql->result($result, 0, 'gmlevel'); 686 $owner_name = $sql->result($result, 0, 'username'); 687 688 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 689 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 690 691 $result = $sql->query("SELECT quest,status FROM character_queststatus WHERE guid ='$id' AND ( status = 3 OR status = 1 ) ORDER BY status DESC"); 692 $output .= "<center> 693 <div id=\"tab\"> 694 <ul> 695 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 696 <li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 697 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 698 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 699 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 700 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 701 if( get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 702 $output .= "</ul> 703 </div> 704 <div id=\"tab_content\"> 705 <font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])."</font><br /><br /> 706 707 <table class=\"lined\" style=\"width: 550px;\"> 708 <tr>"; 709 if ($user_lvl) $output .= "<th width=\"10%\"><a href=\"char.php?id=$id&action=char_quest&order_by=0&dir=$dir\">".($order_by==0 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_id']}</a></th>"; 710 $output .= "<th width=\"7%\"><a href=\"char.php?id=$id&action=char_quest&order_by=1&dir=$dir\">".($order_by==1 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_level']}</a></th> 711 <th width=\"78%\"><a href=\"char.php?id=$id&action=char_quest&order_by=2&dir=$dir\">".($order_by==2 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_title']}</a></th> 712 <th width=\"5%\"><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" border=\"0\" /></a></th>"; 713 714 $quests_1 = array(); 715 $quests_3 = array(); 716 717 if ($sql->num_rows($result)){ 718 while ($quest = $sql->fetch_row($result)){ 719 $deplang = get_lang_id(); 720 $query1 = $sql->query("SELECT QuestLevel,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as Title FROM `".$mangos_db[$realm_id]['name']."`.`quest_template` LEFT JOIN `".$mangos_db[$realm_id]['name']."`.`locales_quest` ON `quest_template`.`entry` = `locales_quest`.`entry` WHERE `quest_template`.`entry` ='$quest[0]'"); 721 $quest_info = $sql->fetch_row($query1); 722 if($quest[1]==1) 723 array_push($quests_1, array($quest[0], $quest_info[0], $quest_info[1])); 724 else 725 array_push($quests_3, array($quest[0], $quest_info[0], $quest_info[1])); 726 } 727 aasort($quests_1, $order_by, $dir); 728 aasort($quests_3, $order_by, $dir); 729 730 foreach ($quests_3 as $data){ 731 $output .= "<tr>"; 732 if($user_lvl) $output .= "<td>$data[0]</td>"; 733 $output .= "<td>($data[1])</td> 734 <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td> 735 <td><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" /></td></tr>"; 736 } 737 738 if(count($quests_1)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "4" : "3")."\" align=\"left\"></th></tr>"; 739 foreach ($quests_1 as $data){ 740 $output .= "<tr>"; 741 if($user_lvl) $output .= "<td>$data[0]</td>"; 742 $output .= "<td>($data[1])</td> 743 <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td> 744 <td><img src=\"img/aff_tick.png\" width=\"14\" height=\"14\" /></td></tr>"; 745 } 746 747 } else $output .= "<tr><td colspan=\"".($user_lvl ? "4" : "3")."\"><p>{$lang_char['no_act_quests']}</p></td></tr>"; 748 749 $output .= "</table></div><br /> 750 <table class=\"hidden\"> 712 $char = $sql->fetch_row($result); 713 714 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 715 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'"); 716 $owner_gmlvl = $sql->result($result, 0, 'gmlevel'); 717 $owner_name = $sql->result($result, 0, 'username'); 718 719 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 720 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 721 722 $result = $sql->query("SELECT quest,status FROM character_queststatus WHERE guid =$id AND ( status = 3 OR status = 1 ) ORDER BY status DESC"); 723 724 $output .= "<center> 725 <div id=\"tab\"> 726 <ul> 727 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 728 <li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 729 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 730 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 731 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 732 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 733 if( get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 734 $output .= "</ul> 735 </div> 736 <div id=\"tab_content\"> 737 <font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])."</font><br /><br /> 738 739 <table class=\"lined\" style=\"width: 550px;\"> 740 <tr>"; 741 if ($user_lvl) $output .= "<th width=\"10%\"><a href=\"char.php?id=$id&action=char_quest&order_by=0&dir=$dir\">".($order_by==0 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_id']}</a></th>"; 742 $output .= "<th width=\"7%\"><a href=\"char.php?id=$id&action=char_quest&order_by=1&dir=$dir\">".($order_by==1 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_level']}</a></th> 743 <th width=\"78%\"><a href=\"char.php?id=$id&action=char_quest&order_by=2&dir=$dir\">".($order_by==2 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['quest_title']}</a></th> 744 <th width=\"5%\"><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" border=\"0\" /></a></th>"; 745 746 $quests_1 = array(); 747 $quests_3 = array(); 748 749 if ($sql->num_rows($result)){ 750 while ($quest = $sql->fetch_row($result)){ 751 $deplang = get_lang_id(); 752 $query1 = $sql->query("SELECT QuestLevel,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as Title FROM `".$mangos_db[$realm_id]['name']."`.`quest_template` LEFT JOIN `".$mangos_db[$realm_id]['name']."`.`locales_quest` ON `quest_template`.`entry` = `locales_quest`.`entry` WHERE `quest_template`.`entry` ='$quest[0]'"); 753 $quest_info = $sql->fetch_row($query1); 754 if($quest[1]==1) 755 array_push($quests_1, array($quest[0], $quest_info[0], $quest_info[1])); 756 else 757 array_push($quests_3, array($quest[0], $quest_info[0], $quest_info[1])); 758 } 759 aasort($quests_1, $order_by, $dir); 760 aasort($quests_3, $order_by, $dir); 761 762 foreach ($quests_3 as $data){ 763 $output .= "<tr>"; 764 if($user_lvl) $output .= "<td>$data[0]</td>"; 765 $output .= "<td>($data[1])</td> 766 <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td> 767 <td><img src=\"img/aff_qst.png\" width=\"14\" height=\"14\" /></td></tr>"; 768 } 769 770 if(count($quests_1)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "4" : "3")."\" align=\"left\"></th></tr>"; 771 foreach ($quests_1 as $data){ 772 $output .= "<tr>"; 773 if($user_lvl) $output .= "<td>$data[0]</td>"; 774 $output .= "<td>($data[1])</td> 775 <td align=\"left\"><a href=\"$quest_datasite$data[0]\" target=\"_blank\">$data[2]</a></td> 776 <td><img src=\"img/aff_tick.png\" width=\"14\" height=\"14\" /></td></tr>"; 777 } 778 779 } else $output .= "<tr><td colspan=\"".($user_lvl ? "4" : "3")."\"><p>{$lang_char['no_act_quests']}</p></td></tr>"; 780 781 $output .= "</table></div><br /> 782 <table class=\"hidden\"> 751 783 <tr><td>"; 752 if ($user_lvl > $owner_gmlvl) 753 { 754 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$char[0]",140); 755 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 756 } 757 if ( ($user_lvl) && (($user_lvl > $owner_gmlvl) || ($owner_name == $user_name)) ) 758 { 759 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 760 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 761 } 762 makebutton($lang_global['back'], "javascript:window.history.back()",140); 763 $output .= "</td></tr> 784 if ($user_lvl > $owner_gmlvl){ 785 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 786 $output .= "</td><td>"; 787 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 788 $output .= "</td><td>"; 789 } 790 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 791 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 792 $output .= "</td><td>"; 793 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 794 $output .= "</td><td>"; 795 } 796 makebutton($lang_global['back'], "javascript:window.history.back()",140); 797 $output .= "</td></tr> 764 798 </table><br /></center>"; 765 766 767 768 769 770 799 } 800 else 801 { 802 $sql->close(); 803 error($lang_char['no_permission']); 804 } 771 805 } 772 806 else error($lang_char['no_char_found']); … … 780 814 function char_rep() { 781 815 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 782 $user_name, $fact_id;816 $user_name, $fact_id, $reputation_rank_length, $reputation_cap, $reputation_bottom, $reputation_rank, $MIN_REPUTATION_RANK, $MAX_REPUTATION_RANK; 783 817 784 818 if (empty($_GET['id'])) error($lang_global['empty_fields']); … … 788 822 789 823 $id = $sql->quote_smart($_GET['id']); 790 $result = $sql->query("SELECT account,name,race,class FROM `characters` WHERE guid = '$id'LIMIT 1");824 $result = $sql->query("SELECT account,name,race,class FROM `characters` WHERE guid = $id LIMIT 1"); 791 825 792 826 if ($sql->num_rows($result)){ 793 $char = $sql->fetch_row($result); 794 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 795 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'"); 796 $owner_gmlvl = $sql->result($result, 0, 'gmlevel'); 797 $owner_name = $sql->result($result, 0, 'username'); 827 $char = $sql->fetch_row($result); 828 $race = $char[2]; 829 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 830 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$char[0]'"); 831 $owner_gmlvl = $sql->result($result, 0, 'gmlevel'); 832 $owner_name = $sql->result($result, 0, 'username'); 798 833 799 834 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 800 835 801 802 $result = $sql->query("SELECT faction, standing, flags FROM character_reputation WHERE guid ='$id' AND (flags = 1 OR flags = 17)");836 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 837 $result = $sql->query("SELECT faction, standing, flags FROM character_reputation WHERE guid =$id AND (flags & 1 = 1)"); 803 838 804 839 $output .= "<center> 805 840 <div id=\"tab\"> 806 841 <ul> 807 808 809 810 811 812 813 842 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 843 <li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 844 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 845 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 846 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 847 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 848 if( get_player_class($char[3]) == 'Hunter' ) { $output .= "<li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 814 849 $output .= " </ul> 815 850 </div> 816 851 <div id=\"tab_content\"> 817 852 <font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])."</font><br /><br />"; 818 853 819 854 require_once("scripts/fact_tab.php"); 820 855 821 856 $temp_out = array( 822 823 <tr><th colspan=\"2\" align=\"left\">Alliance</th></tr>",0),824 825 <tr><th colspan=\"2\" align=\"left\">Horde</th></tr>",0),826 827 <tr><th colspan=\"2\" align=\"left\">Battleground Forces - Alliance</th></tr>",0),828 829 <tr><th colspan=\"2\" align=\"left\">Battleground Forces - Horde</th></tr>",0),830 831 <tr><th colspan=\"2\" align=\"left\">Steamwheedle Cartel</th></tr>",0),832 833 <tr><th colspan=\"2\" align=\"left\">Outland</th></tr>",0),834 835 <tr><th colspan=\"2\" align=\"left\">Shattrath City</th></tr>",0),836 837 <tr><th colspan=\"2\" align=\"left\">Other</th></tr>",0),838 839 <tr><th colspan=\"2\" align=\"left\">Unknown</th></tr>",0)857 1 => array("<table class=\"lined\" style=\"width: 550px;\"> 858 <tr><th colspan=\"3\" align=\"left\">Alliance</th></tr>",0), 859 2 => array("<table class=\"lined\" style=\"width: 550px;\"> 860 <tr><th colspan=\"3\" align=\"left\">Horde</th></tr>",0), 861 3 => array("<table class=\"lined\" style=\"width: 550px;\"> 862 <tr><th colspan=\"3\" align=\"left\">Alliance Forces</th></tr>",0), 863 4 => array("<table class=\"lined\" style=\"width: 550px;\"> 864 <tr><th colspan=\"3\" align=\"left\">Horde Forces</th></tr>",0), 865 5 => array("<table class=\"lined\" style=\"width: 550px;\"> 866 <tr><th colspan=\"3\" align=\"left\">Steamwheedle Cartel</th></tr>",0), 867 6 => array("<table class=\"lined\" style=\"width: 550px;\"> 868 <tr><th colspan=\"3\" align=\"left\">Outland</th></tr>",0), 869 7 => array("<table class=\"lined\" style=\"width: 550px;\"> 870 <tr><th colspan=\"3\" align=\"left\">Shattrath City</th></tr>",0), 871 8 => array("<table class=\"lined\" style=\"width: 550px;\"> 872 <tr><th colspan=\"3\" align=\"left\">Other</th></tr>",0), 873 0 => array("<table class=\"lined\" style=\"width: 550px;\"> 874 <tr><th colspan=\"3\" align=\"left\">Unknown</th></tr>",0) 840 875 ); 841 842 if ($sql->num_rows($result)){ 843 while ($fact = $sql->fetch_row($result)){ 844 $temp_out[get_faction_tree($fact[0])][0] .= "<tr><td width=\"60%\">".get_faction_name($fact[0])."</td> 845 <td width=\"40%\">$fact[1]</td></tr>"; 846 $temp_out[get_faction_tree($fact[0])][1] = 1; 847 } 848 } else $output .= "<tr><td colspan=\"2\"><br /><br />{$lang_global['err_no_records_found']}<br /><br /></td></tr>"; 849 850 foreach ($temp_out as $out) if ($out[1]) $output .= $out[0]."</table>"; 851 852 $output .= "</div><br /> 853 <table class=\"hidden\"> 876 877 if ($sql->num_rows($result)) 878 { 879 while ($fact = $sql->fetch_row($result)) 880 { 881 $faction = $fact[0]; 882 $standing = $fact[1]; 883 884 $rep_rank = get_reputation_rank($faction, $standing, $race); 885 $rep_rank_name = $reputation_rank[$rep_rank]; 886 $rep_cap = $reputation_rank_length[$rep_rank]; 887 $rep = get_reputation_at_rank($faction, $standing, $race); 888 $faction_name = get_faction_name($faction); 889 890 $ft = get_faction_tree($faction); 891 892 // not show alliance rep for horde and vice versa: 893 if (!((((1 << ($race - 1)) & 690) && ($ft == 1 || $ft == 3)) || (((1 << ($race - 1)) & 1101) && ($ft == 2 || $ft == 4)))) 894 { 895 $temp_out[$ft][0] .= "<tr><td width=\"30%\" align=\"left\">$faction_name</td> 896 <td width=\"55%\" valign=\"top\"><div class=\"faction-bar\"><div class=\"rep$rep_rank\"><span class=\"rep-data\">$rep/$rep_cap</span><div class=\"bar-color\" style=\"width:".(100*$rep/$rep_cap)."%\"></div></div></div></td> 897 <td width=\"15%\" align=\"left\" class=\"rep$rep_rank\">$rep_rank_name</td></tr>"; 898 $temp_out[$ft][1] = 1; 899 } 900 } 901 } else $output .= "<tr><td colspan=\"2\"><br /><br />{$lang_global['err_no_records_found']}<br /><br /></td></tr>"; 902 903 foreach ($temp_out as $out) if ($out[1]) $output .= $out[0]."</table>"; 904 905 $output .= "</div><br /> 906 <table class=\"hidden\"> 854 907 <tr><td>"; 855 if ($user_lvl > $owner_gmlvl){ 856 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$char[0]",140); 857 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 858 } 859 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 860 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 861 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 862 } 863 makebutton($lang_global['back'], "javascript:window.history.back()",140); 864 $output .= "</td></tr> 908 if ($user_lvl > $owner_gmlvl){ 909 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 910 $output .= "</td><td>"; 911 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 912 $output .= "</td><td>"; 913 } 914 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 915 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 916 $output .= "</td><td>"; 917 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 918 $output .= "</td><td>"; 919 } 920 makebutton($lang_global['back'], "javascript:window.history.back()",140); 921 $output .= "</td></tr> 865 922 </table><br /></center>"; 866 923 867 924 } else { 868 869 870 925 $sql->close(); 926 error($lang_char['no_permission']); 927 } 871 928 872 929 } else error($lang_char['no_char_found']); … … 881 938 function char_skill() { 882 939 global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $user_lvl,$mangos_db, 883 940 $user_name, $skill_datasite; 884 941 885 942 if (empty($_GET['id'])) error($lang_global['empty_fields']); … … 893 950 $dir = ($dir) ? 0 : 1; 894 951 895 $result = $sql->query("SELECT account FROM `characters` WHERE guid = '$id'");952 $result = $sql->query("SELECT account FROM `characters` WHERE guid = $id"); 896 953 897 954 if ($sql->num_rows($result) == 1){ 898 899 900 901 902 955 $owner_acc_id = $sql->result($result, 0, 'account'); 956 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 957 $result = $sql->query("SELECT gmlevel,username FROM account WHERE id ='$owner_acc_id'"); 958 $owner_gmlvl = $sql->result($result, 0, 'gmlevel'); 959 $owner_name = $sql->result($result, 0, 'username'); 903 960 904 961 if (($user_lvl > $owner_gmlvl)||($owner_name == $user_name)){ 905 962 906 907 908 $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 `characters` WHERE guid = '$id'");909 910 911 912 913 914 915 916 917 918 919 920 921 if( get_player_class($char[3]) == 'Hunter' ) { $output .= "<li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; }922 923 924 925 926 927 <table class=\"lined\" style=\"width: 550px;\">928 929 930 931 932 933 934 935 963 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 964 965 $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 `characters` WHERE guid = $id"); 966 $char = $sql->fetch_row($result); 967 $char_data = explode(' ',$char[0]); 968 969 $output .= "<center> 970 <div id=\"tab\"> 971 <ul> 972 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 973 <li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 974 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 975 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 976 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 977 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 978 if( get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 979 $output .= " </ul> 980 </div> 981 <div id=\"tab_content\"> 982 <font class=\"bold\">$char[1] - ".get_player_race($char[2])." ".get_player_class($char[3])."</font><br /><br /> 983 984 <table class=\"lined\" style=\"width: 600px;\"> 985 <tr> 986 <th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['skills']}</th></tr> 987 <tr>" 988 .($user_lvl ? "<th><a href=\"char.php?id=$id&action=char_skill&order_by=0&dir=$dir\">".($order_by==0 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['skill_id']}</a></th>" : "") 989 ."<th align=\"right\"><a href=\"char.php?id=$id&action=char_skill&order_by=1&dir=$dir\">".($order_by==1 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['skill_name']}</a></th> 990 <th><a href=\"char.php?id=$id&action=char_skill&order_by=2&dir=$dir\">".($order_by==2 ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_char['skill_value']}</a></th> 991 </tr>"; 992 require_once("scripts/id_tab.php"); 936 993 937 994 $prof_1_array = array(); … … 940 997 941 998 $skill_rank_array = array( 942 943 944 945 946 947 948 949 999 75 => $lang_char['apprentice'], 1000 150 => $lang_char['journeyman'], 1001 225 => $lang_char['expert'], 1002 300 => $lang_char['artisan'], 1003 350 => $lang_char['master'], 1004 375 => $lang_char['inherent'], 1005 385 => $lang_char['wise'] 1006 ); 950 1007 951 1008 for ($i = CHAR_DATA_OFFSET_SKILL_DATA; $i <= CHAR_DATA_OFFSET_SKILL_DATA+384 ; $i+=3){ 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 1009 if (($char_data[$i])&&(get_skill_name($char_data[$i] & 0x0000FFFF ))){ 1010 $temp = unpack("S", pack("L", $char_data[$i+1])); 1011 $skill = ($char_data[$i] & 0x0000FFFF); 1012 1013 if( $skill == 185 || $skill == 129 || $skill == 356 || $skill == 762) 1014 { 1015 array_push($prof_2_array , array(($user_lvl ? $skill : ''), get_skill_name($skill), $temp[1])); 1016 } 1017 else if( $skill == 171 || $skill == 182 || $skill == 186 || 1018 $skill == 197 || $skill == 202 || $skill == 333 || 1019 $skill == 393 || $skill == 755 || $skill == 164 || 1020 $skill == 165) 1021 { 1022 array_push($prof_1_array , array(($user_lvl ? $skill : ''), get_skill_name($skill), $temp[1])); 1023 } 1024 else 1025 { 1026 array_push($skill_array , array(($user_lvl ? $skill : ''), get_skill_name($skill), $temp[1])); 1027 } 1028 } 972 1029 } 973 1030 unset($char_data); … … 978 1035 979 1036 foreach ($skill_array as $data){ 980 981 982 983 ."<td align=\"right\">$data[1]</td>984 985 986 987 988 1037 $max = ($data[2] < $char[4]*5) ? $char[4]*5 : $data[2]; 1038 $output .= "<tr>" 1039 .($user_lvl ? "<td>$data[0]</td>" : "") 1040 ." <td align=\"right\">$data[1]</td> 1041 <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\"> 1042 <span>$data[2]/$max</span> 1043 </td> 1044 </tr>"; 1045 } 989 1046 990 1047 if(count($prof_1_array)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['professions']} 1º</th></tr>"; 991 1048 foreach ($prof_1_array as $data){ 992 993 994 995 ."<td align=\"right\"><a href=\"{$skill_datasite}11.$data[0]\" target=\"_blank\">$data[1]</a></td>996 997 998 999 1049 $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)))))); 1050 $output .= "<tr>" 1051 .($user_lvl ? "<td>$data[0]</td>" : "") 1052 ." <td align=\"right\"><a href=\"{$skill_datasite}11.$data[0]\" target=\"_blank\">$data[1]</a></td> 1053 <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\"> 1054 <span>$data[2]/$max ({$skill_rank_array[$max]})</span> 1055 </td> 1056 </tr>"; 1000 1057 } 1001 1058 if(count($prof_2_array)) $output .= "<tr><th class=\"title\" colspan=\"".($user_lvl ? "3" : "2")."\" align=\"left\">{$lang_char['professions']} 2º</th></tr>"; 1002 1059 foreach ($prof_2_array as $data){ 1003 1004 1005 1006 ."<td align=\"right\"><a href=\"{$skill_datasite}9.$data[0]\" target=\"_blank\">$data[1]</a></td>1007 1008 1009 1010 1060 $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)))))); 1061 $output .= "<tr>" 1062 .($user_lvl ? "<td>$data[0]</td>" : "") 1063 ." <td align=\"right\"><a href=\"{$skill_datasite}9.$data[0]\" target=\"_blank\">$data[1]</a></td> 1064 <td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$data[2]/$max)-385)."px;\"> 1065 <span>$data[2]/$max ({$skill_rank_array[$max]})</span> 1066 </td> 1067 </tr>"; 1011 1068 } 1012 1013 1069 $output .= "</table></div><br /> 1070 <table class=\"hidden\"> 1014 1071 <tr><td>"; 1015 if ($user_lvl > $owner_gmlvl){ 1016 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1017 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1018 } 1019 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1020 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1021 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 1022 } 1023 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1024 $output .= "</td></tr> 1072 if ($user_lvl > $owner_gmlvl){ 1073 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1074 $output .= "</td><td>"; 1075 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1076 $output .= "</td><td>"; 1077 } 1078 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1079 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1080 $output .= "</td><td>"; 1081 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 1082 $output .= "</td><td>"; 1083 } 1084 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1085 $output .= "</td></tr> 1025 1086 </table><br /></center>"; 1026 1087 1027 1088 } else { 1028 1029 1030 1089 $sql->close(); 1090 error($lang_char['no_permission']); 1091 } 1031 1092 1032 1093 } else error($lang_char['no_char_found']); … … 1056 1117 $dir = ($dir) ? 0 : 1; 1057 1118 1058 $result = $sql->query("SELECT account FROM `characters` WHERE guid = '$id'");1119 $result = $sql->query("SELECT account FROM `characters` WHERE guid = $id"); 1059 1120 1060 1121 if ($sql->num_rows($result) == 1){ … … 1069 1130 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 1070 1131 1071 $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 `characters` WHERE guid = '$id'");1132 $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 `characters` WHERE guid = $id"); 1072 1133 $char = $sql->fetch_row($result); 1073 1134 $char_data = explode(' ',$char[0]); 1074 1135 1075 1136 $output .= "<center> 1076 1137 <div id=\"tab\"> 1077 1138 <ul> 1078 1139 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> … … 1082 1143 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 1083 1144 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li>"; 1084 if( get_player_class($char[3]) == 'Hunter' ) { $output .= "<li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; }1085 $output .= " 1145 if( get_player_class($char[3]) == 'Hunter' ) { $output .= " <li><a href=\"char.php?id=$id&action=char_pets\">{$lang_char['pets']}</a></li>"; } 1146 $output .= " </ul> 1086 1147 </div> 1087 1148 <div id=\"tab_content\"> … … 1094 1155 </tr>"; 1095 1156 1096 $result = $sql->query("SELECT spell FROM `character_spell` WHERE guid = '$id' AND active = '1'");1157 $result = $sql->query("SELECT spell FROM `character_spell` WHERE guid = $id AND active = 1"); 1097 1158 1098 1159 if ($sql->num_rows($result)){ … … 1103 1164 $output .= "<tr>"; 1104 1165 $output .= "<td>$talent[0]</td>"; 1105 1166 $output .= "<td align=left><a href=\"$talent_datasite$talent[0]\">".get_talent_name($talent[0])."</a></td>"; 1106 1167 if ($GMP) { $talent_sum = gmp_add($talent_sum,sprintf('%s',get_talent_value($talent[0]))); } 1107 1168 $output .= "</tr>"; … … 1137 1198 <table class=\"hidden\"> 1138 1199 <tr><td>"; 1139 if ($user_lvl > $owner_gmlvl){ 1140 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1141 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1142 } 1143 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1144 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1145 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 1146 } 1147 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1148 $output .= "</td></tr> 1200 if ($user_lvl > $owner_gmlvl){ 1201 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1202 $output .= "</td><td>"; 1203 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1204 $output .= "</td><td>"; 1205 } 1206 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1207 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1208 $output .= "</td><td>"; 1209 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 1210 $output .= "</td><td>"; 1211 } 1212 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1213 $output .= "</td></tr> 1149 1214 </table><br /></center>"; 1150 1215 … … 1173 1238 $id = $sql->quote_smart($_GET['id']); 1174 1239 1175 $result = $sql->query("SELECT account FROM `characters` WHERE guid = '$id'");1240 $result = $sql->query("SELECT account FROM `characters` WHERE guid = $id"); 1176 1241 1177 1242 if ($sql->num_rows($result) == 1){ … … 1186 1251 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 1187 1252 1188 $result = $sql->query("SELECT id,level,exp, nextlvlexp,loyaltypoints,loyalty,trainpoint,name,curhappiness,TeachSpelldata FROM `character_pet` WHERE owner = '$id'");1189 1190 1191 1192 1253 $result = $sql->query("SELECT id,level,exp,loyaltypoints,loyalty,trainpoint,name,curhappiness,TeachSpelldata FROM `character_pet` WHERE owner = $id"); 1254 1255 $output .= "<center> 1256 <div id=\"tab\"> 1257 <ul> 1193 1258 <li><a href=\"char.php?id=$id\">{$lang_char['char_sheet']}</a></li> 1194 1259 <li><a href=\"char.php?id=$id&action=char_inv\">{$lang_char['inventory']}</a></li> 1195 1260 <li><a href=\"char.php?id=$id&action=char_quest\">{$lang_char['quests']}</a></li> 1196 1261 <li><a href=\"char.php?id=$id&action=char_skill\">{$lang_char['skills']}</a></li> 1197 1198 1262 <li><a href=\"char.php?id=$id&action=char_talent\">{$lang_char['talents']}</a></li> 1263 <li><a href=\"char.php?id=$id&action=char_rep\">{$lang_char['reputation']}</a></li> 1199 1264 <li id=\"selected\"><a href=\"char.php?id=$id&action=char_pet\">{$lang_char['pets']}</a></li> 1200 1201 1202 1203 1204 1205 1206 $happiness = floor($pet[ 8]/333000);1265 </ul> 1266 </div> 1267 <div id=\"tab_content\">"; 1268 1269 if ($sql->num_rows($result)){ 1270 while($pet = $sql->fetch_row($result)){ 1271 $happiness = floor($pet[7]/333000); 1207 1272 1208 1273 switch ($happiness) { 1209 1274 case 3: 1210 1275 case 2: 1211 1276 $hap_text = "Happy"; 1212 1277 $hap_val = 2; 1213 1278 break; 1214 1279 case 1: 1215 1280 $hap_text = "Content"; 1216 1281 $hap_val = 1; 1217 1282 break; 1218 1283 default: 1219 1284 $hap_text = "Unhappy"; 1220 1285 $hap_val = 0; 1221 1286 } 1222 1223 1224 1225 $output .= " <font class=\"bold\">$pet[7] (lvl$pet[1])1226 1227 1228 1229 <tr><td align=right>Exp:</td><td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$pet[2]/$pet[3])-385)."px;\">1230 <span>$pet[2]/$pet[3]</span>1231 1232 <tr><td align=right>Loyalty:</td><td align=left>Level $pet[5] ($pet[4] pts)</td></tr>1233 <tr><td align=right>Training Points:</td><td align=left>$pet[6]</td></tr>";1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1287 1288 $pet_next_lvl_xp = floor(xp_to_level($pet[1])/4); 1289 1290 $output .= " <font class=\"bold\">$pet[6] (lvl$pet[1]) 1291 <a style=\"padding:2px;\" onmouseover=\"toolTip('<font color=\'white\'>$hap_text</font>','item_tooltip')\" onmouseout=\"toolTip()\"><img src=\"img/pet/happiness_$hap_val.jpg\"></a> 1292 <br /><br /></font> 1293 <table class=\"lined\" style=\"width: 550px;\"> 1294 <tr><td align=right>Exp:</td><td valign=\"top\" class=\"bar skill_bar\" style=\"background-position: ".(round(385*$pet[2]/$pet_next_lvl_xp)-385)."px;\"> 1295 <span>$pet[2]/$pet_next_lvl_xp</span> 1296 </td></tr> 1297 <tr><td align=right>Loyalty:</td><td align=left>Level $pet[4] ($pet[3] pts)</td></tr> 1298 <tr><td align=right>Training Points:</td><td align=left>$pet[5]</td></tr>"; 1299 $output .= "<tr><td align=right>Pet Abilities:</td><td align=left>"; 1300 $ability_results = $sql->query("SELECT spell FROM `pet_spell` WHERE guid = '$pet[0]'"); 1301 if ($sql->num_rows($ability_results)){ 1302 while ($ability = $sql->fetch_row($ability_results)){ 1303 if( isset($pet_ability[$ability[0]]) ) 1304 { 1305 $output .= "<a style=\"padding:2px;\" onmouseover=\"toolTip('<font color=\'white\'>".get_pet_ability_name($ability[0])."<br />Training Points: ".get_pet_ability_trainvalue($ability[0])."<br />Id: $ability[0]</font>','item_tooltip')\" onmouseout=\"toolTip()\" href=\"$talent_datasite$ability[0]\"><img src=\"img/pet/".get_pet_ability_image($ability[0])."\"></a>"; 1306 } 1307 } 1308 } 1309 $output .= "</td></tr>"; 1310 $output .= "</table><br /><br />"; 1311 } 1312 } 1313 1314 $output .= "</div> 1315 <table class=\"hidden\"> 1251 1316 <tr><td>"; 1252 if ($user_lvl > $owner_gmlvl){ 1253 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1254 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1255 } 1256 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1257 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1258 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[1]",140); 1259 } 1260 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1261 $output .= "</td></tr> 1317 if ($user_lvl > $owner_gmlvl){ 1318 makebutton($lang_char['chars_acc'], "user.php?action=edit_user&id=$owner_acc_id",140); 1319 $output .= "</td><td>"; 1320 makebutton($lang_char['edit_button'], "char_edit.php?id=$id",140); 1321 $output .= "</td><td>"; 1322 } 1323 if (($user_lvl > 0)&&(($user_lvl > $owner_gmlvl)||($owner_name == $user_name))){ 1324 makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&check%5B%5D=$id",140); 1325 $output .= "</td><td>"; 1326 makebutton($lang_char['send_mail'], "mail.php?type=ingame_mail&to=$char[0]",140); 1327 $output .= "</td><td>"; 1328 } 1329 makebutton($lang_global['back'], "javascript:window.history.back()",140); 1330 $output .= "</td></tr> 1262 1331 </table><br /></center>"; 1263 1332 } else { … … 1268 1337 $sql->close(); 1269 1338 } 1270 1271 1272 1273 1274 1275 1339 1276 1340 //########################################################################################################################
Note:
See TracChangeset
for help on using the changeset viewer.