Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.php 54KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. <?
  2. if (empty($_GET['id']) || !is_number($_GET['id']) || (!empty($_GET['preview']) && !is_number($_GET['preview']))) {
  3. error(404);
  4. }
  5. $UserID = (int)$_GET['id'];
  6. $Preview = isset($_GET['preview']) ? $_GET['preview'] : 0;
  7. if ($UserID == $LoggedUser['ID']) {
  8. $OwnProfile = true;
  9. if ($Preview == 1) {
  10. $OwnProfile = false;
  11. $ParanoiaString = $_GET['paranoia'];
  12. $CustomParanoia = explode(',', $ParanoiaString);
  13. }
  14. } else {
  15. $OwnProfile = false;
  16. //Don't allow any kind of previewing on others' profiles
  17. $Preview = 0;
  18. }
  19. $EnabledRewards = Donations::get_enabled_rewards($UserID);
  20. $ProfileRewards = Donations::get_profile_rewards($UserID);
  21. if (check_perms('users_mod')) { // Person viewing is a staff member
  22. $DB->query("
  23. SELECT
  24. m.Username,
  25. m.Email,
  26. m.LastAccess,
  27. m.IP,
  28. p.Level AS Class,
  29. m.Uploaded,
  30. m.Downloaded,
  31. m.RequiredRatio,
  32. m.Title,
  33. m.torrent_pass,
  34. m.Enabled,
  35. m.Paranoia,
  36. m.Invites,
  37. m.can_leech,
  38. m.Visible,
  39. m.BonusPoints,
  40. m.IRCLines,
  41. i.JoinDate,
  42. i.Info,
  43. i.Avatar,
  44. i.AdminComment,
  45. i.Donor,
  46. i.Artist,
  47. i.Warned,
  48. i.SupportFor,
  49. i.RestrictedForums,
  50. i.PermittedForums,
  51. i.Inviter,
  52. inviter.Username,
  53. COUNT(posts.id) AS ForumPosts,
  54. i.RatioWatchEnds,
  55. i.RatioWatchDownload,
  56. i.DisableAvatar,
  57. i.DisableInvites,
  58. i.DisablePosting,
  59. i.DisableForums,
  60. i.DisableTagging,
  61. i.DisableUpload,
  62. i.DisableWiki,
  63. i.DisablePM,
  64. i.DisablePoints,
  65. i.DisablePromotion,
  66. i.DisableIRC,
  67. i.DisableRequests," . "
  68. m.FLTokens,
  69. SHA1(i.AdminComment),
  70. i.InfoTitle,
  71. la.Type AS LockedAccount
  72. FROM users_main AS m
  73. JOIN users_info AS i ON i.UserID = m.ID
  74. LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID
  75. LEFT JOIN permissions AS p ON p.ID = m.PermissionID
  76. LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID
  77. LEFT JOIN locked_accounts AS la ON la.UserID = m.ID
  78. WHERE m.ID = '$UserID'
  79. GROUP BY AuthorID");
  80. if (!$DB->has_results()) { // If user doesn't exist
  81. header("Location: log.php?search=User+$UserID");
  82. }
  83. list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $BonusPoints, $IRCLines, $JoinDate, $Info, $Avatar, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisablePoints, $DisablePromotion, $DisableIRC, $DisableRequests, $FLTokens, $CommentHash, $InfoTitle, $LockedAccount) = $DB->next_record(MYSQLI_NUM, array(8, 11));
  84. } else { // Person viewing is a normal user
  85. $DB->query("
  86. SELECT
  87. m.Username,
  88. m.Email,
  89. m.LastAccess,
  90. m.IP,
  91. p.Level AS Class,
  92. m.Uploaded,
  93. m.Downloaded,
  94. m.RequiredRatio,
  95. m.Enabled,
  96. m.Paranoia,
  97. m.Invites,
  98. m.Title,
  99. m.torrent_pass,
  100. m.can_leech,
  101. i.JoinDate,
  102. i.Info,
  103. i.Avatar,
  104. m.FLTokens,
  105. m.BonusPoints,
  106. m.IRCLines,
  107. i.Donor,
  108. i.Warned,
  109. COUNT(posts.id) AS ForumPosts,
  110. i.Inviter,
  111. i.DisableInvites,
  112. inviter.username,
  113. i.InfoTitle
  114. FROM users_main AS m
  115. JOIN users_info AS i ON i.UserID = m.ID
  116. LEFT JOIN permissions AS p ON p.ID = m.PermissionID
  117. LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID
  118. LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID
  119. WHERE m.ID = $UserID
  120. GROUP BY AuthorID");
  121. if (!$DB->has_results()) { // If user doesn't exist
  122. header("Location: log.php?search=User+$UserID");
  123. }
  124. list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded,
  125. $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass,
  126. $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $BonusPoints, $IRCLines, $Donor, $Warned,
  127. $ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(9, 11));
  128. }
  129. $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
  130. $DB->query("
  131. SELECT SUM(t.Size)
  132. FROM xbt_files_users AS xfu
  133. JOIN torrents AS t on t.ID = xfu.fid
  134. WHERE
  135. xfu.uid = '$UserID'
  136. AND xfu.active = 1
  137. AND xfu.Remaining = 0");
  138. if ($DB->has_results()) {
  139. list($TotalSeeding) = $DB->next_record(MYSQLI_NUM, false);
  140. }
  141. // Image proxy CTs
  142. $DisplayCustomTitle = $CustomTitle;
  143. if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
  144. $DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
  145. function($Matches) {
  146. return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
  147. }, $CustomTitle);
  148. }
  149. if ($Preview == 1) {
  150. if (strlen($ParanoiaString) == 0) {
  151. $Paranoia = array();
  152. } else {
  153. $Paranoia = $CustomParanoia;
  154. }
  155. } else {
  156. $Paranoia = unserialize($Paranoia);
  157. if (!is_array($Paranoia)) {
  158. $Paranoia = array();
  159. }
  160. }
  161. $ParanoiaLevel = 0;
  162. foreach ($Paranoia as $P) {
  163. $ParanoiaLevel++;
  164. if (strpos($P, '+') !== false) {
  165. $ParanoiaLevel++;
  166. }
  167. }
  168. $JoinedDate = time_diff($JoinDate);
  169. $LastAccess = time_diff($LastAccess);
  170. function check_paranoia_here($Setting) {
  171. global $Paranoia, $Class, $UserID, $Preview;
  172. if ($Preview == 1) {
  173. return check_paranoia($Setting, $Paranoia, $Class);
  174. } else {
  175. return check_paranoia($Setting, $Paranoia, $Class, $UserID);
  176. }
  177. }
  178. View::show_header($Username, "jquery.imagesloaded,user,bbcode,requests,comments,info_paster,wall");
  179. ?>
  180. <div class="thin">
  181. <div class="header">
  182. <h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2>
  183. </div>
  184. <div class="linkbox">
  185. <?
  186. if (!$OwnProfile) {
  187. ?>
  188. <a href="inbox.php?action=compose&amp;to=<?=$UserID?>" class="brackets">Send message</a>
  189. <?
  190. $DB->query("
  191. SELECT FriendID
  192. FROM friends
  193. WHERE UserID = '$LoggedUser[ID]'
  194. AND FriendID = '$UserID'");
  195. if (!$DB->has_results()) {
  196. ?>
  197. <a href="friends.php?action=add&amp;friendid=<?=$UserID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Add to friends</a>
  198. <? } ?>
  199. <a href="reports.php?action=report&amp;type=user&amp;id=<?=$UserID?>" class="brackets">Report user</a>
  200. <?
  201. }
  202. if (check_perms('users_edit_profiles', $Class) || $LoggedUser['ID'] == $UserID) {
  203. ?>
  204. <a href="user.php?action=edit&amp;userid=<?=$UserID?>" class="brackets">Settings</a>
  205. <?
  206. }
  207. if ($LoggedUser['ID'] == $UserID) {
  208. ?>
  209. <a href="userhistory.php?action=useremail&userid=<?=$UserID?>" class="brackets">Email History</a>
  210. <?
  211. }
  212. if (check_perms('users_view_invites', $Class)) {
  213. ?>
  214. <a href="user.php?action=invite&amp;userid=<?=$UserID?>" class="brackets">Invites</a>
  215. <?
  216. }
  217. if (check_perms('admin_manage_permissions', $Class)) {
  218. ?>
  219. <a href="user.php?action=permissions&amp;userid=<?=$UserID?>" class="brackets">Permissions</a>
  220. <?
  221. }
  222. if (check_perms('users_view_ips', $Class)) {
  223. ?>
  224. <a href="user.php?action=sessions&amp;userid=<?=$UserID?>" class="brackets">Sessions</a>
  225. <?
  226. }
  227. if (check_perms('admin_reports')) {
  228. ?>
  229. <a href="reportsv2.php?view=reporter&amp;id=<?=$UserID?>" class="brackets">Reports</a>
  230. <?
  231. }
  232. if (check_perms('users_mod')) {
  233. ?>
  234. <a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>" class="brackets">FL tokens</a>
  235. <?
  236. }
  237. if (check_perms('admin_clear_cache') && check_perms('users_override_paranoia')) {
  238. ?>
  239. <a href="user.php?action=clearcache&amp;id=<?=$UserID?>" class="brackets">Clear cache</a>
  240. <?
  241. }
  242. if (check_perms('users_mod')) {
  243. ?>
  244. <a href="#staff_tools" class="brackets">Jump to staff tools</a>
  245. <?
  246. }
  247. ?>
  248. </div>
  249. <div class="sidebar">
  250. <?
  251. if ($Avatar && Users::has_avatars_enabled()) {
  252. ?>
  253. <div class="box box_image box_image_avatar">
  254. <div class="head colhead_dark">User</div>
  255. <div class="avatar" align="center">
  256. <?= Users::show_avatar($Avatar, $UserID, $Username, $HeavyInfo['DisableAvatars'])?>
  257. </div>
  258. </div>
  259. <? }
  260. $Badges = Badges::get_badges($UserID);
  261. if (!empty($Badges)) { ?>
  262. <div class="box">
  263. <div class="head colhead_dark">Badges</div>
  264. <div class="pad">
  265. <?=Badges::display_badges($Badges, true)?>
  266. </div>
  267. </div>
  268. <?
  269. }
  270. if (!$OwnProfile && !$LoggedUser['DisablePoints']) { ?>
  271. <div class='box point_gift_box'>
  272. <div class='head colhead_dark'>Send <?=BONUS_POINTS?></div>
  273. <div class="pad">
  274. <form action='user.php' method='post'>
  275. <input type='hidden' name='action' value='points' />
  276. <input type='hidden' name='to' value='<?=$UserID?>' />
  277. <input type='text' name='amount' placeholder='Amount' /><input type='submit' value='Send' /><br>
  278. <textarea name='message' rows='2' placeholder='Message'></textarea><br>
  279. <input type='checkbox' name='adjust' /> Adjust for tax?
  280. </form>
  281. <p>Note: 10% of your gift is taken as tax.</p>
  282. </div>
  283. </div>
  284. <?
  285. }
  286. $DB->query("
  287. SELECT u.Username
  288. FROM slaves AS s
  289. LEFT JOIN users_main AS u ON u.ID = s.OwnerID
  290. WHERE s.UserID = $UserID");
  291. if ($LoggedUser['Class'] >= 200 || $DB->has_results()) { ?>
  292. <div class='box ownership_box'>
  293. <div class='head colhead_dark'>Ownership</div>
  294. <div class="pad">
  295. <? if ($DB->has_results()) { ?>
  296. <p>This user is owned by <?=($DB->next_record()['Username'])?></p>
  297. <? } else {
  298. $DB->query("
  299. SELECT u.Uploaded, u.Downloaded, u.BonusPoints, COUNT(t.UserID)
  300. FROM users_main AS u
  301. LEFT JOIN torrents AS t ON u.ID=t.UserID
  302. WHERE u.ID = $UserID");
  303. list($Upload, $Download, $Points, $Uploads) = $DB->next_record();
  304. $Level = intval(((($Uploads**0.35)*1.5)+1) * max(($Upload+($Points*1000000)-$Download)/(1024**3), 1));
  305. ?>
  306. <p>This user is wild and level <?=$Level?></p>
  307. <? if (!$OwnProfile) { ?>
  308. <p>Try to capture them with <?=BONUS_POINTS?>? The more you spend, the higher the chance of capture</p>
  309. <form action='store.php' method='post'>
  310. <input type='hidden' name='item' value='capture_user' />
  311. <input type='hidden' name='target' value='<?=$UserID?>' />
  312. <input type='text' name='amount' placeholder='<?=BONUS_POINTS?>' /><input type='submit' value='Capture' />
  313. </form>
  314. <? }
  315. } ?>
  316. </div>
  317. </div>
  318. <? } ?>
  319. <div class="box box_info box_userinfo_stats">
  320. <div class="head colhead_dark">Statistics</div>
  321. <ul class="stats nobullet">
  322. <li>Joined: <?=$JoinedDate?></li>
  323. <? if (($Override = check_paranoia_here('lastseen'))) { ?>
  324. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Last seen: <?=$LastAccess?></li>
  325. <?
  326. }
  327. if (($Override = check_paranoia_here('uploaded'))) {
  328. ?>
  329. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
  330. <?
  331. }
  332. if (($Override = check_paranoia_here('downloaded'))) {
  333. ?>
  334. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
  335. <?
  336. }
  337. if (($Override = check_paranoia_here('ratio'))) {
  338. ?>
  339. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
  340. <?
  341. }
  342. if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) {
  343. ?>
  344. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Required Ratio: <span class="tooltip" title="<?=number_format((double)$RequiredRatio, 5)?>"><?=number_format((double)$RequiredRatio, 2)?></span></li>
  345. <?
  346. }
  347. if (($Override = check_paranoia_here('downloaded'))) {
  348. ?>
  349. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Total Seeding: <span class="tooltip" title="<?=Format::get_size($TotalSeeding)?>"><?=Format::get_size($TotalSeeding)?></li>
  350. <?
  351. }
  352. if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) {
  353. ?>
  354. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
  355. <?
  356. }
  357. if (($OwnProfile || check_perms('users_mod')) && $Warned != '0000-00-00 00:00:00') {
  358. ?>
  359. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
  360. <? } ?>
  361. </ul>
  362. </div>
  363. <?
  364. if (check_paranoia_here('requestsfilled_count') || check_paranoia_here('requestsfilled_bounty')) {
  365. $DB->query("
  366. SELECT
  367. COUNT(DISTINCT r.ID),
  368. SUM(rv.Bounty)
  369. FROM requests AS r
  370. LEFT JOIN requests_votes AS rv ON r.ID = rv.RequestID
  371. WHERE r.FillerID = $UserID");
  372. list($RequestsFilled, $TotalBounty) = $DB->next_record();
  373. } else {
  374. $RequestsFilled = $TotalBounty = 0;
  375. }
  376. if (check_paranoia_here('requestsvoted_count') || check_paranoia_here('requestsvoted_bounty')) {
  377. $DB->query("
  378. SELECT COUNT(RequestID), SUM(Bounty)
  379. FROM requests_votes
  380. WHERE UserID = $UserID");
  381. list($RequestsVoted, $TotalSpent) = $DB->next_record();
  382. $DB->query("
  383. SELECT COUNT(r.ID), SUM(rv.Bounty)
  384. FROM requests AS r
  385. LEFT JOIN requests_votes AS rv ON rv.RequestID = r.ID AND rv.UserID = r.UserID
  386. WHERE r.UserID = $UserID");
  387. list($RequestsCreated, $RequestsCreatedSpent) = $DB->next_record();
  388. } else {
  389. $RequestsVoted = $TotalSpent = $RequestsCreated = $RequestsCreatedSpent = 0;
  390. }
  391. if (check_paranoia_here('uploads+')) {
  392. $DB->query("
  393. SELECT COUNT(ID)
  394. FROM torrents
  395. WHERE UserID = '$UserID'");
  396. list($Uploads) = $DB->next_record();
  397. } else {
  398. $Uploads = 0;
  399. }
  400. if (check_paranoia_here('artistsadded')) {
  401. $DB->query("
  402. SELECT COUNT(DISTINCT ArtistID)
  403. FROM torrents_artists
  404. WHERE UserID = $UserID");
  405. list($ArtistsAdded) = $DB->next_record();
  406. } else {
  407. $ArtistsAdded = 0;
  408. }
  409. //Do the ranks
  410. $UploadedRank = UserRank::get_rank('uploaded', $Uploaded);
  411. $DownloadedRank = UserRank::get_rank('downloaded', $Downloaded);
  412. $UploadsRank = UserRank::get_rank('uploads', $Uploads);
  413. $RequestRank = UserRank::get_rank('requests', $RequestsFilled);
  414. $PostRank = UserRank::get_rank('posts', $ForumPosts);
  415. $BountyRank = UserRank::get_rank('bounty', $TotalSpent);
  416. $ArtistsRank = UserRank::get_rank('artists', $ArtistsAdded);
  417. if ($Downloaded == 0) {
  418. $Ratio = 1;
  419. } elseif ($Uploaded == 0) {
  420. $Ratio = 0.5;
  421. } else {
  422. $Ratio = round($Uploaded / $Downloaded, 2);
  423. }
  424. $OverallRank = UserRank::overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio);
  425. ?>
  426. <div class="box box_info box_userinfo_percentile">
  427. <div class="head colhead_dark">Percentile Rankings (hover for values)</div>
  428. <ul class="stats nobullet">
  429. <? if (($Override = check_paranoia_here('uploaded'))) { ?>
  430. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Uploaded)?>">Data uploaded: <?=$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?></li>
  431. <?
  432. }
  433. if (($Override = check_paranoia_here('downloaded'))) { ?>
  434. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Downloaded)?>">Data downloaded: <?=$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?></li>
  435. <?
  436. }
  437. if (($Override = check_paranoia_here('uploads+'))) { ?>
  438. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($Uploads)?>">Torrents uploaded: <?=$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?></li>
  439. <?
  440. }
  441. if (($Override = check_paranoia_here('requestsfilled_count'))) { ?>
  442. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($RequestsFilled)?>">Requests filled: <?=$RequestRank === false ? 'Server busy' : number_format($RequestRank)?></li>
  443. <?
  444. }
  445. if (($Override = check_paranoia_here('requestsvoted_bounty'))) { ?>
  446. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($TotalSpent)?>">Bounty spent: <?=$BountyRank === false ? 'Server busy' : number_format($BountyRank)?></li>
  447. <? } ?>
  448. <li class="tooltip" title="<?=number_format($ForumPosts)?>">Posts made: <?=$PostRank === false ? 'Server busy' : number_format($PostRank)?></li>
  449. <? if (($Override = check_paranoia_here('artistsadded'))) { ?>
  450. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($ArtistsAdded)?>">Artists added: <?=$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?></li>
  451. <?
  452. }
  453. if (check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) { ?>
  454. <li><strong>Overall rank: <?=$OverallRank === false ? 'Server busy' : number_format($OverallRank)?></strong></li>
  455. <? } ?>
  456. </ul>
  457. </div>
  458. <?
  459. if (check_perms('users_mod', $Class) || check_perms('users_view_ips', $Class) || check_perms('users_view_keys', $Class)) {
  460. $DB->query("
  461. SELECT COUNT(*)
  462. FROM users_history_passwords
  463. WHERE UserID = '$UserID'");
  464. list($PasswordChanges) = $DB->next_record();
  465. if (check_perms('users_view_keys', $Class)) {
  466. $DB->query("
  467. SELECT COUNT(*)
  468. FROM users_history_passkeys
  469. WHERE UserID = '$UserID'");
  470. list($PasskeyChanges) = $DB->next_record();
  471. }
  472. if (check_perms('users_view_ips', $Class)) {
  473. $DB->query("
  474. SELECT COUNT(DISTINCT IP)
  475. FROM users_history_ips
  476. WHERE UserID = '$UserID'");
  477. list($IPChanges) = $DB->next_record();
  478. $DB->query("
  479. SELECT COUNT(DISTINCT IP)
  480. FROM xbt_snatched
  481. WHERE uid = '$UserID'
  482. AND IP != ''");
  483. list($TrackerIPs) = $DB->next_record();
  484. }
  485. if (check_perms('users_view_email', $Class)) {
  486. $DB->query("
  487. SELECT COUNT(*)
  488. FROM users_history_emails
  489. WHERE UserID = '$UserID'");
  490. list($EmailChanges) = $DB->next_record();
  491. }
  492. ?>
  493. <div class="box box_info box_userinfo_history">
  494. <div class="head colhead_dark">History</div>
  495. <ul class="stats nobullet">
  496. <? if (check_perms('users_view_email', $Class)) { ?>
  497. <li>Emails: <?=number_format($EmailChanges)?> <a href="userhistory.php?action=email2&amp;userid=<?=$UserID?>" class="brackets">View</a>&nbsp;<a href="userhistory.php?action=email&amp;userid=<?=$UserID?>" class="brackets">Legacy view</a></li>
  498. <?
  499. }
  500. if (check_perms('users_view_ips', $Class)) {
  501. ?>
  502. <li>IPs: <?=number_format($IPChanges)?> <a href="userhistory.php?action=ips&amp;userid=<?=$UserID?>" class="brackets">View</a>&nbsp;<a href="userhistory.php?action=ips&amp;userid=<?=$UserID?>&amp;usersonly=1" class="brackets">View users</a></li>
  503. <? if (check_perms('users_view_ips', $Class) && check_perms('users_mod', $Class)) { ?>
  504. <li>Tracker IPs: <?=number_format($TrackerIPs)?> <a href="userhistory.php?action=tracker_ips&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  505. <?
  506. }
  507. }
  508. if (check_perms('users_view_keys', $Class)) {
  509. ?>
  510. <li>Passkeys: <?=number_format($PasskeyChanges)?> <a href="userhistory.php?action=passkeys&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  511. <?
  512. }
  513. if (check_perms('users_mod', $Class)) {
  514. ?>
  515. <li>Passwords: <?=number_format($PasswordChanges)?> <a href="userhistory.php?action=passwords&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  516. <li>Stats: N/A <a href="userhistory.php?action=stats&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  517. <? } ?>
  518. </ul>
  519. </div>
  520. <? } ?>
  521. <div class="box box_info box_userinfo_personal">
  522. <div class="head colhead_dark">Personal</div>
  523. <ul class="stats nobullet">
  524. <li>Class: <?=$ClassLevels[$Class]['Name']?></li>
  525. <?
  526. $UserInfo = Users::user_info($UserID);
  527. if (!empty($UserInfo['ExtraClasses'])) {
  528. ?>
  529. <li>
  530. <ul class="stats">
  531. <?
  532. foreach ($UserInfo['ExtraClasses'] as $PermID => $Val) {
  533. ?>
  534. <li><?=$Classes[$PermID]['Name']?></li>
  535. <? } ?>
  536. </ul>
  537. </li>
  538. <?
  539. }
  540. // An easy way for people to measure the paranoia of a user, for e.g. contest eligibility
  541. if ($ParanoiaLevel == 0) {
  542. $ParanoiaLevelText = 'Off';
  543. } elseif ($ParanoiaLevel == 1) {
  544. $ParanoiaLevelText = 'Very Low';
  545. } elseif ($ParanoiaLevel <= 5) {
  546. $ParanoiaLevelText = 'Low';
  547. } elseif ($ParanoiaLevel <= 20) {
  548. $ParanoiaLevelText = 'High';
  549. } else {
  550. $ParanoiaLevelText = 'Very high';
  551. }
  552. ?>
  553. <li>Paranoia level: <span class="tooltip" title="<?=$ParanoiaLevel?>"><?=$ParanoiaLevelText?></span></li>
  554. <? if (check_perms('users_view_email', $Class) || $OwnProfile) { ?>
  555. <li>Email: <a href="mailto:<?=display_str($Email)?>"><?=display_str($Email)?></a>
  556. <? if (check_perms('users_view_email', $Class)) { ?>
  557. <a href="user.php?action=search&amp;email_history=on&amp;email=<?=display_str($Email)?>" title="Search" class="brackets tooltip">S</a>
  558. <? } ?>
  559. </li>
  560. <? }
  561. if (check_perms('users_view_ips', $Class)) {
  562. $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  563. ?>
  564. <li>IP: <?=Tools::display_ip($IP)?></li>
  565. <li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
  566. <?
  567. }
  568. if (check_perms('users_view_keys', $Class) || $OwnProfile) {
  569. ?>
  570. <li>Passkey: <a href="#" id="passkey" onclick="togglePassKey('<?=display_str($torrent_pass)?>'); return false;" class="brackets">View</a></li>
  571. <?
  572. }
  573. if (check_perms('users_view_invites')) {
  574. if (!$InviterID) {
  575. $Invited = '<span style="font-style: italic;">Nobody</span>';
  576. } else {
  577. $Invited = "<a href=\"user.php?id=$InviterID\">$InviterName</a>";
  578. }
  579. ?>
  580. <li>Invited by: <?=$Invited?></li>
  581. <li>Invites: <?
  582. $DB->query("
  583. SELECT COUNT(InviterID)
  584. FROM invites
  585. WHERE InviterID = '$UserID'");
  586. list($Pending) = $DB->next_record();
  587. if ($DisableInvites) {
  588. echo 'X';
  589. } else {
  590. echo number_format($Invites);
  591. }
  592. echo " ($Pending)"
  593. ?></li>
  594. <?
  595. }
  596. if (!isset($SupportFor)) {
  597. $DB->query('
  598. SELECT SupportFor
  599. FROM users_info
  600. WHERE UserID = '.$LoggedUser['ID']);
  601. list($SupportFor) = $DB->next_record();
  602. }
  603. if ($Override = check_perms('users_mod') || $OwnProfile || !empty($SupportFor)) {
  604. ?>
  605. <li<?=(($Override === 2 || $SupportFor) ? ' class="paranoia_override"' : '')?>>Clients: <?
  606. $DB->query("
  607. SELECT DISTINCT useragent
  608. FROM xbt_files_users
  609. WHERE uid = $UserID");
  610. $Clients = $DB->collect(0);
  611. echo implode('; ', $Clients);
  612. ?></li>
  613. <?
  614. }
  615. ?>
  616. </ul>
  617. </div>
  618. <?
  619. include(SERVER_ROOT.'/sections/user/community_stats.php');
  620. DonationsView::render_donor_stats($UserID);
  621. ?>
  622. </div>
  623. <div class="main_column">
  624. <?
  625. if ($RatioWatchEnds != '0000-00-00 00:00:00'
  626. && (time() < strtotime($RatioWatchEnds))
  627. && ($Downloaded * $RequiredRatio) > $Uploaded
  628. ) {
  629. ?>
  630. <div class="box">
  631. <div class="head">Ratio watch</div>
  632. <div class="pad">This user is currently on ratio watch and must upload <?=Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded)?> in the next <?=time_diff($RatioWatchEnds)?>, or their leeching privileges will be revoked. Amount downloaded while on ratio watch: <?=Format::get_size($Downloaded - $RatioWatchDownload)?></div>
  633. </div>
  634. <?
  635. }
  636. ?>
  637. <div class="box">
  638. <div class="head">
  639. <?=!empty($InfoTitle) ? $InfoTitle : 'Profile';?>
  640. <span style="float: right;"><a toggle-target="#profilediv" toggle-replace="Show" class="brackets">Hide</a></span>&nbsp;
  641. </div>
  642. <div class="pad profileinfo" id="profilediv">
  643. <?
  644. if (!$Info) {
  645. ?>
  646. This profile is currently empty.
  647. <?
  648. } else {
  649. echo Text::full_format($Info);
  650. }
  651. ?>
  652. </div>
  653. </div>
  654. <?
  655. DonationsView::render_profile_rewards($EnabledRewards, $ProfileRewards);
  656. if (check_paranoia_here('snatched')) {
  657. $RecentSnatches = $Cache->get_value("recent_snatches_$UserID");
  658. if ($RecentSnatches === false) {
  659. $DB->query("
  660. SELECT
  661. g.ID,
  662. g.Name,
  663. g.WikiImage
  664. FROM xbt_snatched AS s
  665. INNER JOIN torrents AS t ON t.ID = s.fid
  666. INNER JOIN torrents_group AS g ON t.GroupID = g.ID
  667. WHERE s.uid = '$UserID'
  668. AND g.WikiImage != ''
  669. GROUP BY g.ID
  670. ORDER BY s.tstamp DESC
  671. LIMIT 5");
  672. $RecentSnatches = $DB->to_array();
  673. $Artists = Artists::get_artists($DB->collect('ID'));
  674. foreach ($RecentSnatches as $Key => $SnatchInfo) {
  675. $RecentSnatches[$Key]['Artist'] = Artists::display_artists($Artists[$SnatchInfo['ID']], false, true);
  676. }
  677. $Cache->cache_value("recent_snatches_$UserID", $RecentSnatches, 0); //inf cache
  678. }
  679. if (!empty($RecentSnatches)) {
  680. ?>
  681. <div class="box" id="recent_snatches">
  682. <div class="head">
  683. Recent Snatches
  684. <span style="float: right;"><a onclick="$('#recent_snatches_images').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); wall('#recent_snatches_images', '.collage_image', [2,3]); return false;" class="brackets">Show</a></span>&nbsp;
  685. </div>
  686. <div id="recent_snatches_images" class="collage_images hidden">
  687. <? foreach ($RecentSnatches as $RS) { ?>
  688. <div style='width: 100px;' class='collage_image' >
  689. <a href="torrents.php?id=<?=$RS['ID']?>">
  690. <img class="tooltip" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="100%" />
  691. </a>
  692. </div>
  693. <? } ?>
  694. </div>
  695. </div>
  696. <?
  697. }
  698. }
  699. if (check_paranoia_here('uploads')) {
  700. $RecentUploads = $Cache->get_value("recent_uploads_$UserID");
  701. if ($RecentUploads === false) {
  702. $DB->query("
  703. SELECT
  704. g.ID,
  705. g.Name,
  706. g.WikiImage
  707. FROM torrents_group AS g
  708. INNER JOIN torrents AS t ON t.GroupID = g.ID
  709. WHERE t.UserID = '$UserID'
  710. AND g.WikiImage != ''
  711. GROUP BY g.ID
  712. ORDER BY t.Time DESC
  713. LIMIT 5");
  714. $RecentUploads = $DB->to_array();
  715. $Artists = Artists::get_artists($DB->collect('ID'));
  716. foreach ($RecentUploads as $Key => $UploadInfo) {
  717. $RecentUploads[$Key]['Artist'] = Artists::display_artists($Artists[$UploadInfo['ID']], false, true);
  718. }
  719. $Cache->cache_value("recent_uploads_$UserID", $RecentUploads, 0); //inf cache
  720. }
  721. if (!empty($RecentUploads)) {
  722. ?>
  723. <div class="box" id="recent_uploads">
  724. <div class="head">
  725. Recent Uploads
  726. <span style="float: right;"><a onclick="$('#recent_uploads_images').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); wall('#recent_uploads_images', '.collage_image', [2,3]); return false;" class="brackets">Show</a></span>&nbsp;
  727. </div>
  728. <div id="recent_uploads_images" class="collage_images hidden">
  729. <? foreach ($RecentUploads as $RU) { ?>
  730. <div style='width: 100px;' class='collage_image' >
  731. <a href="torrents.php?id=<?=$RU['ID']?>">
  732. <img class="tooltip" title="<?=$RU['Artist']?><?=$RU['Name']?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="100%" />
  733. </a>
  734. </div>
  735. <? } ?>
  736. </div>
  737. </div>
  738. <?
  739. }
  740. }
  741. $DB->query("
  742. SELECT ID, Name
  743. FROM collages
  744. WHERE UserID = '$UserID'
  745. AND CategoryID = '0'
  746. AND Deleted = '0'
  747. ORDER BY Featured DESC,
  748. Name ASC");
  749. $Collages = $DB->to_array(false, MYSQLI_NUM, false);
  750. foreach ($Collages as $CollageInfo) {
  751. list($CollageID, $CName) = $CollageInfo;
  752. $DB->query("
  753. SELECT ct.GroupID,
  754. tg.WikiImage,
  755. tg.CategoryID
  756. FROM collages_torrents AS ct
  757. JOIN torrents_group AS tg ON tg.ID = ct.GroupID
  758. WHERE ct.CollageID = '$CollageID'
  759. ORDER BY ct.Sort
  760. LIMIT 5");
  761. $Collage = $DB->to_array(false, MYSQLI_ASSOC, false);
  762. ?>
  763. <div class="box" id="collage<?=$CollageID?>_box">
  764. <div class="head">
  765. <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
  766. <span style="float: right;">
  767. <a toggle-target="#collage<?=$CollageID?>_box .collage_images" toggle-replace="Show" class="brackets">Hide</a>
  768. </span>
  769. </div>
  770. <div id="user_collage_images" class="collage_images">
  771. <? foreach ($Collage as $C) {
  772. $Group = Torrents::get_groups(array($C['GroupID']), true, true, false);
  773. extract(Torrents::array_group($Group[$C['GroupID']]));
  774. if (!$C['WikiImage']) {
  775. $C['WikiImage'] = STATIC_SERVER.'common/noartwork/nocover.png';
  776. }
  777. $Name = '';
  778. $Name .= Artists::display_artists($Artists, false, true);
  779. $Name .= $GroupName;
  780. ?>
  781. <div class="collage_image">
  782. <a href="torrents.php?id=<?=$GroupID?>">
  783. <img class="tooltip" title="<?=$Name?>" src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="100%" />
  784. </a>
  785. </div>
  786. <? } ?>
  787. </div>
  788. <script>
  789. $('#user_collage_images .collage_image img').load(function() {
  790. var test = true
  791. $('#user_collage_images .collage_image img').toArray().forEach(function(el) {
  792. if (!el.complete) test = false
  793. })
  794. if (test) wall('#user_collage_images', '.collage_image', 5)
  795. })
  796. wall('#user_collage_images','.collage_image',5)
  797. </script>
  798. </div>
  799. <?
  800. }
  801. ?>
  802. <!-- for the "jump to staff tools" button -->
  803. <a id="staff_tools"></a>
  804. <?
  805. // Linked accounts
  806. if (check_perms('users_mod')) {
  807. include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
  808. user_dupes_table($UserID);
  809. }
  810. if ((check_perms('users_view_invites')) && $Invited > 0) {
  811. include(SERVER_ROOT.'/classes/invite_tree.class.php');
  812. $Tree = new INVITE_TREE($UserID, array('visible' => false));
  813. ?>
  814. <div class="box" id="invitetree_box">
  815. <div class="head">
  816. Invite Tree <span style="float: right"><a toggle-target="#invitetree" class="brackets">Toggle</a></span>
  817. </div>
  818. <div id="invitetree" class="hidden">
  819. <? $Tree->make_tree(); ?>
  820. </div>
  821. </div>
  822. <?
  823. }
  824. if (check_perms('users_mod')) {
  825. DonationsView::render_donation_history(Donations::get_donation_history($UserID));
  826. }
  827. // Requests
  828. if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) {
  829. $SphQL = new SphinxqlQuery();
  830. $SphQLResult = $SphQL->select('id, votes, bounty')
  831. ->from('requests, requests_delta')
  832. ->where('userid', $UserID)
  833. ->where('torrentid', 0)
  834. ->order_by('votes', 'desc')
  835. ->order_by('bounty', 'desc')
  836. ->limit(0, 100, 100) // Limit to 100 requests
  837. ->query();
  838. if ($SphQLResult->has_results()) {
  839. $SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC);
  840. ?>
  841. <div class="box" id="requests_box">
  842. <div class="head">
  843. Requests <span style="float: right;"><a toggle-target="#requests" class="brackets">Show</a></span>
  844. </div>
  845. <div id="requests" class="hidden">
  846. <table cellpadding="6" cellspacing="1" border="0" width="100%">
  847. <tr class="colhead_dark">
  848. <td style="width: 48%;">
  849. <strong>Request Name</strong>
  850. </td>
  851. <td>
  852. <strong>Vote</strong>
  853. </td>
  854. <td>
  855. <strong>Bounty</strong>
  856. </td>
  857. <td>
  858. <strong>Added</strong>
  859. </td>
  860. </tr>
  861. <?
  862. $Requests = Requests::get_requests(array_keys($SphRequests));
  863. foreach ($SphRequests as $RequestID => $SphRequest) {
  864. $Request = $Requests[$RequestID];
  865. $VotesCount = $SphRequest['votes'];
  866. $Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
  867. $CategoryName = $Categories[$Request['CategoryID'] - 1];
  868. if ($CategoryName == 'Music') {
  869. $ArtistForm = Requests::get_artists($RequestID);
  870. $ArtistLink = Artists::display_artists($ArtistForm, true, true);
  871. $FullName = "$ArtistLink<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  872. } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
  873. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  874. } else {
  875. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title]</a>";
  876. }
  877. ?>
  878. <tr class="row">
  879. <td>
  880. <?=$FullName ?>
  881. <div class="tags">
  882. <?
  883. $Tags = $Request['Tags'];
  884. $TagList = array();
  885. foreach ($Tags as $TagID => $TagName) {
  886. $TagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
  887. }
  888. $TagList = implode(', ', $TagList);
  889. ?>
  890. <?=$TagList?>
  891. </div>
  892. </td>
  893. <td>
  894. <span id="vote_count_<?=$RequestID?>"><?=$VotesCount?></span>
  895. <? if (check_perms('site_vote')) { ?>
  896. &nbsp;&nbsp; <a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets">+</a>
  897. <? } ?>
  898. </td>
  899. <td>
  900. <span id="bounty_<?=$RequestID?>"><?=Format::get_size($Bounty)?></span>
  901. </td>
  902. <td>
  903. <?=time_diff($Request['TimeAdded']) ?>
  904. </td>
  905. </tr>
  906. <? } ?>
  907. </table>
  908. </div>
  909. </div>
  910. <?
  911. }
  912. }
  913. $IsFLS = isset($LoggedUser['ExtraClasses'][FLS_TEAM]);
  914. if (check_perms('users_mod', $Class) || $IsFLS) {
  915. $UserLevel = $LoggedUser['EffectiveClass'];
  916. $DB->query("
  917. SELECT
  918. SQL_CALC_FOUND_ROWS
  919. ID,
  920. Subject,
  921. Status,
  922. Level,
  923. AssignedToUser,
  924. Date,
  925. ResolverID
  926. FROM staff_pm_conversations
  927. WHERE UserID = $UserID
  928. AND (Level <= $UserLevel OR AssignedToUser = '".$LoggedUser['ID']."')
  929. ORDER BY Date DESC");
  930. if ($DB->has_results()) {
  931. $StaffPMs = $DB->to_array();
  932. ?>
  933. <div class="box" id="staffpms_box">
  934. <div class="head">
  935. Staff PMs <a toggle-target="#staffpms" class="brackets" style="float:right;">Toggle</a>
  936. </div>
  937. <table width="100%" class="message_table hidden" id="staffpms">
  938. <tr class="colhead">
  939. <td>Subject</td>
  940. <td>Date</td>
  941. <td>Assigned to</td>
  942. <td>Resolved by</td>
  943. </tr>
  944. <?
  945. foreach ($StaffPMs as $StaffPM) {
  946. list($ID, $Subject, $Status, $Level, $AssignedToUser, $Date, $ResolverID) = $StaffPM;
  947. // Get assigned
  948. if ($AssignedToUser == '') {
  949. // Assigned to class
  950. $Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
  951. // No + on Sysops
  952. if ($Assigned != 'Sysop') {
  953. $Assigned .= '+';
  954. }
  955. } else {
  956. // Assigned to user
  957. $Assigned = Users::format_username($UserID, true, true, true, true);
  958. }
  959. if ($ResolverID) {
  960. $Resolver = Users::format_username($ResolverID, true, true, true, true);
  961. } else {
  962. $Resolver = '(unresolved)';
  963. }
  964. ?>
  965. <tr>
  966. <td><a href="staffpm.php?action=viewconv&amp;id=<?=$ID?>"><?=display_str($Subject)?></a></td>
  967. <td><?=time_diff($Date, 2, true)?></td>
  968. <td><?=$Assigned?></td>
  969. <td><?=$Resolver?></td>
  970. </tr>
  971. <? } ?>
  972. </table>
  973. </div>
  974. <?
  975. }
  976. }
  977. // Displays a table of forum warnings viewable only to Forum Moderators
  978. if ($LoggedUser['Class'] == 650 && check_perms('users_warn', $Class)) {
  979. $DB->query("
  980. SELECT Comment
  981. FROM users_warnings_forums
  982. WHERE UserID = '$UserID'");
  983. list($ForumWarnings) = $DB->next_record();
  984. if ($DB->has_results()) {
  985. ?>
  986. <div class="box">
  987. <div class="head">Forum warnings</div>
  988. <div class="pad">
  989. <div id="forumwarningslinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($ForumWarnings)?></div>
  990. </div>
  991. </div>
  992. <?
  993. }
  994. }
  995. if (check_perms('users_mod', $Class)) { ?>
  996. <form class="manage_form" name="user" id="form" action="user.php" method="post">
  997. <input type="hidden" name="action" value="moderate" />
  998. <input type="hidden" name="userid" value="<?=$UserID?>" />
  999. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  1000. <div class="box box2" id="staff_notes_box">
  1001. <div class="head">
  1002. Staff Notes
  1003. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
  1004. <span style="float: right;">
  1005. <a toggle-target="#staffnotes" class="brackets">Toggle</a>
  1006. </span>
  1007. </div>
  1008. <div id="staffnotes" class="pad">
  1009. <input type="hidden" name="comment_hash" value="<?=$CommentHash?>" />
  1010. <div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($AdminComment)?></div>
  1011. <textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?=display_str($AdminComment)?></textarea>
  1012. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a>
  1013. <script type="text/javascript">
  1014. resize('admincomment');
  1015. </script>
  1016. </div>
  1017. </div>
  1018. <table class="layout box" id="user_info_box">
  1019. <tr class="colhead">
  1020. <td colspan="2">
  1021. User Information
  1022. </td>
  1023. </tr>
  1024. <? if (check_perms('users_edit_usernames', $Class)) { ?>
  1025. <tr>
  1026. <td class="label">Username:</td>
  1027. <td><input type="text" size="20" name="Username" value="<?=display_str($Username)?>" /></td>
  1028. </tr>
  1029. <?
  1030. }
  1031. if (check_perms('users_edit_titles')) {
  1032. ?>
  1033. <tr>
  1034. <td class="label">Custom title:</td>
  1035. <td><input type="text" class="wide_input_text" name="Title" value="<?=display_str($CustomTitle)?>" /></td>
  1036. </tr>
  1037. <?
  1038. }
  1039. if (check_perms('users_promote_below', $Class) || check_perms('users_promote_to', $Class - 1)) {
  1040. ?>
  1041. <tr>
  1042. <td class="label">Primary class:</td>
  1043. <td>
  1044. <select name="Class">
  1045. <?
  1046. foreach ($ClassLevels as $CurClass) {
  1047. if (check_perms('users_promote_below', $Class) && $CurClass['ID'] >= $LoggedUser['EffectiveClass']) {
  1048. break;
  1049. }
  1050. if ($CurClass['ID'] > $LoggedUser['EffectiveClass']) {
  1051. break;
  1052. }
  1053. if ($CurClass['Secondary']) {
  1054. continue;
  1055. }
  1056. if ($Class === $CurClass['Level']) {
  1057. $Selected = ' selected="selected"';
  1058. } else {
  1059. $Selected = '';
  1060. }
  1061. ?>
  1062. <option value="<?=$CurClass['ID']?>"<?=$Selected?>><?=$CurClass['Name'].' ('.$CurClass['Level'].')'?></option>
  1063. <? } ?>
  1064. </select>
  1065. </td>
  1066. </tr>
  1067. <?
  1068. }
  1069. if (check_perms('users_give_donor')) {
  1070. ?>
  1071. <tr>
  1072. <td class="label">Donor:</td>
  1073. <td><input type="checkbox" name="Donor"<? if ($Donor == 1) { ?> checked="checked"<? } ?> /></td>
  1074. </tr>
  1075. <?
  1076. }
  1077. if (check_perms('users_promote_below') || check_perms('users_promote_to')) { ?>
  1078. <tr>
  1079. <td class="label">Secondary classes:</td>
  1080. <td>
  1081. <?
  1082. $DB->query("
  1083. SELECT p.ID, p.Name, l.UserID
  1084. FROM permissions AS p
  1085. LEFT JOIN users_levels AS l ON l.PermissionID = p.ID AND l.UserID = '$UserID'
  1086. WHERE p.Secondary = 1
  1087. ORDER BY p.Name");
  1088. $i = 0;
  1089. while (list($PermID, $PermName, $IsSet) = $DB->next_record()) {
  1090. $i++;
  1091. ?>
  1092. <input type="checkbox" id="perm_<?=$PermID?>" name="secondary_classes[]" value="<?=$PermID?>"<? if ($IsSet) { ?> checked="checked"<? } ?> />&nbsp;<label for="perm_<?=$PermID?>" style="margin-right: 10px;"><?=$PermName?></label>
  1093. <? if ($i % 3 == 0) {
  1094. echo "\t\t\t\t<br />\n";
  1095. }
  1096. } ?>
  1097. </td>
  1098. </tr>
  1099. <? }
  1100. if (check_perms('users_make_invisible')) {
  1101. ?>
  1102. <tr>
  1103. <td class="label">Visible in peer lists:</td>
  1104. <td><input type="checkbox" name="Visible"<? if ($Visible == 1) { ?> checked="checked"<? } ?> /></td>
  1105. </tr>
  1106. <?
  1107. }
  1108. if (check_perms('users_edit_ratio', $Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
  1109. ?>
  1110. <tr>
  1111. <td class="label tooltip" title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Uploaded:</td>
  1112. <td>
  1113. <input type="hidden" name="OldUploaded" value="<?=$Uploaded?>" />
  1114. <input type="text" size="20" name="Uploaded" value="<?=$Uploaded?>" />
  1115. </td>
  1116. </tr>
  1117. <tr>
  1118. <td class="label tooltip" title="Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Downloaded:</td>
  1119. <td>
  1120. <input type="hidden" name="OldDownloaded" value="<?=$Downloaded?>" />
  1121. <input type="text" size="20" name="Downloaded" value="<?=$Downloaded?>" />
  1122. </td>
  1123. </tr>
  1124. <tr>
  1125. <td class="label"><?=BONUS_POINTS?>:</td>
  1126. <td>
  1127. <input type="text" size="20" name="BonusPoints" value="<?=$BonusPoints?>" />
  1128. <?
  1129. if (!$DisablePoints) {
  1130. $PointsRate = 0.5;
  1131. $getTorrents = $DB->query("
  1132. SELECT COUNT(DISTINCT x.fid) AS Torrents,
  1133. SUM(t.Size) AS Size,
  1134. SUM(xs.seedtime) AS Seedtime,
  1135. SUM(t.Seeders) AS Seeders
  1136. FROM users_main AS um
  1137. LEFT JOIN users_info AS i on um.ID = i.UserID
  1138. LEFT JOIN xbt_files_users AS x ON um.ID=x.uid
  1139. LEFT JOIN torrents AS t ON t.ID=x.fid
  1140. LEFT JOIN xbt_snatched AS xs ON x.uid=xs.uid AND x.fid=xs.fid
  1141. WHERE
  1142. um.ID = $UserID
  1143. AND um.Enabled = '1'
  1144. AND x.active = 1
  1145. AND x.completed = 0
  1146. AND x.Remaining = 0
  1147. GROUP BY um.ID");
  1148. if ($DB->has_results()) {
  1149. list($NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
  1150. $PointsRate += (0.67*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3));
  1151. }
  1152. $PointsRate = intval($PointsRate**0.95);
  1153. $PointsPerHour = number_format($PointsRate)." ".BONUS_POINTS."/hour";
  1154. $PointsPerDay = number_format($PointsRate*24)." ".BONUS_POINTS."/day";
  1155. } else {
  1156. $PointsPerHour = "0 ".BONUS_POINTS."/hour";
  1157. $PointsPerDay = BONUS_POINTS." disabled";
  1158. }
  1159. ?>
  1160. <?=$PointsPerHour?> (<?=$PointsPerDay?>)
  1161. </td>
  1162. </tr>
  1163. <tr>
  1164. <td class="label tooltip" title="Enter a username.">Merge stats <strong>from:</strong></td>
  1165. <td>
  1166. <input type="text" size="40" name="MergeStatsFrom" />
  1167. </td>
  1168. </tr>
  1169. <tr>
  1170. <td class="label">Freeleech tokens:</td>
  1171. <td>
  1172. <input type="text" size="5" name="FLTokens" value="<?=$FLTokens?>" />
  1173. </td>
  1174. </tr>
  1175. <?
  1176. }
  1177. if (check_perms('users_edit_invites')) {
  1178. ?>
  1179. <tr>
  1180. <td class="label tooltip" title="Number of invites">Invites:</td>
  1181. <td><input type="text" size="5" name="Invites" value="<?=$Invites?>" /></td>
  1182. </tr>
  1183. <?
  1184. }
  1185. if (check_perms('admin_manage_fls') || (check_perms('users_mod') && $OwnProfile)) {
  1186. ?>
  1187. <tr>
  1188. <td class="label tooltip" title="This is the message shown in the right-hand column on /staff.php">FLS/Staff remark:</td>
  1189. <td><input type="text" class="wide_input_text" name="SupportFor" value="<?=display_str($SupportFor)?>" /></td>
  1190. </tr>
  1191. <?
  1192. }
  1193. if (check_perms('users_edit_reset_keys')) {
  1194. ?>
  1195. <tr>
  1196. <td class="label">Reset:</td>
  1197. <td>
  1198. <input type="checkbox" name="ResetRatioWatch" id="ResetRatioWatch" /> <label for="ResetRatioWatch">Ratio watch</label> |
  1199. <input type="checkbox" name="ResetPasskey" id="ResetPasskey" /> <label for="ResetPasskey">Passkey</label> |
  1200. <input type="checkbox" name="ResetAuthkey" id="ResetAuthkey" /> <label for="ResetAuthkey">Authkey</label> |
  1201. <input type="checkbox" name="ResetIPHistory" id="ResetIPHistory" /> <label for="ResetIPHistory">IP history</label> |
  1202. <input type="checkbox" name="ResetEmailHistory" id="ResetEmailHistory" /> <label for="ResetEmailHistory">Email history</label>
  1203. <br />
  1204. <input type="checkbox" name="ResetSnatchList" id="ResetSnatchList" /> <label for="ResetSnatchList">Snatch list</label> |
  1205. <input type="checkbox" name="ResetDownloadList" id="ResetDownloadList" /> <label for="ResetDownloadList">Download list</label>
  1206. </td>
  1207. </tr>
  1208. <?
  1209. }
  1210. if (check_perms('users_edit_password')) {
  1211. ?>
  1212. <tr>
  1213. <td class="label">New password:</td>
  1214. <td>
  1215. <input type="text" size="30" id="change_password" name="ChangePassword" />
  1216. <button type="button" id="random_password">Generate</button>
  1217. </td>
  1218. </tr>
  1219. <? }
  1220. if (check_perms('users_edit_badges')) {
  1221. ?>
  1222. <tr id="user_badge_edit_tr">
  1223. <td class="label">Badges Owned:</td>
  1224. <td>
  1225. <?
  1226. $DB->query("
  1227. SELECT ID AS BadgeID, Icon, Name, Description
  1228. FROM badges");
  1229. if ($DB->has_results()) { //If the DB has no results here, something is dangerously fucked
  1230. $AllBadges = $DB->to_array();
  1231. $UserBadgeIDs = array();
  1232. foreach (Badges::get_badges($UserID) as $Badge) {
  1233. $UserBadgeIDs[] = $Badge['BadgeID'];
  1234. }
  1235. $i = 0;
  1236. foreach ($AllBadges as $Badge) {
  1237. ?><input type="checkbox" name="badges[]" class="badge_checkbox" value="<?=$Badge['BadgeID']?>" <?=(in_array($Badge['BadgeID'], $UserBadgeIDs))?" checked":""?>/><?=Badges::display_badge($Badge, true)?>
  1238. <? $i++;
  1239. if ($i % 8 == 0) {
  1240. echo "<br />";
  1241. }
  1242. }
  1243. }
  1244. ?>
  1245. </td>
  1246. </tr>
  1247. <? } ?>
  1248. </table>
  1249. <? if (check_perms('users_warn')) { ?>
  1250. <table class="layout box" id="warn_user_box">
  1251. <tr class="colhead">
  1252. <td colspan="2">
  1253. Warnings
  1254. </td>
  1255. </tr>
  1256. <tr>
  1257. <td class="label">Warned:</td>
  1258. <td>
  1259. <input type="checkbox" name="Warned"<? if ($Warned != '0000-00-00 00:00:00') { ?> checked="checked"<? } ?> />
  1260. </td>
  1261. </tr>
  1262. <? if ($Warned == '0000-00-00 00:00:00') { // user is not warned ?>
  1263. <tr>
  1264. <td class="label">Expiration:</td>
  1265. <td>
  1266. <select name="WarnLength">
  1267. <option value="">---</option>
  1268. <option value="1">1 week</option>
  1269. <option value="2">2 weeks</option>
  1270. <option value="4">4 weeks</option>
  1271. <option value="8">8 weeks</option>
  1272. </select>
  1273. </td>
  1274. </tr>
  1275. <? } else { // user is warned ?>
  1276. <tr>
  1277. <td class="label">Extension:</td>
  1278. <td>
  1279. <select name="ExtendWarning" onchange="ToggleWarningAdjust(this);">
  1280. <option>---</option>
  1281. <option value="1">1 week</option>
  1282. <option value="2">2 weeks</option>
  1283. <option value="4">4 weeks</option>
  1284. <option value="8">8 weeks</option>
  1285. </select>
  1286. </td>
  1287. </tr>
  1288. <tr id="ReduceWarningTR">
  1289. <td class="label">Reduction:</td>
  1290. <td>
  1291. <select name="ReduceWarning">
  1292. <option>---</option>
  1293. <option value="1">1 week</option>
  1294. <option value="2">2 weeks</option>
  1295. <option value="4">4 weeks</option>
  1296. <option value="8">8 weeks</option>
  1297. </select>
  1298. </td>
  1299. </tr>
  1300. <? } ?>
  1301. <tr>
  1302. <td class="label tooltip" title="This message *will* be sent to the user in the warning PM!">Warning reason:</td>
  1303. <td>
  1304. <input type="text" class="wide_input_text" name="WarnReason" />
  1305. </td>
  1306. </tr>
  1307. <? } ?>
  1308. </table>
  1309. <? if (check_perms('users_disable_any')) { ?>
  1310. <table class="layout box">
  1311. <tr class="colhead">
  1312. <td colspan="2">
  1313. Lock Account
  1314. </td>
  1315. </tr>
  1316. <tr>
  1317. <td class="label">Lock Account:</td>
  1318. <td>
  1319. <input type="checkbox" name="LockAccount" id="LockAccount" <? if($LockedAccount) { ?> checked="checked" <? } ?>/>
  1320. </td>
  1321. </tr>
  1322. <tr>
  1323. <td class="label">Reason:</td>
  1324. <td>
  1325. <select name="LockReason">
  1326. <option value="---">---</option>
  1327. <option value="<?=STAFF_LOCKED?>" <? if ($LockedAccount == STAFF_LOCKED) { ?> selected <? } ?>>Staff Lock</option>
  1328. </select>
  1329. </td>
  1330. </tr>
  1331. </table>
  1332. <? } ?>
  1333. <table class="layout box" id="user_privs_box">
  1334. <tr class="colhead">
  1335. <td colspan="2">
  1336. User Privileges
  1337. </td>
  1338. </tr>
  1339. <? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
  1340. $DB->query("
  1341. SELECT DISTINCT Email, IP
  1342. FROM users_history_emails
  1343. WHERE UserID = $UserID
  1344. ORDER BY Time ASC");
  1345. $Emails = $DB->to_array();
  1346. ?>
  1347. <tr>
  1348. <td class="label">Disable:</td>
  1349. <td>
  1350. <input type="checkbox" name="DisablePosting" id="DisablePosting"<? if ($DisablePosting == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
  1351. <? if (check_perms('users_disable_any')) { ?> |
  1352. <input type="checkbox" name="DisableAvatar" id="DisableAvatar"<? if ($DisableAvatar == 1) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
  1353. <input type="checkbox" name="DisableForums" id="DisableForums"<? if ($DisableForums == 1) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
  1354. <input type="checkbox" name="DisableIRC" id="DisableIRC"<? if ($DisableIRC == 1) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label> |
  1355. <input type="checkbox" name="DisablePM" id="DisablePM"<? if ($DisablePM == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
  1356. <br /><br />
  1357. <input type="checkbox" name="DisableLeech" id="DisableLeech"<? if ($DisableLeech == 0) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
  1358. <input type="checkbox" name="DisableRequests" id="DisableRequests"<? if ($DisableRequests == 1) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label> |
  1359. <input type="checkbox" name="DisableUpload" id="DisableUpload"<? if ($DisableUpload == 1) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Torrent upload</label> |
  1360. <input type="checkbox" name="DisablePoints" id="DisablePoints"<? if ($DisablePoints == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePoints"><?=BONUS_POINTS?></label>
  1361. <br /><br />
  1362. <input type="checkbox" name="DisableTagging" id="DisableTagging"<? if ($DisableTagging == 1) { ?> checked="checked"<? } ?> /> <label for="DisableTagging" class="tooltip" title="This only disables a user's ability to delete tags.">Tagging</label> |
  1363. <input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
  1364. <input type="checkbox" name="DisablePromotion" id="DisablePromotion"<? if ($DisablePromotion == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePromotion">Promotions</label> |
  1365. <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
  1366. </td>
  1367. </tr>
  1368. <tr>
  1369. <td class="label">Hacked:</td>
  1370. <td>
  1371. <input type="checkbox" name="SendHackedMail" id="SendHackedMail" /> <label for="SendHackedMail">Send hacked account email</label> to
  1372. <select name="HackedEmail">
  1373. <?
  1374. foreach ($Emails as $Email) {
  1375. list($Address, $IP) = $Email;
  1376. $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  1377. $Address = apc_exists('DBKEY') ? DBCrypt::decrypt($Address) : '[Encrypted]';
  1378. ?>
  1379. <option value="<?=display_str($Address)?>"><?=display_str($Address)?> - <?=display_str($IP)?></option>
  1380. <? } ?>
  1381. </select>
  1382. </td>
  1383. </tr>
  1384. <?
  1385. }
  1386. }
  1387. if (check_perms('users_disable_any')) {
  1388. ?>
  1389. <tr>
  1390. <td class="label">Account:</td>
  1391. <td>
  1392. <select name="UserStatus">
  1393. <option value="0"<? if ($Enabled == '0') { ?> selected="selected"<? } ?>>Unconfirmed</option>
  1394. <option value="1"<? if ($Enabled == '1') { ?> selected="selected"<? } ?>>Enabled</option>
  1395. <option value="2"<? if ($Enabled == '2') { ?> selected="selected"<? } ?>>Disabled</option>
  1396. <? if (check_perms('users_delete_users')) { ?>
  1397. <optgroup label="-- WARNING --">
  1398. <option value="delete">Delete account</option>
  1399. </optgroup>
  1400. <? } ?>
  1401. </select>
  1402. </td>
  1403. </tr>
  1404. <tr>
  1405. <td class="label">User reason:</td>
  1406. <td>
  1407. <input type="text" class="wide_input_text" name="UserReason" />
  1408. </td>
  1409. </tr>
  1410. <tr>
  1411. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Restricted forums:</td>
  1412. <td>
  1413. <input type="text" class="wide_input_text" name="RestrictedForums" value="<?=display_str($RestrictedForums)?>" />
  1414. </td>
  1415. </tr>
  1416. <tr>
  1417. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Extra forums:</td>
  1418. <td>
  1419. <input type="text" class="wide_input_text" name="PermittedForums" value="<?=display_str($PermittedForums)?>" />
  1420. </td>
  1421. </tr>
  1422. <? } ?>
  1423. </table>
  1424. <? if (check_perms('users_logout')) { ?>
  1425. <table class="layout box" id="session_box">
  1426. <tr class="colhead">
  1427. <td colspan="2">
  1428. Session
  1429. </td>
  1430. </tr>
  1431. <tr>
  1432. <td class="label">Reset session:</td>
  1433. <td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
  1434. </tr>
  1435. <tr>
  1436. <td class="label">Log out:</td>
  1437. <td><input type="checkbox" name="LogOut" id="LogOut" /></td>
  1438. </tr>
  1439. </table>
  1440. <?
  1441. }
  1442. if (check_perms('users_mod')) {
  1443. DonationsView::render_mod_donations($UserID);
  1444. }
  1445. ?>
  1446. <table class="layout box" id="submit_box">
  1447. <tr class="colhead">
  1448. <td colspan="2">
  1449. Submit
  1450. </td>
  1451. </tr>
  1452. <tr>
  1453. <td class="label tooltip" title="This message will be entered into staff notes only.">Reason:</td>
  1454. <td>
  1455. <textarea rows="1" cols="35" class="wide_input_text" name="Reason" id="Reason" onkeyup="resize('Reason');"></textarea>
  1456. </td>
  1457. </tr>
  1458. <tr>
  1459. <td class="label">Paste user stats:</td>
  1460. <td>
  1461. <button type="button" id="paster">Paste</button>
  1462. </td>
  1463. </tr>
  1464. <tr>
  1465. <td align="right" colspan="2">
  1466. <input type="submit" value="Save changes" />
  1467. </td>
  1468. </tr>
  1469. </table>
  1470. </form>
  1471. <?
  1472. }
  1473. ?>
  1474. </div>
  1475. </div>
  1476. <script>
  1477. $('.tooltip').tooltipster();
  1478. </script>
  1479. <? View::show_footer(); ?>