Advertisement
Guest User

Untitled

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