Advertisement
Guest User

characterprofile.php

a guest
Jul 28th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.09 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.    
  8.     if (user_character_exist($name)) {
  9.         $user_id = user_character_id($name);
  10.         $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'vocation', 'lastlogin', 'online');
  11.         $flag = $profile_data['account_id'];
  12.         $getflag = mysql_query("SELECT * FROM znote_accounts WHERE account_id = '$flag'");
  13.         $parseflag = mysql_fetch_assoc($getflag);      
  14.         $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
  15.        
  16.         $guild_exist = false;
  17.         if (get_character_guild_rank($user_id) > 0) {
  18.             $guild_exist = true;
  19.             $guild = get_player_guild_data($user_id);
  20.             $guild_name = get_guild_name($guild['guild_id']);
  21.         }
  22.         ?>
  23.        
  24.         <!-- PROFILE MARKUP HERE-->
  25.             <?php ?>
  26.             <h1><font class="profile_font" name="profile_font_header">Profile: <?php echo $profile_data['name']; ?></font></h1>
  27.             <ul>
  28.                 <li><font class="profile_font" name="profile_font_country">Country: <?php echo '<img src="\flags\\'.$parseflag['flag'].'.png">'; ?></font></li>
  29.                 <li><font class="profile_font" name="profile_font_level">Level: <?php echo $profile_data['level']; ?></font></li>
  30.                 <li><font class="profile_font" name="profile_font_vocation">Vocation: <?php echo vocation_id_to_name($profile_data['vocation']); ?></font></li>
  31.                 <?php
  32.                 if ($guild_exist) {
  33.                 ?>
  34.                 <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>
  35.                 <?php
  36.                 }
  37.                 ?>
  38.                 <li><font class="profile_font" name="profile_font_lastlogin">Last Login: <?php
  39.                     if ($profile_data['lastlogin'] != 0) {
  40.                         echo(date($config['date'],$profile_data['lastlogin']));
  41.                     } else {
  42.                         echo 'Never.';
  43.                     }
  44.                    
  45.                 ?></font></li>
  46.                 <li><font class="profile_font" name="profile_font_status">Status:</font> <?php
  47.                         if ($profile_data['online'] == 1) {
  48.                             echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
  49.                         } else {
  50.                             echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
  51.                         }
  52.                     ?></li>
  53.                 <li><font class="profile_font" name="profile_font_created">Created: <?php echo(date($config['date'],$profile_znote_data['created'])); ?></font></li>
  54.                 <li><font class="profile_font" name="profile_font_comment">Comment:</font> <br><textarea name="profile_comment_textarea" cols="70" rows="10" readonly="readonly"><?php echo $profile_znote_data['comment']; ?></textarea></li>
  55.                 <!-- DEATH LIST -->
  56.                 <li>
  57.                     <b>Death List:</b><br>
  58.                     <?php
  59.                     if ($config['TFSVersion'] == 'TFS_02') {
  60.                         $array = user_fetch_deathlist($user_id);
  61.                         if ($array) {
  62.                             //print_r($array);
  63.                             ?>
  64.                             <ul>
  65.                                 <?php
  66.                                 // Design and present the list
  67.                                 foreach ($array as $value) {
  68.                                     echo '<li>';
  69.                                     // $value[0]
  70.                                     $value[1] = date($config['date'],$value[1]);                               
  71.                                     if ($value[4] == 1) {
  72.                                         $value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
  73.                                     } else {
  74.                                         $value[3] = 'monster: '. $value[3] .'.';
  75.                                     }
  76.                                    
  77.                                     echo '['. $value[1] .'] Killed at level '. $value[2] .' by '. $value[3];
  78.                                     echo '</li>';
  79.                                 }
  80.                             ?>
  81.                             </ul>
  82.                             <?php
  83.                             } else {
  84.                                 echo '<b><font color="green">This player has never died.</font></b>';
  85.                             }
  86.                             //Done.
  87.                         }
  88.                         if ($config['TFSVersion'] == 'TFS_03') {
  89.                             $array = user_fetch_deathlist03($user_id);
  90.                             if ($array) {
  91.                             ?>
  92.                             <ul>
  93.                                 <?php
  94.                                 // Design and present the list
  95.                                 foreach ($array as $value) {
  96.                                     echo '<li>';
  97.                                     $value[3] = user_get_killer_id(user_get_kid($value['id']));
  98.                                     if ($value[3] >= 1) {
  99.                                         $namedata = user_character_data((int)$value[3], 'name');
  100.                                         $value[3] = $namedata['name'];
  101.                                         $value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
  102.                                     } else {
  103.                                         $value[3] = user_get_killer_m_name(user_get_kid($value['id']));
  104.                                     }
  105.                                     echo '['. date($config['date'],$value['date']) .'] Killed at level '. $value['level'] .' by '. $value[3];
  106.                                     echo '</li>';
  107.                                 }
  108.                             ?>
  109.                             </ul>
  110.                             <?php
  111.                             } else {
  112.                                 echo '<b><font color="green">This player has never died.</font></b>';
  113.                             }
  114.                         }
  115.                         ?>
  116.                 </li>
  117.                
  118.                 <!-- END DEATH LIST -->
  119.                
  120.                 <!-- CHARACTER LIST -->
  121.                 <?php
  122.                 if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) {
  123.                 ?>
  124.                     <li>
  125.                         <b>Other visible characters on this account:</b><br>
  126.                         <?php
  127.                         $array = user_character_list(user_character_account_id($profile_data['name']));
  128.                         // Array: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
  129.                         if ($array && count($array) > 1) {
  130.                             ?>
  131.                             <table>
  132.                                 <tr class="yellow">
  133.                                     <td>
  134.                                         Name:
  135.                                     </td>
  136.                                     <td>
  137.                                         Level:
  138.                                     </td>
  139.                                     <td>
  140.                                         Vocation:
  141.                                     </td>
  142.                                     <td>
  143.                                         Last login:
  144.                                     </td>
  145.                                     <td>
  146.                                         Status:
  147.                                     </td>
  148.                                 </tr>
  149.                                 <?php
  150.                                 // Design and present the list
  151.                                 foreach ($array as $value) {
  152.                                     if ($value[0] != $profile_data['name']) {
  153.                                         if (hide_char_to_name(user_character_hide($value[0])) != 'hidden') {
  154.                                             echo '<tr>';
  155.                                             echo '<td><a href="characterprofile.php?name='. $value[0] .'">'. $value[0] .'</a></td>';
  156.                                             echo '<td>'. $value[1] .'</td>';
  157.                                             echo '<td>'. $value[2] .'</td>';
  158.                                             echo '<td>'. $value[4] .'</td>';
  159.                                             echo '<td>'. $value[5] .'</td>';
  160.                                             echo '</tr>';
  161.                                         }
  162.                                     }
  163.                                 }
  164.                             ?>
  165.                             </table>
  166.                             <?php
  167.                             } else {
  168.                                 echo '<b><font color="green">This player has never died.</font></b>';
  169.                             }
  170.                                 //Done.
  171.                             ?>
  172.                     </li>
  173.                 <?php
  174.                 }
  175.                 ?>
  176.                 <!-- END CHARACTER LIST -->
  177.                 <li><font class="profile_font" name="profile_font_share_url">Address: <a href="<?php
  178.                     if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  179.                     else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  180.                    
  181.                 ?>"><?php
  182.                     if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  183.                     else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  184.                 ?></a></font></li>
  185.             </ul>
  186.         <!-- END PROFILE MARKUP HERE-->
  187.        
  188.         <?php
  189.     } else {
  190.         echo htmlentities(strip_tags($name, ENT_QUOTES)).' does not exist.';
  191.     }
  192. } else {
  193.     header('Location: index.php');
  194. }
  195.  
  196. include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement