Guest User

Untitled

a guest
Jun 12th, 2015
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.21 KB | None | 0 0
  1. <?php
  2. /**
  3. * MCCodes Version 2.0.5b
  4. * Copyright (C) 2005-2012 Dabomstew
  5. * All rights reserved.
  6. *
  7. * Redistribution of this code in any form is prohibited, except in
  8. * the specific cases set out in the MCCodes Customer License.
  9. *
  10. * This code license may be used to run one (1) game.
  11. * A game is defined as the set of users and other game database data,
  12. * so you are permitted to create alternative clients for your game.
  13. *
  14. * If you did not obtain this code from MCCodes.com, you are in all likelihood
  15. * using it illegally. Please contact MCCodes to discuss licensing options
  16. * in this case.
  17. *
  18. * File: viewuser.php
  19. * Signature: 359abfc90736815bd4dd5e155cd1edf8
  20. * Date: Fri, 20 Apr 12 08:50:30 +0000
  21. */
  22.  
  23. require_once('globals.php');
  24. $_GET['u'] =
  25. (isset($_GET['u']) && is_numeric($_GET['u'])) ? abs(intval($_GET['u']))
  26. : '';
  27. if (!$_GET['u'])
  28. {
  29. echo 'Invalid use of file';
  30. }
  31. else
  32. {
  33. $q =
  34. $db->query(
  35. "SELECT `userid`, `user_level`, `laston`, `last_login`,
  36. `signedup`, `duties`, `donatordays`, `username`, `gender`,
  37. `daysold`, `money`, `crystals`, `level`, `friend_count`,
  38. `enemy_count`, `display_pic`, `hp`, `maxhp`, `gang`,
  39. `fedjail`, `hospital`, `hospreason`, `jail`, `jail_reason`,
  40. `bankmoney`, `cybermoney`, `lastip`, `lastip`,
  41. `lastip_login`, `lastip_signup`, `staffnotes`, `cityname`,
  42. `hNAME`, `gangNAME`, `fed_days`, `fed_reason`
  43. FROM `users` `u`
  44. INNER JOIN `cities` AS `c`
  45. ON `u`.`location` = `c`.`cityid`
  46. INNER JOIN `houses` AS `h`
  47. ON `u`.`maxwill` = h.`hWILL`
  48. LEFT JOIN `gangs` AS `g`
  49. ON `g`.`gangID` = `u`.`gang`
  50. LEFT JOIN `fedjail` AS `f`
  51. ON `f`.`fed_userid` = `u`.`userid`
  52. WHERE `u`.`userid` = {$_GET['u']}");
  53. if ($db->num_rows($q) == 0)
  54. {
  55. $db->free_result($q);
  56. echo 'Sorry, we could not find a user with that ID, check your source.';
  57. }
  58. else
  59. {
  60. $r = $db->fetch_row($q);
  61. $db->free_result($q);
  62. $checkulevel =
  63. array(0 => 'NPC', 1 => 'Member', 2 => 'Owner',
  64. 3 => 'Secretary', 5 => 'Assistant');
  65. $userl = $checkulevel[$r['user_level']];
  66. $lon =
  67. ($r['laston'] > 0) ? date('F j, Y g:i:s a', $r['laston'])
  68. : "Never";
  69. $ula = ($r['laston'] == 0) ? 'Never' : DateTime_Parse($r['laston']);
  70. $ull =
  71. ($r['last_login'] == 0) ? 'Never'
  72. : DateTime_Parse($r['last_login']);
  73. $sup = date('F j, Y g:i:s a', $r['signedup']);
  74. $u_duties =
  75. ($r['user_level'] > 1) ? 'Duties: ' . $r['duties'] . '<br />'
  76. : '';
  77. $user_name =
  78. ($r['donatordays'])
  79. ? '<span style="color:red; font-weight:bold;">'
  80. . $r['username'] . '</span> [' . $r['userid']
  81. . '] <img src="donator.gif" alt="Donator: '
  82. . $r['donatordays']
  83. . ' Days Left" title="Donator: '
  84. . $r['donatordays'] . ' Days Left" />'
  85. : $r['username'] . ' [' . $r['userid'] . ']';
  86. $on =
  87. ($r['laston'] >= $_SERVER['REQUEST_TIME'] - 15 * 60)
  88. ? '<font color="green"><b>Online</b></font>'
  89. : '<font color="red"><b>Offline</b></font>';
  90. $ref_q =
  91. $db->query(
  92. "SELECT COUNT(`refID`)
  93. FROM `referals`
  94. WHERE `refREFER` = {$r['userid']}");
  95. $ref = $db->fetch_single($ref_q);
  96. $db->free_result($ref_q);
  97. echo "
  98. <h3>Profile for {$r['username']}</h3>
  99. <table width='100%' cellspacing='1' class='table'>
  100. <tr>
  101. <th>General Info</th>
  102. <th>Financial Info</th>
  103. <th>Display Pic</th>
  104. </tr>
  105. <tr>
  106. <td>
  107. Name: $user_name<br />
  108. User Level: $userl<br />
  109. $u_duties
  110. Gender: {$r['gender']}<br />
  111. Signed Up: $sup<br />
  112. Last Active: $lon<br />
  113. Last Action: $ula<br />
  114. Last Login: $ull<br />
  115. Online: $on<br />
  116. Days Old: {$r['daysold']}<br />
  117. Location: {$r['cityname']}</td><td>
  118. Money: " . money_formatter($r['money'])
  119. . "<br />
  120. Crystals: {$r['crystals']}<br />
  121. Property: {$r['hNAME']}<br />
  122. Referals: {$ref}<br />
  123. Friends: {$r['friend_count']}<br />
  124. Enemies: {$r['enemy_count']}
  125. </td>
  126. <td>
  127. ";
  128. echo ($r['display_pic'])
  129. ? '<img src="' . $r['display_pic']
  130. . '" width="150px" height="150px" alt="User Display Pic" title="User Display Pic" />'
  131. : 'No Image';
  132. $sh = ($ir['user_level'] > 1) ? "Staff Info" : "&nbsp;";
  133. echo "
  134. </td>
  135. </tr>
  136. <tr>
  137. <th>Physical Info</th>
  138. <th>Links</th>
  139. <th>$sh</th>
  140. </tr>
  141. <tr>
  142. <td>
  143. Level: {$r['level']}<br />
  144. Health: {$r['hp']}/{$r['maxhp']}<br />
  145. ";
  146. echo ($r['gang'])
  147. ? 'Gang: <a href="gangs.php?action=view&ID=' . $r['gang']
  148. . '">' . $r['gangNAME'] . '</a>' : '';
  149.  
  150. if ($r['fedjail'])
  151. {
  152. echo "
  153. <br />
  154. <span style='font-weight: bold; color: red;'>
  155. In federal jail for {$r['fed_days']} day(s).
  156. <br />
  157. {$r['fed_reason']}
  158. </span>
  159. ";
  160. }
  161. if ($r['hospital'])
  162. {
  163. echo "
  164. <br />
  165. <span style='font-weight: bold; color: red;'>
  166. In hospital for {$r['hospital']} minutes.
  167. <br />
  168. {$r['hospreason']}
  169. </span>
  170. ";
  171. }
  172. if ($r['jail'])
  173. {
  174. echo "
  175. <br />
  176. <span style='font-weight: bold; color: red;'>
  177. In jail for {$r['jail']} minutes.
  178. <br />
  179. {$r['jail_reason']}
  180. </span>
  181. ";
  182. }
  183.  
  184. echo "
  185. </td>
  186. <td>
  187. [<a href='mailbox.php?action=compose&ID={$r['userid']}'>Send Mail</a>]
  188. <br /><br />
  189. [<a href='sendcash.php?ID={$r['userid']}'>Send Cash</a>]
  190. <br /><br />
  191. ";
  192. if ($set['sendcrys_on'])
  193. {
  194. echo "
  195. [<a href='sendcrys.php?ID={$r['userid']}'>Send Crystals</a>]
  196. <br /><br />
  197. ";
  198. }
  199. if ($set['sendbank_on'])
  200. {
  201. if ($ir['bankmoney'] >= 0 && $r['bankmoney'] >= 0)
  202. {
  203. echo "
  204. [<a href='sendbank.php?ID={$r['userid']}'>Bank Xfer</a>]
  205. <br /><br />
  206. ";
  207. }
  208. if ($ir['cybermoney'] >= 0 && $r['cybermoney'] >= 0)
  209. {
  210. echo "
  211. [<a href='sendcyber.php?ID={$r['userid']}'>CyberBank Xfer</a>]
  212. <br /><br />
  213. ";
  214. }
  215. }
  216. echo "
  217. [<a href='attack.php?ID={$r['userid']}'>Attack</a>]
  218. <br /><br />
  219. [<a href='contactlist.php?action=add&ID={$r['userid']}'>Add Contact</a>]
  220. ";
  221. if (in_array($ir['user_level'], array(2, 3, 5)))
  222. {
  223. echo "
  224. <br /><br />
  225. [<a href='jailuser.php?userid={$r['userid']}'>Jail</a>]
  226. <br /><br />
  227. [<a href='mailban.php?userid={$r['userid']}'>MailBan</a>]
  228. ";
  229. }
  230. if ($ir['donatordays'] > 0)
  231. {
  232. echo "
  233. <br /><br />
  234. [<a href='friendslist.php?action=add&ID={$r['userid']}'>Add Friends</a>]
  235. <br /><br />
  236. [<a href='blacklist.php?action=add&ID={$r['userid']}'>Add Enemies</a>]
  237. <br />
  238. ";
  239. }
  240. echo "
  241. </td>
  242. <td>
  243. ";
  244. if (in_array($ir['user_level'], array(2, 3, 5)))
  245. {
  246. $r['lastiph'] = @gethostbyaddr($r['lastip']);
  247. $r['lastiph'] = checkblank($r['lastiph']);
  248. $r['lastip_loginh'] = @gethostbyaddr($r['lastip_login']);
  249. $r['lastip_loginh'] = checkblank($r['lastip_loginh']);
  250. $r['lastip_signuph'] = @gethostbyaddr($r['lastip_signup']);
  251. $r['lastip_signuph'] = checkblank($r['lastip_signuph']);
  252. echo "
  253. <h3>Internet Info</h3>
  254. <table width='100%' border='0' cellspacing='1' class='table'>
  255. <tr>
  256. <td></td>
  257. <td class='h'>IP</td>
  258. <td class='h'>Hostname</td>
  259. </tr>
  260. <tr>
  261. <td class='h'>Last Hit</td>
  262. <td>$r[lastip]</td>
  263. <td>$r[lastiph]</td>
  264. </tr>
  265. <tr>
  266. <td class='h'>Last Login</td>
  267. <td>$r[lastip_login]</td>
  268. <td>$r[lastip_loginh]</td>
  269. </tr>
  270. <tr>
  271. <td class='h'>Signup</td>
  272. <td>$r[lastip_signup]</td>
  273. <td>$r[lastip_signuph]</td>
  274. </tr>
  275. </table>
  276.  
  277. <form action='staffnotes.php' method='post'>
  278. Staff Notes:
  279. <br />
  280. <textarea rows=7 cols=40 name='staffnotes'>"
  281. . htmlentities($r['staffnotes'], ENT_QUOTES, 'ISO-8859-1')
  282. . "</textarea>
  283. <br />
  284. <input type='hidden' name='ID' value='{$_GET['u']}' />
  285. <input type='submit' value='Change' />
  286. </form>
  287. ";
  288. }
  289. echo '
  290. </tr>
  291. </table>
  292. ';
  293. }
  294. }
  295.  
  296. function checkblank($in)
  297. {
  298. if (!$in)
  299. {
  300. return "N/A";
  301. }
  302. return $in;
  303. }
  304. $h->endpage();
Advertisement
Add Comment
Please, Sign In to add comment