JoseluisGGR

Untitled

Mar 10th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.05 KB | None | 0 0
  1. <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
  2. <br><table class="blackline">
  3. <tr>
  4. <td><img src="layout/images/blank.gif"></td>
  5. </tr>
  6. </table>
  7. <div class="titleheader">
  8. <h1>Characters</h1>
  9. </div>
  10. <table class="blackline">
  11. <tr>
  12. <td><img src="layout/images/blank.gif"></td>
  13. </tr>
  14. </table><br>
  15. <?php
  16. if ($config['log_ip']) {
  17. znote_visitor_insert_detailed_data(4);
  18. }
  19. if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
  20. $name = $_GET['name'];
  21. $user_id = user_character_exist($name);
  22. if ($user_id !== false) {
  23. if ($config['TFSVersion'] == 'TFS_10') {
  24. $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'vocation', 'lastlogin', 'sex', 'group_id', 'town_id');
  25. $profile_data['online'] = user_is_online_10($user_id);
  26. } else $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'vocation', 'lastlogin', 'online', 'sex', 'group_id', 'town_id');
  27. $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
  28. $premiumdata = mysql_select_single("SELECT premend FROM accounts WHERE id=$profile_data['account_id']");
  29. $prem = ($premiumdata['premend'] > 0) ? true : false;
  30. $guild_exist = false;
  31. if (get_character_guild_rank($user_id) > 0) {
  32. $guild_exist = true;
  33. $guild = get_player_guild_data($user_id);
  34. $guild_name = get_guild_name($guild['guild_id']);
  35. }
  36. ?>
  37.  
  38. <!-- PROFILE MARKUP HERE-->
  39. <!-- CHARACTER INFORMAION -->
  40. <table>
  41. <tr><td colspan="2">Character Information</td></tr>
  42. <tr><td width="20%">Name:</td>
  43. <td><?php echo $profile_data['name']; ?></td></tr>
  44. <tr><td>Sex:</td>
  45. <td><?php
  46. if ($profile_data['sex'] == 1) {
  47. echo 'Male';
  48. } else {
  49. echo 'Female';
  50. }
  51. ?></td></tr>
  52. <tr><td>Vocation:</td>
  53. <td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td></tr>
  54. <tr><td>Level:</td>
  55. <td><?php echo $profile_data['level']; ?></td></tr>
  56. <tr><td>World:</td>
  57. <td><?php echo $config['site_title'] ?></td></tr>
  58. <tr><td>Residence:</td>
  59. <td><?php
  60. foreach ($config['towns'] as $key=>$value) {
  61. if ($key == $profile_data['town_id']) {
  62. echo $value;
  63. }
  64. } ?></td></tr>
  65. <?php
  66. if ($guild_exist) {
  67. ?>
  68. <tr><td>Guild membership:</td>
  69. <td><?php echo $guild['rank_name']; ?> of the <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></td></tr>
  70. <?php
  71. }
  72. ?>
  73. <?php $houses = array();
  74. $houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `townid` FROM `houses` WHERE `owner` = $user_id ;");
  75. if ($houses !== false) {
  76. $playerlist = array();
  77. foreach ($houses as $h)
  78. if ($h['owner'] > 0)
  79. $playerlist[] = $h['owner'];
  80.  
  81. if ($profile_data['id'] = $h['owner']) { ?>
  82. <tr><td>House:</td>
  83. <td><?php echo $h['name']; ?> (<?php
  84. foreach ($config['towns'] as $key=>$value) {
  85. if ($key == $h['townid']) {
  86. echo $value;
  87. }
  88. } ?></td></tr>
  89. <?php
  90. }
  91. }
  92. ?>
  93. <tr><td width="20%">Last login:</td>
  94. <td><?php
  95. if ($profile_data['lastlogin'] != 0) {
  96. echo getClock($profile_data['lastlogin'], true, true);
  97. } else {
  98. echo 'never logged in';
  99. }
  100. ?></td></tr>
  101. <?php if (isset($profile_znote_data['comment']) === true && empty($profile_znote_data['comment']) === false) { ?>
  102. <tr><td>Comment:</td>
  103. <td><?php echo $profile_znote_data['comment']; ?></td></tr>
  104. <?php } ?>
  105. <tr><td>Account Status:</td>
  106. <td><?php
  107. if ($prem) {
  108. echo 'Premium Account';
  109. } else {
  110. echo 'Free Account';
  111. }
  112. ?></td></tr>
  113. <!-- CHARACTER INFORMAION -->
  114. <table>
  115. <tr><td colspan="2">Account Information</td></tr>
  116. <?php
  117. if ($profile_data['group_id'] > 1) {
  118. ?>
  119. <tr><td width="20%">Position:</td>
  120. <td><?php
  121. foreach ($config['ingame_positions'] as $key=>$value) {
  122. if ($key == $profile_data['group_id']) {
  123. echo $value;
  124. }
  125. } ?></td></tr>
  126. <?php
  127. }
  128. ?>
  129. <tr><td>Created:</td>
  130. <td><?php echo getClock($profile_znote_data['created'], true); ?></td></tr>
  131. </table>
  132. <!-- END CHARACTER INFORMATION -->
  133. <!-- DEATH LIST -->
  134. <?php
  135. if ($config['TFSVersion'] == 'TFS_02') {
  136. $array = user_fetch_deathlist($user_id);
  137. if ($array) { ?>
  138. <table>
  139. <tr><td colspan="2">Character Deaths</td></tr><?php
  140. //data_dump($array, false, "Data:");
  141. // Design and present the list
  142. foreach ($array as $value) {
  143. // $value[0]
  144. $value['time'] = getClock($value['time'], true);
  145. if ($value['is_player'] == 1) {
  146. echo '<tr><td width="20%">'. $value['time'] .'</td><td> Killed at Level '. $value['level'] .' by <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a></td></tr>';
  147. } else {
  148. echo '<tr><td>'. $value['time'] .'</td><td> Died at Level '. $value['level'] .' by '. $value['killed_by'] .'</td></tr>';
  149. }
  150. ?>
  151. </table><?php
  152. }
  153. }
  154. //Done.
  155. } else if ($config['TFSVersion'] == 'TFS_10') {
  156. $deaths = mysql_select_multi("SELECT
  157. `player_id`, `time`, `level`, `killed_by`, `is_player`,
  158. `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`
  159. FROM `player_deaths`
  160. WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");
  161.  
  162. if (!$deaths) echo '';
  163. else {
  164. ?>
  165. <table>
  166. <tr><td colspan="2">Character Deaths</td></tr><?php
  167. foreach ($deaths as $d) {
  168. echo "<tr><td width='20%'>".getClock($d['time'], true, true)."</td>";
  169. $lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
  170. if ($d['is_player'] > 0) {
  171. echo "<td> Killed at Level ".$d['level']." by $lasthit";
  172. } else echo "<td> Died at Level ".$d['level']." by $lasthit";
  173. if ($d['unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
  174. $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
  175. if ($mostdmg) {
  176. $mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
  177. echo " and by $mostdmg.";
  178. if ($d['mostdamage_unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
  179. }
  180. }
  181. //data_dump($deaths, false, "Deaths:");
  182. ?>
  183. </td></tr></table><?php
  184. }
  185. } else if ($config['TFSVersion'] == 'OTH') {
  186. //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
  187. $array = user_fetch_deathlist03($user_id);
  188. if ($array) { ?>
  189. <table>
  190. <tr><td colspan="2">Character Deaths</td></tr><?php
  191. // Design and present the list
  192. foreach ($array as $value) {
  193. $value[3] = user_get_killer_id(user_get_kid($value['id']));
  194. if ($value[3] !== false && $value[3] >= 1) {
  195. $namedata = user_character_data((int)$value[3], 'name');
  196. if ($namedata !== false) {
  197. $value[3] = $namedata['name'];
  198. $value[3] = '<a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
  199. } else {
  200. $value[3] = 'deleted player.';
  201. }
  202. echo '<tr><td width="20%">'. getClock($value['date'], true) .'</td><td>Killed at Level '. $value['level'] .' by '. $value[3]. '</td></tr>';
  203. } else {
  204. $value[3] = user_get_killer_m_name(user_get_kid($value['id']));
  205. if ($value[3] === false) $value[3] = 'deleted player.';
  206. echo '<tr><td width="20%">'. getClock($value['date'], true) .'</td><td>Died at Level '. $value['level'] .' by '. $value[3] .'</td></tr>';
  207. }
  208. }
  209. ?>
  210. </table><?php
  211. }
  212. }
  213. ?>
  214. <!-- END DEATH LIST -->
  215. <!-- CHARACTER LIST -->
  216. <?php
  217. if (user_character_hide($profile_data['name']) != 1) {
  218. ?>
  219. <table>
  220. <tr><td colspan="4">Characters</td></tr>
  221. <?php
  222. $characters = user_character_list(user_character_account_id($profile_data['name']));
  223. // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
  224. if ($characters && count($characters) > 0) {
  225. ?>
  226. <tr>
  227. <td><b>Name</b></td>
  228. <td width="55%"><b>Status</b></td>
  229. <td><b>Level</b></td>
  230. <td><b>Vocation</b></td>
  231. </tr>
  232. <?php
  233. // Design and present the list
  234. $number = 1;
  235. foreach ($characters as $char) {
  236. if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden') {
  237. echo '<tr>';
  238. echo '<td>'. $number .'. <a href="characterprofile.php?name='. $char['name'] .'">'. $char['name'] .'</a></td>';
  239. if ($char['name'] != $profile_data['name']) { echo '<td>'. $char['online'] .'</td>';
  240. } else echo '<td>'. $char['online'] .' <span style="font-size:85%;opacity:.5;"><i> (currently viewing)</i></span></td>';
  241. echo '<td>'. $char['level'] .'</td>';
  242. echo '<td>'. $char['vocation'] .'</td>';
  243. /* echo '<td>';
  244. if ($profile_data['lastlogin'] != 0) {
  245. echo getClock($profile_data['lastlogin'], true, true);
  246. } else {
  247. echo 'never logged in';
  248. }
  249. echo '</td>'; */
  250. echo '</tr>';
  251. $number = $number + 1;
  252. }
  253. }
  254. ?>
  255. </table>
  256. <?php
  257. } else {
  258. echo '<span style="color: #43ac6a; font-weight: bold;">This player has never died.</span>';
  259. }
  260. //Done.
  261. ?>
  262. <?php
  263. }
  264. ?>
  265. <!-- END CHARACTER LIST -->
  266. <?php /*
  267. <table>
  268. <tr><td><font class="profile_font" name="profile_font_share_url">Address</td></tr><tr><td><a href="<?php
  269. if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  270. else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  271.  
  272. ?>"><?php
  273. if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
  274. else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
  275. ?></a></font></td></tr>
  276. </table>
  277. */ ?>
  278.  
  279. <!-- END PROFILE MARKUP HERE-->
  280.  
  281. <?php
  282. } else {
  283. echo htmlentities(strip_tags($name, ENT_QUOTES)).' does not exist.';
  284. }
  285. } else {
  286. header('Location: unnamed');
  287. }?>
  288. <p>
  289. <table>
  290. <form type="submit" action="characterprofile.php" method="get">
  291. <tr>
  292. <td>Search Character</td>
  293. </tr>
  294. <tr class="darkborder">
  295. <td>
  296. Name: <input type="text" size="25" name="name" class="search">
  297. <input type="submit" name="submitName" value="Submit">
  298. </td>
  299. </tr>
  300. </form>
  301. </table>
  302. <?php include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment