Guest User

characterprofile.php

a guest
May 22nd, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 27.53 KB | None | 0 0
  1. <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
  2. if ($config['log_ip']) {
  3.     znote_visitor_insert_detailed_data(4);
  4. }
  5. if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
  6.     $name = $_GET['name'];
  7.     $user_id = user_character_exist($name);
  8.     if ($user_id !== false) {
  9.         if ($config['TFSVersion'] == 'TFS_10') {
  10.             $profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'sex');
  11.             $profile_data['online'] = user_is_online_10($user_id);
  12.             if ($config['Ach'] == true) {
  13.                 $achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`='$user_id'");
  14.             }
  15.         } else $profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'online', 'sex');
  16.         $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
  17.        
  18.         $guild_exist = false;
  19.         if (get_character_guild_rank($user_id) > 0) {
  20.             $guild_exist = true;
  21.             $guild = get_player_guild_data($user_id);
  22.             $guild_name = get_guild_name($guild['guild_id']);
  23.         }
  24.        
  25.         ?>
  26.        
  27.         <!-- show set -->
  28. <?php
  29. /*/
  30. /   Player character profile EQ shower
  31. /   Based on code from CorneX
  32. /   Written to Znote AAC by Znote.
  33. /   Should work on all TFS versions.
  34. /   Znote AAC 1.4+
  35. /*/
  36.  
  37. // Item image server
  38. $imageServer = $config['shop']['imageServer'];
  39. $imageType = $config['shop']['imageType'];
  40. if (count($imageType) < 3) $imageType = 'gif';
  41. // Fetch player equipped data
  42. $PEQD = mysql_select_multi("SELECT `player_id`, `pid`, `itemtype`, `count` FROM `player_items` WHERE `player_id`='$user_id' AND `pid`<'11'");
  43. // If player have equipped items
  44. if ($PEQD !== false) {
  45.     // PEQD = Player EQ Data
  46.     $PEQ = array(
  47.         1 => false,
  48.         2 => false,
  49.         3 => false,
  50.         4 => false,
  51.         5 => false,
  52.         6 => false,
  53.         7 => false,
  54.         8 => false,
  55.         9 => false,
  56.         10 => false,
  57.     );
  58.     // Fill player equipments array with fetched data results (PEQD)
  59.     foreach ($PEQD as $EQ) $PEQ[$EQ['pid']] = "http://{$imageServer}/".$EQ['itemtype'].".{$imageType}";
  60.     ?>
  61.     <!-- Fix item positions CSS -->
  62.     <style type="text/css">
  63.     /* CSS by CorneX */
  64.     .signBgrnd {
  65.         background-image:url('eq/outfit.png');
  66.         background-repeat:no-repeat;
  67.         position:relative;
  68.         float: right;
  69.         margin:10px;
  70.         padding:10px;
  71.         height:153px;
  72.         width:118px;
  73.     }
  74.     /* Weapon */
  75.     .signBgrnd .wep {
  76.         position: absolute;
  77.         top: 56px;
  78.         left: 6px;
  79.         width: 32px;
  80.         height: 32px;
  81.     }
  82.     .signBgrnd .wep img {
  83.         background-image:url('eq/bg.png');
  84.         max-width: 100%;
  85.     }
  86.     /* Armor */
  87.     .signBgrnd .arm {
  88.         position: absolute;
  89.         top: 41px;
  90.         left: 43px;
  91.         width: 32px;
  92.         height: 32px;
  93.     }
  94.     .signBgrnd .arm img {
  95.         background-image:url('eq/bg.png');
  96.         max-width: 100%;
  97.     }
  98.     /* Helmet */
  99.     .signBgrnd .helm {
  100.         position: absolute;
  101.         top: 5px;
  102.         left: 43px;
  103.         width: 32px;
  104.         height: 32px;
  105.     }
  106.     .signBgrnd .helm img {
  107.         background-image:url('eq/bg.png');
  108.         max-width: 100%;
  109.     }
  110.     /* legs */
  111.     .signBgrnd .legs {
  112.         position: absolute;
  113.         top: 79px;
  114.         left: 43px;
  115.         width: 32px;
  116.         height: 32px;
  117.     }
  118.     .signBgrnd .legs img {
  119.         background-image:url('eq/bg.png');
  120.         max-width: 100%;
  121.     }
  122.     /* boots */
  123.     .signBgrnd .boots {
  124.         position: absolute;
  125.         top: 116px;
  126.         left: 43px;
  127.         width: 32px;
  128.         height: 32px;
  129.     }
  130.     .signBgrnd .boots img {
  131.         background-image:url('eq/bg.png');
  132.         max-width: 100%;
  133.     }
  134.     /* ring */
  135.     .signBgrnd .ring {
  136.         position: absolute;
  137.         top: 93px;
  138.         left: 6px;
  139.         width: 32px;
  140.         height: 32px;
  141.     }
  142.     .signBgrnd .ring img {
  143.         background-image:url('eq/bg.png');
  144.         max-width: 100%;
  145.     }
  146.     /* amulet */
  147.     .signBgrnd .amulet {
  148.         position: absolute;
  149.         top: 20px;
  150.         left: 7px;
  151.         width: 32px;
  152.         height: 32px;
  153.     }
  154.     .signBgrnd .amulet img {
  155.         background-image:url('eq/bg.png');
  156.         max-width: 100%;
  157.     }
  158.     /* backpack */
  159.     .signBgrnd .backpack {
  160.         position: absolute;
  161.         top: 20px;
  162.         left: 80px;
  163.         width: 32px;
  164.         height: 32px;
  165.     }
  166.     .signBgrnd .backpack img {
  167.         background-image:url('eq/bg.png');
  168.         max-width: 100%;
  169.     }
  170.     /* shield */
  171.     .signBgrnd .shield {
  172.         position: absolute;
  173.         top: 56px;
  174.         left: 80px;
  175.         width: 32px;
  176.         height: 32px;
  177.     }
  178.     .signBgrnd .shield img {
  179.         background-image:url('eq/bg.png');
  180.         max-width: 100%;
  181.     }
  182.     /* arrow */
  183.     .signBgrnd .arrow {
  184.        position: absolute;
  185.        top: 93px;
  186.        left: 80px;
  187.        width: 32px;
  188.        height: 32px;
  189.     }
  190.     .signBgrnd .arrow img {
  191.         background-image:url('eq/bg.png');
  192.         max-width: 100%;
  193.     }
  194.     </style>
  195.     <!-- Render HTML -->
  196.     <div class="signBgrnd">
  197.         <div class="helm">
  198.             <?php
  199.             if ($PEQ[1] != false) {
  200.                 ?>
  201.                 <img src="<?php echo $PEQ[1]; ?>" alt="Image of player helmet">
  202.                 <?php
  203.             }
  204.             ?>
  205.         </div>
  206.         <div class="amulet">
  207.             <?php
  208.             if ($PEQ[2] != false) {
  209.                 ?>
  210.                 <img src="<?php echo $PEQ[2]; ?>" alt="Image of player amulet">
  211.                 <?php
  212.             }
  213.             ?>
  214.         </div>
  215.         <div class="wep">
  216.             <?php
  217.             if ($PEQ[6] != false) {
  218.                 ?>
  219.                 <img src="<?php echo $PEQ[6]; ?>" alt="Image of player left hand">
  220.                 <?php
  221.             }
  222.             ?>
  223.         </div>
  224.         <div class="ring">
  225.             <?php
  226.             if ($PEQ[9] != false) {
  227.                 ?>
  228.                 <img src="<?php echo $PEQ[9]; ?>" alt="Image of player ring">
  229.                 <?php
  230.             }
  231.             ?>
  232.         </div>
  233.         <div class="arm">
  234.             <?php
  235.             if ($PEQ[4] != false) {
  236.                 ?>
  237.                 <img src="<?php echo $PEQ[4]; ?>" alt="Image of player armor">
  238.                 <?php
  239.             }
  240.             ?>
  241.         </div>
  242.         <div class="legs">
  243.             <?php
  244.             if ($PEQ[7] != false) {
  245.                 ?>
  246.                 <img src="<?php echo $PEQ[7]; ?>" alt="Image of player legs">
  247.                 <?php
  248.             }
  249.             ?>
  250.         </div>
  251.         <div class="boots">
  252.             <?php
  253.             if ($PEQ[8] != false) {
  254.                 ?>
  255.                 <img src="<?php echo $PEQ[8]; ?>" alt="Image of player boots">
  256.                 <?php
  257.             }
  258.             ?>
  259.         </div>
  260.         <div class="backpack">
  261.             <?php
  262.             if ($PEQ[3] != false) {
  263.                 ?>
  264.                 <img src="<?php echo $PEQ[3]; ?>" alt="Image of player backpack">
  265.                 <?php
  266.             }
  267.             ?>
  268.         </div>
  269.         <div class="shield">
  270.             <?php
  271.             if ($PEQ[5] != false) {
  272.                 ?>
  273.                 <img src="<?php echo $PEQ[5]; ?>" alt="Image of player shield">
  274.                 <?php
  275.             }
  276.             ?>
  277.         </div>
  278.         <div class="arrow">
  279.             <?php
  280.             if ($PEQ[10] != false) {
  281.                 ?>
  282.                 <img src="<?php echo $PEQ[10]; ?>" alt="Image of player arrow">
  283.                 <?php
  284.             }
  285.             ?>
  286.         </div>
  287.     </div>
  288.     <?php
  289. }
  290. ?>    <!-- END EQ SHOWER -->
  291.         <!-- end show set -->
  292.        
  293.         <!-- PROFILE MARKUP HERE-->
  294.             <h1><font class="profile_font" name="profile_font_header"><b>Profile:</b> <?php echo $profile_data['name']; ?></font></h1>
  295.             <ul class="unstyled">
  296.                 <li><font class="profile_font" name="profile_font_level"><b>Country: </b><?php
  297.                     echo $profile_data['flag'];
  298.                 ?></font></li>
  299.                 <li><font class="profile_font" name="profile_font_level"><b>Marriage: </b><?php
  300.                     echo $profile_data['marriage'];
  301.                 ?></font></li>
  302.                 <li><font class="profile_font" name="profile_font_level"><b>Sex: </b><?php
  303.                 if ($profile_data['sex'] == 1) {
  304.                 echo 'Male';
  305.                 } else {
  306.                 echo 'Female';
  307.                 }
  308.                 ?></font></li>
  309.                 <li><font class="profile_font" name="profile_font_level"><b>Level:</b> <?php echo $profile_data['level']; ?></font></li>
  310.                 <li><font class="profile_font" name="profile_font_vocation"><b>Vocation:</b> <?php echo vocation_id_to_name($profile_data['vocation']); ?></font></li>
  311.                 <?php
  312.                 if ($guild_exist) {
  313.                 ?>
  314.                 <li><font class="profile_font" name="profile_font_vocation"><b><?php echo $guild['rank_name']; ?></b> of <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></font></li>
  315.                 <?php
  316.                 }
  317.                 ?>
  318.                 <li><font class="profile_font" name="profile_font_lastlogin"><b>Last Login:</b> <?php
  319.                     if ($profile_data['lastlogin'] != 0) {
  320.                         echo getClock($profile_data['lastlogin'], true, true);
  321.                     } else {
  322.                         echo 'Never.';
  323.                     }
  324.                    
  325.                 ?></font>
  326.                 </li>
  327.                 <!-- Achievement start -->
  328.                 <?php
  329.                 if ($config['Ach'] == true) {
  330.                     foreach ($achievementPoints as $achievement) {
  331.                         if ($achievement > 0) //if player doesn't have any achievement points it won't echo the line below.
  332.                             echo '<li>Achievement Points: ' .$achievement. '</li>';
  333.                     }
  334.                 }
  335.                 ?>
  336.                 <!-- Achievement end -->
  337.                 <!-- Display house start -->
  338.                 <?php
  339.                 if ($config['TFSVersion'] !== 'TFS_02') {
  340.                     $townid = ($config['TFSVersion'] === 'TFS_03') ? 'town' : 'town_id';
  341.                     $houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");
  342.                     if ($houses !== false) {
  343.                         $playerlist = array();
  344.                         foreach ($houses as $h) {
  345.                             if ($h['owner'] > 0)
  346.                                 $playerlist[] = $h['owner'];
  347.                                
  348.                             if ($profile_data['id'] = $h['owner']) {
  349.                                 ?>
  350.                                 <li>House: <?php echo $h['name']; ?>, <?php
  351.                                     foreach ($config['towns'] as $key=>$value) {
  352.                                         if ($key == $h['town_id']) {
  353.                                             echo $value;
  354.                                         }
  355.                                     }
  356.                                  ?>
  357.                                 </li>
  358.                                 <?php
  359.                             }
  360.                         }
  361.                     }
  362.                 }
  363.                 ?>
  364.                 <!-- Display house end -->
  365.                 <li><font class="profile_font" name="profile_font_status"><b>Status:</b></font> <?php
  366.                 if ($config['TFSVersion'] == 'TFS_10') {
  367.                     if ($profile_data['online']) {
  368.                         echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
  369.                     } else {
  370.                         echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
  371.                     }
  372.                 } else {
  373.                     if ($profile_data['online'] == 1) {
  374.                         echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
  375.                     } else {
  376.                         echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
  377.                     }
  378.                 }
  379.                 ?>
  380.                 </li>
  381.  
  382.                 <li><font class="profile_font" name="profile_font_created"><b>Created:</b> <?php echo getClock($profile_znote_data['created'], true); ?></font></li>
  383.                 <!-- skills / life / exp -->
  384. <?php
  385. /*/
  386. /   Znote AAC 1.4+ detailed character info (HP, MP, lvL, Exp, skills)
  387. /   HTML code based on code from Gesior
  388. /*/
  389. $tableWidth = 540;
  390. if ($config['TFSVersion'] != 'TFS_10') {
  391.     $playerData = mysql_select_multi("SELECT `value` FROM `player_skills` WHERE `player_id`='$user_id' LIMIT 7;");
  392.     $playerData['fist'] = $playerData[0]['value']; unset($playerData[0]);
  393.     $playerData['club'] = $playerData[1]['value']; unset($playerData[1]);
  394.     $playerData['sword'] = $playerData[2]['value']; unset($playerData[2]);
  395.     $playerData['axe'] = $playerData[3]['value']; unset($playerData[3]);
  396.     $playerData['dist'] = $playerData[4]['value']; unset($playerData[4]);
  397.     $playerData['shield'] = $playerData[5]['value']; unset($playerData[5]);
  398.     $playerData['fish'] = $playerData[6]['value']; unset($playerData[6]);
  399.  
  400.     $player = mysql_select_single("SELECT `health`, `healthmax`, `mana`, `manamax`, `experience`, `maglevel`, `level` FROM `players` WHERE `id`='$user_id' LIMIT 1;");
  401.     $playerData['magic'] = $player['maglevel'];
  402.     $playerData['exp'] = array(
  403.         'now' => $player['experience'],
  404.         'next' => (int)(level_to_experience($player['level']+1) - $player['experience']),
  405.         'percent' => (int)(($player['experience'] - level_to_experience($player['level'])) / (level_to_experience($player['level']+1) - $player['experience']) * 100)
  406.     );
  407.     $playerData['health'] = array(
  408.         'now' => $player['health'],
  409.         'max' => $player['healthmax'],
  410.         'percent' => (int)($player['health'] / $player['healthmax'] * 100),
  411.     );
  412.     $playerData['mana'] = array(
  413.         'now' => $player['mana'],
  414.         'max' => $player['manamax'],
  415.         'percent' => (int)($player['mana'] / $player['manamax'] * 100),
  416.     );
  417. } else {
  418.     $player = mysql_select_single("SELECT `health`, `healthmax`, `mana`, `manamax`, `experience`, `skill_fist`, `skill_club`, `skill_sword`, `skill_axe`, `skill_dist`, `skill_shielding`, `skill_fishing`, `maglevel`, `level` FROM `players` WHERE `id`='$user_id' LIMIT 1;");
  419.     $playerData = array(
  420.         'fist' => $player['skill_fist'],
  421.         'club' => $player['skill_club'],
  422.         'sword' => $player['skill_sword'],
  423.         'axe' => $player['skill_axe'],
  424.         'dist' => $player['skill_dist'],
  425.         'shield' => $player['skill_shielding'],
  426.         'fish' => $player['skill_fishing'],
  427.         'magic' => $player['maglevel'],
  428.         'exp' => array(
  429.             'now' => $player['experience'],
  430.             'next' => (int)(level_to_experience($player['level']+1) - $player['experience']),
  431.             'percent' => (int)(($player['experience'] - level_to_experience($player['level'])) / (level_to_experience($player['level']+1) - $player['experience']) * 100)
  432.         ),
  433.         'health' => array(
  434.             'now' => $player['health'],
  435.             'max' => $player['healthmax'],
  436.             'percent' => (int)($player['health'] / $player['healthmax'] * 100),
  437.         ),
  438.         'mana' => array(
  439.             'now' => $player['mana'],
  440.             'max' => $player['manamax'],
  441.             'percent' => (int)($player['mana'] / $player['manamax'] * 100),
  442.         )
  443.     );
  444. }
  445. // Incase they have more health/mana than they should due to equipment bonus etc
  446. if ($playerData['exp']['percent'] > 100) $playerData['exp']['percent'] = 100;
  447. if ($playerData['health']['percent'] > 100) $playerData['health']['percent'] = 100;
  448. if ($playerData['mana']['percent'] > 100) $playerData['mana']['percent'] = 100;
  449. //data_dump($playerData, false, "Player Data");
  450. ?>
  451. <!-- PLAYER SKILLS TABLE -->
  452. <table cellspacing="1" cellpadding="3" style="width: <?php echo 460; ?>px;">
  453.     <tr class="yellow">
  454.         <th>Fist</th>
  455.         <th>Club</th>
  456.         <th>Sword</th>
  457.         <th>Axe</th>
  458.         <th>Dist</th>
  459.         <th>Shield</th>
  460.         <th>Fish</th>
  461.         <th>Magic</th>
  462.     </tr>
  463.     <tr>
  464.         <td bgcolor="#D4C0A1" align="left">
  465.             <?php echo $playerData['fist']; ?>
  466.         </td>
  467.         <td bgcolor="#D4C0A1" align="left">
  468.             <?php echo $playerData['club']; ?>
  469.         </td>
  470.         <td bgcolor="#D4C0A1" align="left">
  471.             <?php echo $playerData['sword']; ?>
  472.         </td>
  473.         <td bgcolor="#D4C0A1" align="left">
  474.             <?php echo $playerData['axe']; ?>
  475.         </td>
  476.         <td bgcolor="#D4C0A1" align="left">
  477.             <?php echo $playerData['dist']; ?>
  478.         </td>
  479.         <td bgcolor="#D4C0A1" align="left">
  480.             <?php echo $playerData['shield']; ?>
  481.         </td>
  482.         <td bgcolor="#D4C0A1" align="left">
  483.             <?php echo $playerData['fish']; ?>
  484.         </td>
  485.         <td bgcolor="#D4C0A1" align="left">
  486.             <?php echo $playerData['magic']; ?>
  487.         </td>
  488.     </tr>
  489. </table>
  490. <!-- PLAYER INFO TABLE -->
  491. <table cellspacing="1" cellpadding="4" style="width: <?php echo 460; ?>px;">
  492.     <tr>
  493.         <td bgcolor="#F1E0C6" align="left" width="20%">
  494.             <b>Player HP:</b>
  495.         </td>
  496.         <td bgcolor="#F1E0C6" align="left">
  497.             <?php echo $playerData['health']['now'].'/'.$playerData['health']['max']; ?>
  498.             <div style="width: 100%; height: 3px; border: 1px solid #000;">
  499.                 <div style="background: red; width: <?php echo $playerData['health']['percent']; ?>%; height: 3px;">
  500.                 </div>
  501.             </div>
  502.         </td>
  503.     </tr>
  504.     <tr>
  505.         <td bgcolor="#D4C0A1" align="left">
  506.             <b>Player MP:</b>
  507.         </td>
  508.         <td bgcolor="#D4C0A1" align="left">
  509.             <?php echo $playerData['mana']['now'].'/'.$playerData['mana']['max']; ?>
  510.             <div style="width: 100%; height: 3px; border: 1px solid #000;">
  511.                 <div style="background: blue; width: <?php echo $playerData['mana']['percent']; ?>%; height: 3px;">
  512.                 </div>
  513.             </div>
  514.         </td>
  515.     </tr>
  516.     <tr>
  517.         <td bgcolor="#D4C0A1" align="left">
  518.             <b>Player XP:</b>
  519.         </td>
  520.         <td bgcolor="#D4C0A1" align="left">
  521.             <?php echo number_format($playerData['exp']['now'], 0, "", " "); ?> Experience.
  522.         </td>
  523.     </tr>
  524.     <tr>
  525.         <td bgcolor="#F1E0C6" align="left">
  526.             <b>To Next Lvl:</b>
  527.         </td>
  528.         <td bgcolor="#F1E0C6" align="left">
  529.             Need <b><?php echo number_format($playerData['exp']['next'], 0, "", " "); ?> experience (<?php echo 100-$playerData['exp']['percent']; ?>%)</b> to Level <b><?php echo $player['level']+1; ?></b>.
  530.             <div title="99.320604545 %" style="width: 100%; height: 3px; border: 1px solid #000;">
  531.                 <div style="background: red; width: <?php echo $playerData['exp']['percent']; ?>%; height: 3px;"></div>
  532.             </div>
  533.         </td>
  534.     </tr>
  535. </table>
  536. <!-- END detailed character info -->
  537.                 <!-- end skills / life / exp -->
  538. <!--                <li><font class="profile_font" name="profile_font_comment"><b>Comment:</b></font> <br><textarea name="profile_comment_textarea" cols="55" rows="10" readonly="readonly"><?php echo $profile_znote_data['comment']; ?></textarea></li>
  539. -->
  540.                                 <table><tr class="yellow">
  541.                                 <th><center>Comment:</center>
  542.                                 </th>
  543.                                 </tr>
  544.                                 <tr><td><center><textarea name="profile_comment_textarea" cols="50" rows="10" readonly="readonly" class="span12"><?php echo $profile_znote_data['comment']; ?>
  545.                                 </textarea></center></td></tr></table>
  546. <!-- Achievements start -->
  547. <?php if ($config['Ach']) { ?>         
  548.     <h3 class="header-ok">Achievements</h3>
  549.     <div id="accordion">
  550.         <h3>Show/hide player achievements</h3>
  551.             <div>
  552.                 <table class="table table-striped table-bordered">
  553.                     <tbody>
  554.                         <style>
  555.                             #secondD {
  556.                                 margin-left:0px;
  557.                             }
  558.                         </style>
  559.                         <?php
  560.                         foreach ($config['achievements'] as $key => $achiv) {
  561.                             $uery = mysql_select_single("SELECT `player_id`, `value`, `key` FROM `player_storage` WHERE `player_id`='$user_id' AND `key`='$key' LIMIT 1;");
  562.                             if (!empty($uery) || $uery !== false) {
  563.                                 foreach ($uery as $luery) {
  564.                                     if ($luery == $key) {
  565.                                         if (!array_key_exists($key, $achiv)) {
  566.                                             echo '<tr><td width="17%">' .$achiv[0]. '</td><td>' .$achiv[1]. '</td>';
  567.                                             if (!isset($achiv['secret'])) {
  568.                                                 echo '<td><img id="secondD" src="http://img04.imgland.net/PuMz0mVqSG.gif"></td>';
  569.                                             }
  570.                                             echo '<td>'. $achiv['points'] .'</td>';
  571.                                             echo '<tr>';
  572.                                         }
  573.                                     }
  574.                                 }
  575.                             }
  576.                         }
  577.                         ?>
  578.                 </tbody>
  579.             </table>
  580.         </div>
  581.     </div>
  582. <br>
  583. <?php } ?>
  584.     <!-- Achievements end -->
  585.             <!-- DEATH LIST -->
  586.                 <li>
  587.                     <b>Death List:</b><br>
  588.                     <?php
  589.                     if ($config['TFSVersion'] == 'TFS_02') {
  590.                         $array = user_fetch_deathlist($user_id);
  591.                         if ($array) {
  592.                             //data_dump($array, false, "Data:");
  593.                             ?>
  594.                             <ul>
  595.                                 <?php
  596.                                 // Design and present the list
  597.                                 foreach ($array as $value) {
  598.                                     echo '<li>';
  599.                                     // $value[0]
  600.                                     $value['time'] = getClock($value['time'], true);                               
  601.                                     if ($value['is_player'] == 1) {
  602.                                         $value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
  603.                                     } else {
  604.                                         $value['killed_by'] = 'monster: '. $value['killed_by'] .'.';
  605.                                     }
  606.                                    
  607.                                     echo '['. $value['time'] .'] Killed at level '. $value['level'] .' by '. $value['killed_by'];
  608.                                     echo '</li>';
  609.                                 }
  610.                             ?>
  611.                             </ul>
  612.                             <?php
  613.                             } else {
  614.                                 echo '<b><font color="green">This player has never died.</font></b>';
  615.                             }
  616.                             //Done.
  617.                         } else if ($config['TFSVersion'] == 'TFS_10') {
  618.                             $deaths = mysql_select_multi("SELECT
  619.                                 `player_id`, `time`, `level`, `killed_by`, `is_player`,
  620.                                 `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`
  621.                                 FROM `player_deaths`
  622.                                 WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");
  623.  
  624.                             if (!$deaths) echo '<b><font color="green">This player has never died.</font></b>';
  625.                             else {
  626.                                 foreach ($deaths as $d) {
  627.                                     ?>
  628.                                     <li>
  629.                                         <?php echo "<b>".getClock($d['time'], true, true)."</b>";
  630.                                         $lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
  631.                                         echo ": Killed at level ".$d['level']." by $lasthit";
  632.                                         if ($d['unjustified']) echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
  633.                                         $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
  634.                                         if ($mostdmg) {
  635.                                             $mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
  636.                                             echo "<br>and by $mostdmg.";
  637.                                             if ($d['mostdamage_unjustified']) echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
  638.                                         } else echo " <b>(soloed)</b>";
  639.                                         ?>
  640.                                     </li>
  641.                                     <?php
  642.                                 }
  643.                                 //data_dump($deaths, false, "Deaths:");
  644.                             }
  645.                         } else if ($config['TFSVersion'] == 'TFS_03') {
  646.                             //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
  647.                             $array = user_fetch_deathlist03($user_id);
  648.                             if ($array) {
  649.                             ?>
  650.                             <ul>
  651.                                 <?php
  652.                                 // Design and present the list
  653.                                 foreach ($array as $value) {
  654.                                     echo '<li>';
  655.                                     $value[3] = user_get_killer_id(user_get_kid($value['id']));
  656.                                     if ($value[3] !== false && $value[3] >= 1) {
  657.                                         $namedata = user_character_data((int)$value[3], 'name');
  658.                                         if ($namedata !== false) {
  659.                                             $value[3] = $namedata['name'];
  660.                                             $value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
  661.                                         } else {
  662.                                             $value[3] = 'deleted player.';
  663.                                         }
  664.                                     } else {
  665.                                         $value[3] = user_get_killer_m_name(user_get_kid($value['id']));
  666.                                         if ($value[3] === false) $value[3] = 'deleted player.';
  667.                                     }
  668.                                     echo '['. getClock($value['date'], true) .'] Killed at level '. $value['level'] .' by '. $value[3];
  669.                                     echo '</li>';
  670.                                 }
  671.                             ?>
  672.                             </ul>
  673.                             <?php
  674.                             } else {
  675.                                 echo '<b><font color="green">This player has never died.</font></b>';
  676.                             }
  677.                         }
  678.                         ?>
  679.                 </li>
  680.                
  681.                 <!-- END DEATH LIST -->
  682. <!-- QUEST PROGRESSION -->
  683. <?php
  684. $totalquests = 0;
  685. $completedquests = 0;
  686. $firstrun = 1;
  687. if ($config['EnableQuests'] == true) {
  688.     $sqlquests =  mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
  689.     foreach ($config['quests'] as $cquest) {
  690.         $totalquests = $totalquests + 1;
  691.         foreach ($sqlquests as $dbquest) {
  692.             if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
  693.                 $completedquests = $completedquests + 1;
  694.             }
  695.         }
  696.         if ($cquest[3] == 1) {
  697.             if ($completedquests != 0) {
  698.                 if ($firstrun == 1) {
  699.                     ?>
  700.                     <li>
  701.                         <b> Quest progression </b>
  702.                         <table id="characterprofileQuest" class="table table-striped table-hover">
  703.                             <tr class="yellow">
  704.                                 <th>Quest:</th>
  705.                                 <th>progression:</th>
  706.                             </tr>
  707.                     <?php
  708.                     $firstrun = 0;
  709.                 }
  710.                 $completed = $completedquests / $totalquests * 100;
  711.                 ?>
  712.                 <tr>
  713.                     <td><?php echo $cquest[2]; ?></td>
  714.                     <td id="progress">
  715.                         <span id="percent"><?php echo round($completed); ?>%</span>
  716.                         <div id="bar" style="width: '.$completed.'%"></div>
  717.                     </td>
  718.                 </tr>
  719.                 <?php
  720.             }
  721.             $completedquests = 0;
  722.             $totalquests = 0;
  723.         }
  724.     }
  725. }
  726. if ($firstrun == 0) {
  727.     echo '</table></li>';
  728. }
  729. ?>
  730. <!-- END QUEST PROGRESSION -->
  731.                 <!-- CHARACTER LIST -->
  732.                 <?php
  733.                 if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) {
  734.                 ?>
  735.                     <li>
  736.                         <b>Other visible characters on this account:</b><br>
  737.                         <?php
  738.                         $characters = user_character_list(user_character_account_id($profile_data['name']));
  739.                         // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
  740.                         if ($characters && count($characters) > 1) {
  741.                             ?>
  742.                             <table id="characterprofileTable" class="table table-striped table-hover">
  743.                                 <tr class="yellow">
  744.                                     <th>
  745.                                         Name:
  746.                                     </th>
  747.                                     <th>
  748.                                         Level:
  749.                                     </th>
  750.                                     <th>
  751.                                         Vocation:
  752.                                     </th>
  753.                                     <th>
  754.                                         Last login:
  755.                                     </th>
  756.                                     <th>
  757.                                         Status:
  758.                                     </th>
  759.                                 </tr>
  760.                                 <?php
  761.                                 // Design and present the list
  762.                                 foreach ($characters as $char) {
  763.                                     if ($char['name'] != $profile_data['name']) {
  764.                                         if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden') {
  765.                                             echo '<tr>';
  766.                                             echo '<td><a href="characterprofile.php?name='. $char['name'] .'">'. $char['name'] .'</a></td>';
  767.                                             echo '<td>'. $char['level'] .'</td>';
  768.                                             echo '<td>'. $char['vocation'] .'</td>';
  769.                                             echo '<td>'. $char['lastlogin'] .'</td>';
  770.                                             echo '<td>'. $char['online'] .'</td>';
  771.                                             echo '</tr>';
  772.                                         }
  773.                                     }
  774.                                 }
  775.                             ?>
  776.                             </table>
  777.                             <?php
  778.                             } else {
  779.                                 echo '<b><font color="green">This player has never died.</font></b>';
  780.                             }
  781.                                 //Done.
  782.                             ?>
  783.                     </li>
  784.                 <?php
  785.                 }
  786.                 ?>
  787.                 <!-- END CHARACTER LIST -->
  788.                 <li><font class="profile_font" name="profile_font_share_url">Address: <a href="<?php
  789.                     if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  790.                     else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  791.                    
  792.                 ?>"><?php
  793.                     if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  794.                     else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  795.                 ?></a></font></li>
  796.             </ul>
  797.         <!-- END PROFILE MARKUP HERE-->
  798.        
  799.         <?php
  800.     } else {
  801.         echo htmlentities(strip_tags($name, ENT_QUOTES)).' does not exist.';
  802.     }
  803. } else {
  804.     header('Location: index.php');
  805. }
  806.  
  807. include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment