BioTorrents.de’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 55KB

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