Advertisement
Guest User

characterprofile

a guest
Jun 27th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 33.00 KB | None | 0 0
  1. <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
  2.  
  3. if ($config['log_ip']) {
  4.     znote_visitor_insert_detailed_data(4);
  5. }
  6.  
  7. if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
  8.     $name = getValue($_GET['name']);
  9.     $user_id = user_character_exist($name);
  10.    
  11.     if ($user_id !== false) {
  12.         $loadOutfits = $config['show_outfits']['characterprofile'];
  13.  
  14.         if ($config['ServerEngine'] == 'TFS_10') {
  15.             if (!$loadOutfits) {
  16.                 $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin');
  17.             } else { // Load outfits
  18.                 if ($config['client'] < 780) {
  19.                     $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype');
  20.                 } else {
  21.                     $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
  22.                 }
  23.             }
  24.             $profile_data['online'] = user_is_online_10($user_id);
  25.            
  26.             if ($config['Ach']) {
  27.                 $user_id = (int) $user_id;
  28.                 $achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`={$user_id} LIMIT 1");
  29.             }
  30.         } else { // TFS 0.2, 0.3
  31.             if (!$loadOutfits) {
  32.                 $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex');
  33.             } else { // Load outfits
  34.                 if ($config['ServerEngine'] !== 'OTHIRE') {
  35.                     if ($config['client'] < 780) {
  36.                         $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype');
  37.                     } else {
  38.                         $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
  39.                     }
  40.                 } else {
  41.                     $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype');
  42.                 }
  43.             }
  44.         }
  45.        
  46.         $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
  47.         $guild_exist = false;
  48.         if (get_character_guild_rank($user_id) > 0) {
  49.             $guild_exist = true;
  50.             $guild = get_player_guild_data($user_id);
  51.             $guild_name = get_guild_name($guild['guild_id']);
  52.         }
  53.         ?>
  54.  
  55.         <!-- PROFILE MARKUP HERE-->
  56.         <table id="characterProfileTable">
  57.             <thead>
  58.                 <tr class="yellow">
  59.                     <th>
  60.                         <?php if ($loadOutfits): ?>
  61.                             <div class="outfit">
  62.                                 <img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img">
  63.                             </div>
  64.                         <?php endif;
  65.                         $flags = $config['country_flags'];
  66.                         if ($flags['enabled'] && $flags['characterprofile']) {
  67.                             $account_data = user_znote_account_data($profile_data['account_id'], 'flag');
  68.                             if (strlen($account_data['flag']) > 0):
  69.                                 ?><!-- Player country data -->
  70.                                 <div class="flag">
  71.                                     <img src="<?php echo $flags['server'] . '/' . $account_data['flag']; ?>.png">
  72.                                 </div>
  73.                                 <?php
  74.                             endif;
  75.                         }
  76.                         ?>
  77.                     </th>
  78.                     <th>
  79.                         <h1><?php echo $profile_data['name']; ?></h1>
  80.                     </th>
  81.                 </tr>
  82.             </thead>
  83.             <tbody>
  84.                 <!-- Player Position -->
  85.                 <?php if ($profile_data['group_id'] > 1): ?>
  86.                     <tr>
  87.                         <td>Position</td>
  88.                         <td><?php echo group_id_to_name($profile_data['group_id']); ?></td>
  89.                     </tr>
  90.                 <?php endif; ?>
  91.                 <!-- Player male / female -->
  92.                 <tr>
  93.                     <td>Sex</td>
  94.                     <td><?php echo ($profile_data['sex'] == 1) ? 'Male' : 'Female'; ?></td>
  95.                 </tr>
  96.                 <!-- Player level -->
  97.                 <tr>
  98.                     <td>Level</td>
  99.                     <td><?php echo $profile_data['level']; ?></td>
  100.                 </tr>
  101.                 <!-- Player vocation -->
  102.                 <tr>
  103.                     <td>Vocation</td>
  104.                     <td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td>
  105.                 </tr>
  106.                 <!-- Player guild -->
  107.                 <?php if ($guild_exist): ?>
  108.                     <tr>
  109.                         <td>Guild</td>
  110.                         <td><b><?php echo $guild['rank_name']; ?> </b> of <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></td>
  111.                     </tr>
  112.                 <?php endif; ?>
  113.                 <!-- Player last login -->
  114.                 <tr>
  115.                     <td>Last Login</td>
  116.                     <td><?php echo ($profile_data['lastlogin'] != 0) ? getClock($profile_data['lastlogin'], true, true) : 'Never.'; ?></td>
  117.                 </tr>
  118.                 <!-- Achievement start -->
  119.                 <?php if ($config['Ach'] && (int)$achievementPoints['sum'] > 0): ?>
  120.                     <tr>
  121.                         <td>Achievement Points</td>
  122.                         <td><?php echo (int)$achievementPoints['sum']; ?></td>
  123.                     </tr>
  124.                 <?php endif; ?>
  125.                 <!-- Display house start -->
  126.                 <?php
  127.                 if ($config['ServerEngine'] !== 'TFS_02') {
  128.                     // Compatibility fix
  129.                     $column_town_id = array(
  130.                         'OTHIRE' => 'townid',
  131.                         'TFS_03' => 'town'
  132.                         // Default: town_id
  133.                     );
  134.                     $column_town_id = (isset($column_town_id[$config['ServerEngine']]))
  135.                     ? $column_town_id[$config['ServerEngine']]
  136.                     : 'town_id';
  137.  
  138.                     $houses = mysql_select_multi("
  139.                         SELECT `id`, `owner`, `name`, `{$column_town_id}` AS `town_id`
  140.                         FROM `houses`
  141.                         WHERE `owner` = {$user_id};
  142.                     ");
  143.                    
  144.                     if ($houses !== false) {
  145.                         foreach ($houses as $h): ?>
  146.                             <tr>
  147.                                 <td>House</td>
  148.                                 <td><?php echo $h['name'] . ', ' . $config['towns'][$h['town_id']]; ?></td>
  149.                             </tr>
  150.                         <?php endforeach;
  151.                     }
  152.                 }
  153.                 ?>
  154.                 <!-- Display player status -->
  155.                 <tr class="status_<?php echo ($profile_data['online']) ? 'online' : 'offline'; ?>">
  156.                     <td>Status</td>
  157.                     <td><?php echo ($profile_data['online']) ? 'online' : 'offline'; ?></td>
  158.                 </tr>
  159.                 <!-- Player created -->
  160.                 <tr>
  161.                     <td>Created</td>
  162.                     <td><?php echo getClock($profile_znote_data['created'], true); ?></td>
  163.                 </tr>
  164.                
  165.                 <!-- EQ shower -->
  166.                 <?php if ($config['EQ_shower']['enabled']): ?>
  167.                     <tr>
  168.                         <?php
  169.                         // Item image server
  170.                         $imageServer = $config['shop']['imageServer'];
  171.                         $imageType = $config['shop']['imageType'];
  172.                         $PEQ = mysql_select_multi("
  173.                             SELECT
  174.                                 `player_id`,
  175.                                 `pid`,
  176.                                 `itemtype`,
  177.                                 `count`
  178.                             FROM `player_items`
  179.                             WHERE `player_id`={$user_id}
  180.                             AND `pid`<'11'
  181.                         ");
  182.  
  183.                         $soulStamina = (in_array($config['ServerEngine'], ['TFS_10']))
  184.                             ? " `soul`, `stamina`,"
  185.                             : " `p`.`soul`, `p`.`stamina`,";
  186.                        
  187.                         if ($config['client'] < 780) {
  188.                             $soulStamina = " 0 AS `soul`, 0 AS `stamina`,";
  189.                         }
  190.  
  191.                         $player_query = (in_array($config['ServerEngine'], ['TFS_10']))
  192.                             ? /* true */ "SELECT
  193.                                     `health`, `healthmax`,
  194.                                     `mana`, `manamax`,
  195.                                     `cap`,
  196.                                     `experience`, `level`,
  197.                                     {$soulStamina}
  198.                                     `maglevel`,
  199.                                     `skill_fist`,
  200.                                     `skill_club`,
  201.                                     `skill_sword`,
  202.                                     `skill_axe`,
  203.                                     `skill_dist`,
  204.                                     `skill_shielding`,
  205.                                     `skill_fishing`
  206.                                 FROM `players`
  207.                                 WHERE `id`={$user_id}
  208.                                 LIMIT 1;"
  209.                             : /* false */ "SELECT
  210.                                     `p`.`health`, `p`.`healthmax`,
  211.                                     `p`.`mana`, `p`.`manamax`,
  212.                                     `p`.`cap`,
  213.                                     `p`.`experience`, `p`.`level`,
  214.                                     {$soulStamina}
  215.                                     `p`.`maglevel`,
  216.                                     `fist`.`value` AS `skill_fist`,
  217.                                     `club`.`value` AS `skill_club`,
  218.                                     `sword`.`value` AS `skill_sword`,
  219.                                     `axe`.`value` AS `skill_axe`,
  220.                                     `dist`.`value` AS `skill_dist`,
  221.                                     `shield`.`value` AS `skill_shielding`,
  222.                                     `fish`.`value` AS `skill_fishing`
  223.                                 FROM `players` AS `p`
  224.                                 LEFT JOIN `player_skills` AS `fist` ON `p`.`id` = `fist`.`player_id` AND `fist`.`skillid` = 0
  225.                                 LEFT JOIN `player_skills` AS `club` ON `p`.`id` = `club`.`player_id` AND `club`.`skillid` = 1
  226.                                 LEFT JOIN `player_skills` AS `sword` ON `p`.`id` = `sword`.`player_id` AND `sword`.`skillid` = 2
  227.                                 LEFT JOIN `player_skills` AS `axe` ON `p`.`id` = `axe`.`player_id` AND `axe`.`skillid` = 3
  228.                                 LEFT JOIN `player_skills` AS `dist` ON `p`.`id` = `dist`.`player_id` AND `dist`.`skillid` = 4
  229.                                 LEFT JOIN `player_skills` AS `shield` ON `p`.`id` = `shield`.`player_id` AND `shield`.`skillid` = 5
  230.                                 LEFT JOIN `player_skills` AS `fish` ON `p`.`id` = `fish`.`player_id` AND `fish`.`skillid` = 6
  231.                                 WHERE `p`.`id`= {$user_id}
  232.                                 LIMIT 1;";
  233.                         $playerstats = mysql_select_single($player_query);
  234.  
  235.                         $playerstats['experience'] = number_format($playerstats['experience'],0,'',',');
  236.                         $playerstats['stamina'] = number_format($playerstats['stamina']/60,2,':','');
  237.  
  238.                         $bar_length = 100;
  239.                         $bar_health = (int)($bar_length * ($playerstats['health'] / $playerstats['healthmax']));
  240.                         if ($playerstats['manamax'] > 0) {
  241.                             $bar_mana = (int)($bar_length * ($playerstats['mana'] / $playerstats['manamax']));
  242.                         }
  243.                         else {
  244.                             $bar_mana = 100;
  245.                         }
  246.                        
  247.                         $outfit_server = $config['show_outfits']['imageServer'];
  248.                         $outfit_storage = $config['EQ_shower']['storage_value'];
  249.  
  250.                         $male_outfits = array(
  251.                             [128,129,130,131,132],
  252.                             [133,134,143,144,145],
  253.                             [146,151,152,153,154],
  254.                             [251,268,273,278,289],
  255.                             [325,328,335,367,430],
  256.                             [432,463,465,472,512],
  257.                             //516,541,574,577,610,619,633,634,637,665,667,684,695,697,699,725,733,746,750,760,846,853,873,884,899
  258.                         );
  259.  
  260.                         $female_outfits = array(
  261.                             [136,137,138,139,140],
  262.                             [141,142,147,148,149],
  263.                             [150,155,156,157,158],
  264.                             [252,269,270,279,288],
  265.                             [324,329,336,366,431],
  266.                             [433,464,466,471,513],
  267.                             //514,542,575,578,618,620,632,635,636,664,666,683,694,696,698,724,732,745,749,759,845,852,874,885,900
  268.                         );
  269.  
  270.                         $featured_outfits = ($profile_data['sex'] == 1) ? $male_outfits : $female_outfits;
  271.                         $outfit_list = array();
  272.                         $outfit_rows = COUNT($featured_outfits);
  273.                         $outfit_columns = COUNT($featured_outfits[0]);
  274.  
  275.                         foreach ($featured_outfits as $row) {
  276.                             if (COUNT($row) > $outfit_columns) {
  277.                                 $outfit_columns = COUNT($row);
  278.                             }
  279.                             foreach ($row as $column) {
  280.                                 $outfit_list[] = $column;
  281.                             }
  282.                         }
  283.  
  284.                         $highest_outfit_id = MAX($outfit_list);
  285.                         $outfit_storage_max = $outfit_storage + $highest_outfit_id + 1;
  286.  
  287.                         $player_outfits = array();
  288.                         $storage_sql = mysql_select_multi("
  289.                             SELECT `key`, `value`
  290.                             FROM `player_storage`
  291.                             WHERE `player_id`={$user_id}
  292.                             AND `key` > {$outfit_storage}
  293.                             AND `key` < {$outfit_storage_max}
  294.                         ");
  295.                         if ($storage_sql !== false && !empty($storage_sql)) {
  296.                             foreach ($storage_sql as $row) {
  297.                                 $player_outfits[$row['key']] = $row['value'];
  298.                             }
  299.                         }
  300.  
  301.                         $aquired_outfits = array();
  302.                         foreach ($outfit_list as $outfit_id) {
  303.                             $outfit_key = $outfit_storage + $outfit_id;
  304.                             if (isset($player_outfits[$outfit_key]) && $player_outfits[$outfit_key] == 3) {
  305.                                 $aquired_outfits[$outfit_id] = true;
  306.                             }
  307.                         }
  308.                         ?>
  309.                         <td colspan="2" id="piv">
  310.                             <div id="piv_flex">
  311.  
  312.                                 <?php if ($config['EQ_shower']['equipment']): ?>
  313.                                     <div id="piv_i">
  314.                                         <img class="bg" src="/engine/img/outfit.png">
  315.                                         <div id="piv_lifebar"></div><div id="piv_lifetext"><span><?php echo $playerstats['health']; ?></span></div>
  316.                                         <div id="piv_manabar"></div><div id="piv_manatext"><span><?php echo $playerstats['mana']; ?></span></div>
  317.                                         <?php if ($PEQ !== false && !empty($PEQ)): foreach($PEQ as $item): ?>
  318.                                             <img class="itm itm-<?php echo $item['pid']; ?>"
  319.                                             src="<?php echo "http://{$imageServer}/".$item['itemtype'].".{$imageType}"; ?>">
  320.                                         <?php endforeach; endif; ?>
  321.                                         <span id="piv_cap">Cap:<br><?php echo $playerstats['cap']; ?></span>
  322.                                         <?php if ($loadOutfits): ?>
  323.                                             <div class="inventory_outfit">
  324.                                                 <img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img">
  325.                                             </div>
  326.                                         <?php endif;  ?>
  327.                                     </div>
  328.                                 <?php endif; ?>
  329.  
  330.                                 <?php if ($config['EQ_shower']['skills']): ?>
  331.                                     <div id="piv_s">
  332.                                         <img class="bg" src="/engine/img/skillsbackground.png">
  333.                                         <span id="s_exp" class="txt"><?php echo $playerstats['experience']; ?></span>
  334.                                         <span id="s_lvl" class="txt"><?php echo $playerstats['level']; ?></span>
  335.                                         <span id="s_hp" class="txt"><?php echo number_format($playerstats['health'],0,'',','); ?></span>
  336.                                         <span id="s_mp" class="txt"><?php echo number_format($playerstats['mana'],0,'',','); ?></span>
  337.                                         <span id="s_soul" class="txt"><?php echo $playerstats['soul']; ?></span>
  338.                                         <span id="s_cap" class="txt"><?php echo number_format($playerstats['cap'],0,'',','); ?></span>
  339.                                         <span id="s_stamina" class="txt"><?php echo $playerstats['stamina']; ?></span>
  340.                                         <span id="s_maglevel" class="txt"><?php echo $playerstats['maglevel']; ?></span>
  341.                                         <span id="s_skill_fist" class="txt"><?php echo $playerstats['skill_fist']; ?></span>
  342.                                         <span id="s_skill_club" class="txt"><?php echo $playerstats['skill_club']; ?></span>
  343.                                         <span id="s_skill_sword" class="txt"><?php echo $playerstats['skill_sword']; ?></span>
  344.                                         <span id="s_skill_axe" class="txt"><?php echo $playerstats['skill_axe']; ?></span>
  345.                                         <span id="s_skill_dist" class="txt"><?php echo $playerstats['skill_dist']; ?></span>
  346.                                         <span id="s_skill_shielding" class="txt"><?php echo $playerstats['skill_shielding']; ?></span>
  347.                                         <span id="s_skill_fishing" class="txt"><?php echo $playerstats['skill_fishing']; ?></span>
  348.                                     </div>
  349.                                 <?php endif; ?>
  350.  
  351.                                 <?php if ($config['EQ_shower']['outfits']): ?>
  352.                                     <div id="piv_o">
  353.                                         <div class="bg">
  354.                                             <div class="bg_t">
  355.                                                 <div class="t_m"></div>
  356.                                                 <div class="t_l"></div>
  357.                                                 <div class="t_r"></div>
  358.                                             </div>
  359.                                             <div class="bg_m">
  360.                                                 <div class="m_l"></div>
  361.                                                 <div class="m_m"></div>
  362.                                                 <div class="m_r"></div>
  363.                                             </div>
  364.                                             <div class="bg_b">
  365.                                                 <div class="b_m"></div>
  366.                                                 <div class="b_l"></div>
  367.                                                 <div class="b_r"></div>
  368.                                             </div>
  369.                                         </div>
  370.                                         <div id="piv_o_container">
  371.                                             <?php foreach ($featured_outfits as $row): foreach($row as $outfit_id): $g = (isset($aquired_outfits[$outfit_id])) ? "" : "grayimg"; ?>
  372.                                                 <img class="o <?php echo $g; ?>" src="<?php echo $outfit_server . "?id=" . $outfit_id; ?>&addons=3&head=0&body=0&legs=0&feet=0">
  373.                                             <?php endforeach; endforeach; ?>
  374.                                         </div>
  375.                                     </div>
  376.                                 <?php endif; ?>
  377.                             </div>
  378.  
  379.                             <!-- Inventory style positioning -->
  380.                             <style type="text/css">
  381.                                 #piv {
  382.                                     background-image: url("/engine/img/o/m_m.png");
  383.                                 }
  384.                                 #piv_flex {
  385.                                     display: flex;
  386.                                     flex-wrap: wrap;
  387.                                     /*align-items: center;*/
  388.                                     justify-content: space-between;
  389.                                     width: 100%;
  390.                                     font-family: Verdana,Geneva,sans-serif;
  391.                                     font-size: 7.0pt;
  392.                                     line-height: 1;
  393.                                     color: rgb(201,201,201);
  394.                                 }
  395.                                 #piv_i, #piv_s, #piv_o {
  396.                                     position: relative;
  397.                                 }
  398.  
  399.                                 #piv_i {
  400.                                     width: 126px;
  401.                                     height: 207px;
  402.                                 }
  403.                                 #piv_s {
  404.                                     width: 184px;
  405.                                     height: 232px;
  406.                                 }
  407.                                 #piv_o {
  408.                                     width: <?php echo 16 + $outfit_columns * 40; ?>px;
  409.                                     height: <?php echo 29 + $outfit_rows * 33; ?>px;
  410.                                 }
  411.                                 #piv_flex img {
  412.                                     position: absolute;
  413.                                 }
  414.                                 #piv_i .inventory_outfit {
  415.                                     position: absolute;
  416.                                     top: 130px;
  417.                                     left: -24px;
  418.                                 }
  419.                                 #piv_lifebar {
  420.                                     position: absolute;
  421.                                     border-radius: 6px;
  422.                                     top: 6px;
  423.                                     left: 14px;
  424.                                     height: 11px;
  425.                                     /*width: 95px;*/
  426.                                     width: <?php echo $bar_health; ?>px;
  427.                                     background-image: url("/engine/img/lifebarra.png");
  428.                                 }
  429.                                 #piv_manabar {
  430.                                     position: absolute;
  431.                                     border-radius: 6px;
  432.                                     top: 19px;
  433.                                     left: 14px;
  434.                                     height: 11px;
  435.                                     /*width: 95px;*/
  436.                                     width: <?php echo $bar_mana; ?>px;
  437.                                     background-image: url("/engine/img/manabar.png");
  438.                                 }
  439.                                 #piv_lifetext,
  440.                                 #piv_manatext {
  441.                                     position: absolute;
  442.                                     display: block;
  443.                                     left: 15px;
  444.                                     width: <?php echo $bar_length; ?>px;
  445.                                     text-align: center;
  446.                                 }
  447.                                 #piv_lifetext {
  448.                                     top: 7px;
  449.                                 }
  450.                                 #piv_manatext {
  451.                                     top: 20px;
  452.                                 }
  453.                                 #piv_lifetext span,
  454.                                 #piv_manatext span {
  455.                                     background-color: rgba(0,0,0,0.7);
  456.                                     border-radius: 3px;
  457.                                 }
  458.                                 #piv_flex .itm { background-image: url("/engine/img/bg.png"); }
  459.                                 #piv_flex .itm-1  { left: 48px; top: 39px; }
  460.                                 #piv_flex .itm-2  { left: 11px; top: 53px; }
  461.                                 #piv_flex .itm-3  { left: 85px; top: 53px; }
  462.                                 #piv_flex .itm-4  { left: 48px; top: 76px; }
  463.                                 #piv_flex .itm-5  { left: 85px; top: 90px; }
  464.                                 #piv_flex .itm-6  { left: 11px; top: 90px; }
  465.                                 #piv_flex .itm-7  { left: 48px; top: 113px; }
  466.                                 #piv_flex .itm-8  { left: 48px; top: 150px; }
  467.                                 #piv_flex .itm-9  { left: 11px; top: 127px; }
  468.                                 #piv_flex .itm-10 { left: 85px; top: 127px; }
  469.                                 #piv_cap {
  470.                                     position: absolute;
  471.                                     top: 162px;
  472.                                     left: 85px;
  473.                                     min-width: 32px;
  474.                                     text-align: center;
  475.                                 }
  476.  
  477.                                 #piv_s .txt {
  478.                                     position: absolute;
  479.                                 }
  480.                                 #s_exp              { right: 22px; top: 16px; }
  481.                                 #s_lvl              { right: 22px; top: 30px; }
  482.                                 #s_hp               { right: 22px; top: 44px; }
  483.                                 #s_mp               { right: 22px; top: 58px; }
  484.                                 #s_soul             { right: 22px; top: 71px; }
  485.                                 #s_cap              { right: 22px; top: 86px; }
  486.                                 #s_stamina          { right: 22px; top: 100px; }
  487.                                 #s_maglevel         { right: 22px; top: 114px; }
  488.                                 #s_skill_fist       { right: 22px; top: 132px; }
  489.                                 #s_skill_club       { right: 22px; top: 146px; }
  490.                                 #s_skill_sword      { right: 22px; top: 160px; }
  491.                                 #s_skill_axe        { right: 22px; top: 174px; }
  492.                                 #s_skill_dist       { right: 22px; top: 188px; }
  493.                                 #s_skill_shielding  { right: 22px; top: 202px; }
  494.                                 #s_skill_fishing    { right: 22px; top: 215px; }
  495.  
  496.                                 /* Dynamically render background container size for outfits */
  497.                                 #piv_o .bg {
  498.                                     width: inherit;
  499.                                     height: inherit;
  500.                                     position: absolute;
  501.                                     left: 0;
  502.                                     top: 0;
  503.                                 }
  504.                                 #piv_o .bg_t {
  505.                                     height: 21px;
  506.                                     width: 100%;
  507.                                 }
  508.                                 #piv_o .bg_m {
  509.                                     width: 100%;
  510.                                     height: <?php echo $outfit_rows * 33; ?>px;
  511.                                 }
  512.                                 #piv_o .t_l {
  513.                                     position: absolute;
  514.                                     left: 0;
  515.                                     top: 0;
  516.                                     background-image: url("/engine/img/o/t_l.png");
  517.                                     width: 8px;
  518.                                     height: 21px;
  519.                                 }
  520.                                 #piv_o .t_m {
  521.                                     position: absolute;
  522.                                     right: 0;
  523.                                     top: 0;
  524.                                     background-image: url("/engine/img/o/t_m.png");
  525.                                     width: 100%;
  526.                                     height: 21px;
  527.                                 }
  528.                                 #piv_o .t_r {
  529.                                     position: absolute;
  530.                                     right: 0;
  531.                                     top: 0;
  532.                                     background-image: url("/engine/img/o/t_r.png");
  533.                                     width: 50px;
  534.                                     height: 21px;
  535.                                 }
  536.                                 #piv_o .m_l {
  537.                                     background-image: url("/engine/img/o/m_l.png");
  538.                                     width: 8px;
  539.                                     height: inherit;
  540.                                     float: left;
  541.                                 }
  542.                                 #piv_o .m_m {
  543.                                     background-image: url("/engine/img/o/m_m.png");
  544.                                     width: calc(100% - 16px);
  545.                                     height: inherit;
  546.                                     float: left;
  547.                                 }
  548.                                 #piv_o .m_r {
  549.                                     background-image: url("/engine/img/o/m_r.png");
  550.                                     width: 8px;
  551.                                     height: inherit;
  552.                                     float: left;
  553.                                 }
  554.                                 #piv_o .b_l {
  555.                                     position: absolute;
  556.                                     left: 0;
  557.                                     bottom: 0;
  558.                                     background-image: url("/engine/img/o/b_l.png");
  559.                                     width: 8px;
  560.                                     height: 8px;
  561.                                 }
  562.                                 #piv_o .b_m {
  563.                                     position: absolute;
  564.                                     right: 0;
  565.                                     bottom: 0;
  566.                                     background-image: url("/engine/img/o/b_m.png");
  567.                                     width: 100%;
  568.                                     height: 8px;
  569.                                 }
  570.                                 #piv_o .b_r {
  571.                                     position: absolute;
  572.                                     right: 0;
  573.                                     bottom: 0;
  574.                                     background-image: url("/engine/img/o/b_r.png");
  575.                                     width: 8px;
  576.                                     height: 8px;
  577.                                 }
  578.  
  579.                                 /* Render outfit player sprites */
  580.                                 #piv_o_container {
  581.                                     height: inherit;
  582.                                     width: inherit;
  583.                                 }
  584.                                 #piv_o_container .o {
  585.                                     position: absolute;
  586.                                     right: 0;
  587.                                     bottom: 0;
  588.                                 }
  589.  
  590.                                 /* Outfit column positions */
  591.                                 <?php for ($column = 1; $column <= $outfit_columns; $column++): ?>
  592.                                     #piv_o_container .o:nth-child(<?php echo $outfit_columns.'n+'.$column;?>) { right: <?php echo 10 + 40 * ($outfit_columns-$column); ?>px;  }
  593.                                 <?php endfor; ?>
  594.  
  595.                                 /* Outfit row positions */
  596.                                 <?php for ($row = 1; $row <= $outfit_rows; $row++): ?>
  597.                                     #piv_o_container .o:nth-child(n+<?php echo $outfit_columns * ($row-1)+1; ?>):nth-child(-n+<?php echo $outfit_columns*$row; ?>) { bottom: <?php echo 10 + 33 * ($outfit_rows-$row); ?>px;  }
  598.                                 <?php endfor; ?>
  599.  
  600.                                 #piv_o_container .o.grayimg {
  601.                                     filter: none;
  602.                                     -webkit-filter: grayscale(100%);
  603.                                     -moz-filter: grayscale(100%);
  604.                                     -ms-filter: grayscale(100%);
  605.                                     -o-filter: grayscale(100%);
  606.                                     opacity: .5;
  607.                                     filter: alpha(opacity=50);
  608.                                     margin-left: -25pt;
  609.                                     margin-top: -25px;
  610.                                 }
  611.                             </style>
  612.                         </td>
  613.                     </tr>
  614.                 <?php endif; ?>
  615.                 <!-- End EQ shower -->
  616.             </tbody>
  617.         </table>
  618.  
  619.         <!-- Player Comment -->
  620.         <?php if (!empty($profile_znote_data['comment'])): ?>
  621.             <table class="comment">
  622.                 <thead>
  623.                     <tr class="yellow">
  624.                         <td><font class="profile_font" name="profile_font_comment">Comment:</font></td>
  625.                     </tr>
  626.                 </thead>
  627.                 <tbody>
  628.                     <tr>
  629.                         <td><?php echo preg_replace('/\v+|\\\r\\\n/','<br/>',$profile_znote_data['comment']); ?></td>
  630.                     </tr>
  631.                 </tbody>
  632.             </table>
  633.         <?php endif; ?>
  634.  
  635.         <!-- Achievements start -->
  636.         <?php if ($config['Ach']):
  637.             $achievements = mysql_select_multi("
  638.                 SELECT `player_id`, `value`, `key`
  639.                 FROM `player_storage`
  640.                 WHERE `player_id`='$user_id'
  641.                 AND `key` LIKE '30___';
  642.             ");
  643.             $c_achs = $config['achievements'];
  644.             $toggle = array(
  645.                 'show' => '<a href="#show">Show</a>',
  646.                 'hide' => '<a href="#hide">Hide</a>'
  647.             );
  648.             if ($achievements !== false): ?>
  649.                 <h3>Achievements: <label id="ac_label_hide" for="ac_toggle_hide"><?php echo $toggle['show']; ?></label></h3>
  650.                 <!-- <div id="accordion">
  651.                     <h3>Show/hide player achievements</h3>
  652.                     <div>
  653.                        
  654.                     </div>
  655.                 </div><br> -->
  656.                 <input type="checkbox" id="ac_toggle_hide" name="ac_toggle_hide">
  657.                 <table class="achievements">
  658.                     <thead>
  659.                         <tr>
  660.                             <th>Name</th>
  661.                             <th>Description</th>
  662.                             <th>Points</th>
  663.                         </tr>
  664.                     </thead>
  665.                     <tbody>
  666.                         <?php foreach($achievements as $a): ?>
  667.                             <tr>
  668.                                 <td><?php echo $c_achs[$a['key']][0]; ?></td>
  669.                                 <td><?php echo $c_achs[$a['key']][1]; ?></td>
  670.                                 <td><?php echo $a['value']; ?></td>
  671.                             </tr>
  672.                         <?php endforeach; ?>
  673.                     </tbody>
  674.                 </table>
  675.                 <style type="text/css">
  676.                     table.achievements,
  677.                     #ac_toggle_hide {
  678.                         display: none;
  679.                     }
  680.                     #ac_toggle_hide:checked + table.achievements {
  681.                         display: table;
  682.                     }
  683.                 </style>
  684.                 <script type="text/javascript">
  685.                     document.getElementById("ac_label_hide").addEventListener("click", function(event){
  686.                         event.preventDefault();
  687.                         if (document.getElementById("ac_label_hide").innerHTML == "<?php echo str_replace('"', '\"', $toggle['show']); ?>") {
  688.                             document.getElementById("ac_label_hide").innerHTML = "<?php echo str_replace('"', '\"', $toggle['hide']); ?>";
  689.                             document.getElementById("ac_toggle_hide").checked = true;
  690.                         } else {
  691.                             document.getElementById("ac_label_hide").innerHTML = "<?php echo str_replace('"', '\"', $toggle['show']); ?>";
  692.                             document.getElementById("ac_toggle_hide").checked = false;
  693.                         }
  694.                     });
  695.                 </script>
  696.             <?php endif; ?>
  697.         <?php endif; ?>
  698.        
  699.         <!-- DEATH LIST -->
  700.         <table class="deathlist">
  701.             <thead>
  702.                 <tr class="yellow">
  703.                     <th colspan="2">Death List</th>
  704.                 </tr>
  705.             </thead>
  706.             <tbody>
  707.                 <?php
  708.                 if ($config['ServerEngine'] == 'TFS_10') {
  709.                     $deaths = mysql_select_multi("
  710.                         SELECT
  711.                             `player_id`,
  712.                             `time`,
  713.                             `level`,
  714.                             `killed_by`,
  715.                             `is_player`,
  716.                             `mostdamage_by`,
  717.                             `mostdamage_is_player`,
  718.                             `unjustified`,
  719.                             `mostdamage_unjustified`
  720.                         FROM `player_deaths`
  721.                         WHERE `player_id`=$user_id
  722.                         ORDER BY `time` DESC
  723.                         LIMIT 10;
  724.                     ");
  725.  
  726.                     if ($deaths) {
  727.                         foreach ($deaths as $d) {
  728.                             $lasthit = ($d['is_player'])
  729.                             ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>"
  730.                             : $d['killed_by'];
  731.  
  732.                             ?>
  733.                             <tr>
  734.                                 <td><?php echo getClock($d['time'], true, true); ?></td>
  735.                                 <td>
  736.                                     <?php
  737.                                     echo "Killed at level ".$d['level']." by {$lasthit}";
  738.                                     if ($d['unjustified']) {
  739.                                         echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
  740.                                     }
  741.                                     $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
  742.                                     if ($mostdmg) {
  743.                                         $mostdmg = ($d['mostdamage_is_player'])
  744.                                         ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>"
  745.                                         : $d['mostdamage_by'];
  746.                                        
  747.                                         echo "<br>and by $mostdmg.";
  748.                                        
  749.                                         if ($d['mostdamage_unjustified']) {
  750.                                             echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
  751.                                         }
  752.                                     } else {
  753.                                         echo " <b>(soloed)</b>";
  754.                                     }
  755.                                     ?>
  756.                                 </td>
  757.                             </tr>
  758.                             <?php
  759.                         }
  760.                     } else {
  761.                         ?>
  762.                         <tr>
  763.                             <td colspan="2">This player has never died.</td>
  764.                         </tr>
  765.                         <?php
  766.                     }
  767.                 } elseif ($config['ServerEngine'] == 'TFS_02') {
  768.                     $array = user_fetch_deathlist($user_id);
  769.                     if ($array) {
  770.                         foreach ($array as $value):
  771.                             if ($value['is_player'] == 1) {
  772.                                 $value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
  773.                             } else {
  774.                                 $value['killed_by'] = 'monster: '. $value['killed_by'] .'.';
  775.                             }
  776.                             ?>
  777.                             <tr>
  778.                                 <td><?php echo getClock($value['time'], true, true); ?></td>
  779.                                 <td><?php echo 'Killed at level '. $value['level'] .' by '. $value['killed_by']; ?></td>
  780.                             </tr>
  781.                         <?php endforeach;
  782.                     } else {
  783.                         ?>
  784.                         <tr>
  785.                             <td colspan="2">This player has never died.</td>
  786.                         </tr>
  787.                         <?php
  788.                     }
  789.                 } elseif (in_array($config['ServerEngine'], array('TFS_03', 'OTHIRE'))) {
  790.                     //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
  791.                     $array = user_fetch_deathlist03($user_id);
  792.                     if ($array) {
  793.                         // Design and present the list
  794.                         foreach ($array as $value):
  795.                             $value[3] = user_get_killer_id(user_get_kid($value['id']));
  796.                             if ($value[3] !== false && $value[3] >= 1) {
  797.                                 $namedata = user_character_data((int)$value[3], 'name');
  798.                                 if ($namedata !== false) {
  799.                                     $value[3] = $namedata['name'];
  800.                                     $value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
  801.                                 } else {
  802.                                     $value[3] = 'deleted player.';
  803.                                 }
  804.                             } else {
  805.                                 $value[3] = user_get_killer_m_name(user_get_kid($value['id']));
  806.                                 if ($value[3] === false) {
  807.                                     $value[3] = 'deleted player.';
  808.                                 }
  809.                             }
  810.                             ?>
  811.                             <tr>
  812.                                 <td><?php echo getClock($value['date'], true, true); ?></td>
  813.                                 <td><?php echo 'Killed at level '. $value['level'] .' by '. $value[3]; ?></td>
  814.                             </tr>
  815.                         <?php endforeach;
  816.                     } else {
  817.                         ?>
  818.                         <tr>
  819.                             <td colspan="2">This player has never died.</td>
  820.                         </tr>
  821.                         <?php
  822.                     }
  823.                 }
  824.                 ?>
  825.             </tbody>
  826.         </table>
  827.        
  828.         <!-- QUEST PROGRESSION -->
  829.         <?php
  830.         $totalquests = 0;
  831.         $completedquests = 0;
  832.         $firstrun = 1;
  833.        
  834.         if ($config['EnableQuests'] == true) {
  835.             $sqlquests =  mysql_select_multi("
  836.                 SELECT `player_id`, `key`, `value`
  837.                 FROM player_storage
  838.                 WHERE `player_id` = {$user_id}
  839.             ");
  840.             if (isset($config['quests']) && !empty($config['quests'])) {
  841.                 foreach ($config['quests'] as $cquest) {
  842.                     $totalquests = $totalquests + 1;
  843.                     foreach ($sqlquests as $dbquest) {
  844.                         if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
  845.                             $completedquests = $completedquests + 1;
  846.                         }
  847.                     }
  848.                     if ($cquest[3] == 1) {
  849.                         if ($completedquests != 0) {
  850.                             if ($firstrun == 1): ?>
  851.                                 <b> Quest progression </b>
  852.                                 <table id="characterprofileQuest" class="table table-striped table-hover">
  853.                                     <thead>
  854.                                         <tr class="yellow">
  855.                                             <th>Quest:</th>
  856.                                             <th>progression:</th>
  857.                                         </tr>
  858.                                     </thead>
  859.                                     <tbody>
  860.                                 <?php
  861.                                 $firstrun = 0;
  862.                             endif;
  863.                             $completed = $completedquests / $totalquests * 100;
  864.                             ?>
  865.                             <tr>
  866.                                 <td><?php echo $cquest[2]; ?></td>
  867.                                 <td id="progress">
  868.                                     <span id="percent"><?php echo round($completed); ?>%</span>
  869.                                     <div id="bar" style="width: '.$completed.'%"></div>
  870.                                 </td>
  871.                             </tr>
  872.                             <?php
  873.                         }
  874.                         $completedquests = 0;
  875.                         $totalquests = 0;
  876.                     }
  877.                 }
  878.             }
  879.         }
  880.        
  881.         if ($firstrun == 0): ?>
  882.             </tbody></table>
  883.         <?php endif; ?>
  884.         <!-- END QUEST PROGRESSION -->
  885.  
  886.         <!-- CHARACTER LIST -->
  887.         <?php
  888.         if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1)
  889.         {
  890.         ?>
  891.             <li>
  892.                 <b>Other visible characters on this account:</b><br>
  893.                 <?php
  894.                 $characters = user_character_list(user_character_account_id($profile_data['name']));
  895.                 // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
  896.                 if ($characters && count($characters) > 0) {
  897.                     ?>
  898.                     <table id="characterprofileTable" class="table table-striped table-hover">
  899.                         <tr class="yellow">
  900.                             <th>Name:</th>
  901.                             <th>Level:</th>
  902.                             <th>Vocation:</th>
  903.                             <th>Last login:</th>
  904.                             <th>Status:</th>
  905.                         </tr>
  906.                        
  907.                         <?php
  908.                         // Design and present the list
  909.                         foreach ($characters as $char) {
  910.                             if ($char['name'] != $profile_data['name']) {
  911.                                 if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden'): ?>
  912.                                     <tr>
  913.                                         <td><a href="characterprofile.php?name=<?php echo $char['name']; ?>"><?php echo $char['name']; ?></a></td>
  914.                                         <td><?php echo (int)$char['level']; ?></td>
  915.                                         <td><?php echo $char['vocation']; ?></td>
  916.                                         <td><?php echo $char['lastlogin']; ?></td>
  917.                                         <td><?php echo $char['online']; ?></td>
  918.                                     </tr>
  919.                                 <?php endif;
  920.                             }
  921.                         }
  922.                     ?>
  923.                     </table>
  924.                     <?php
  925.                 }/* else {
  926.                     echo '<b><font color="green">This player has never died.</font></b>';
  927.                 }*/
  928.                 ?>
  929.             </li>
  930.         <?php
  931.         }
  932.         ?>
  933.         <!-- END CHARACTER LIST -->
  934.        
  935.         <p class="address">Address: <a href="<?php echo ($config['htwrite']) ? "//" . $_SERVER['HTTP_HOST']."/" . $profile_data['name'] : "//" . $_SERVER['HTTP_HOST'] . "/characterprofile.php?name=" . $profile_data['name']; ?>"><?php echo ($config['htwrite']) ? $_SERVER['HTTP_HOST']."/". $profile_data['name'] : $_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name']; ?></a></p>
  936.        
  937.         <?php
  938.     } else {
  939.         echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
  940.     }
  941. } else {
  942.     header('Location: index.php');
  943. }
  944. include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement