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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537
  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 = apcu_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 = json_decode($Paranoia, true);
  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. <div class="flex_input_container">
  278. <input type="text" name="amount" placeholder="Amount">
  279. <input type="submit" value="Send">
  280. </div>
  281. <textarea name="message" rows="2" placeholder="Message"></textarea>
  282. <label><input type="checkbox" name="adjust"> Adjust for tax?</label>
  283. </form>
  284. <p>Note: 10% of your gift is taken as tax.</p>
  285. </div>
  286. </div>
  287. <?
  288. }
  289. $DB->query("
  290. SELECT u.Username
  291. FROM slaves AS s
  292. LEFT JOIN users_main AS u ON u.ID = s.OwnerID
  293. WHERE s.UserID = $UserID");
  294. if ($LoggedUser['Class'] >= 200 || $DB->has_results()) { ?>
  295. <div class='box ownership_box'>
  296. <div class='head colhead_dark'>Ownership</div>
  297. <div class="pad">
  298. <? if ($DB->has_results()) { ?>
  299. <p>This user is owned by <?=($DB->next_record()['Username'])?></p>
  300. <? } else {
  301. $DB->query("
  302. SELECT u.Uploaded, u.Downloaded, u.BonusPoints, COUNT(t.UserID)
  303. FROM users_main AS u
  304. LEFT JOIN torrents AS t ON u.ID=t.UserID
  305. WHERE u.ID = $UserID");
  306. list($Upload, $Download, $Points, $Uploads) = $DB->next_record();
  307. $Level = intval(((($Uploads**0.35)*1.5)+1) * max(($Upload+($Points*1000000)-$Download)/(1024**3), 1));
  308. ?>
  309. <p>This user is wild and level <?=$Level?></p>
  310. <? if (!$OwnProfile) { ?>
  311. <p>Try to capture them with <?=BONUS_POINTS?>? The more you spend, the higher the chance of capture</p>
  312. <form action='store.php' method='post'>
  313. <input type='hidden' name='item' value='capture_user' />
  314. <input type='hidden' name='target' value='<?=$UserID?>' />
  315. <input type='text' name='amount' placeholder='<?=BONUS_POINTS?>' /><input type='submit' value='Capture' />
  316. </form>
  317. <? }
  318. } ?>
  319. </div>
  320. </div>
  321. <? } ?>
  322. <div class="box box_info box_userinfo_stats">
  323. <div class="head colhead_dark">Statistics</div>
  324. <ul class="stats nobullet">
  325. <li>Joined: <?=$JoinedDate?></li>
  326. <? if (($Override = check_paranoia_here('lastseen'))) { ?>
  327. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Last seen: <?=$LastAccess?></li>
  328. <?
  329. }
  330. if (($Override = check_paranoia_here('uploaded'))) {
  331. ?>
  332. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
  333. <?
  334. }
  335. if (($Override = check_paranoia_here('downloaded'))) {
  336. ?>
  337. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
  338. <?
  339. }
  340. if (($Override = check_paranoia_here('ratio'))) {
  341. ?>
  342. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
  343. <?
  344. }
  345. if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) {
  346. ?>
  347. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Required Ratio: <span class="tooltip" title="<?=number_format((double)$RequiredRatio, 5)?>"><?=number_format((double)$RequiredRatio, 2)?></span></li>
  348. <?
  349. }
  350. if (($Override = check_paranoia_here('downloaded'))) {
  351. ?>
  352. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Total Seeding: <span class="tooltip" title="<?=Format::get_size($TotalSeeding)?>"><?=Format::get_size($TotalSeeding)?></li>
  353. <?
  354. }
  355. if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) {
  356. ?>
  357. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
  358. <?
  359. }
  360. if (($OwnProfile || check_perms('users_mod')) && $Warned) {
  361. ?>
  362. <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
  363. <? } ?>
  364. </ul>
  365. </div>
  366. <?
  367. if (check_paranoia_here('requestsfilled_count') || check_paranoia_here('requestsfilled_bounty')) {
  368. $DB->query("
  369. SELECT
  370. COUNT(DISTINCT r.ID),
  371. SUM(rv.Bounty)
  372. FROM requests AS r
  373. LEFT JOIN requests_votes AS rv ON r.ID = rv.RequestID
  374. WHERE r.FillerID = $UserID");
  375. list($RequestsFilled, $TotalBounty) = $DB->next_record();
  376. } else {
  377. $RequestsFilled = $TotalBounty = 0;
  378. }
  379. if (check_paranoia_here('requestsvoted_count') || check_paranoia_here('requestsvoted_bounty')) {
  380. $DB->query("
  381. SELECT COUNT(RequestID), SUM(Bounty)
  382. FROM requests_votes
  383. WHERE UserID = $UserID");
  384. list($RequestsVoted, $TotalSpent) = $DB->next_record();
  385. $DB->query("
  386. SELECT COUNT(r.ID), SUM(rv.Bounty)
  387. FROM requests AS r
  388. LEFT JOIN requests_votes AS rv ON rv.RequestID = r.ID AND rv.UserID = r.UserID
  389. WHERE r.UserID = $UserID");
  390. list($RequestsCreated, $RequestsCreatedSpent) = $DB->next_record();
  391. } else {
  392. $RequestsVoted = $TotalSpent = $RequestsCreated = $RequestsCreatedSpent = 0;
  393. }
  394. if (check_paranoia_here('uploads+')) {
  395. $DB->query("
  396. SELECT COUNT(ID)
  397. FROM torrents
  398. WHERE UserID = '$UserID'");
  399. list($Uploads) = $DB->next_record();
  400. } else {
  401. $Uploads = 0;
  402. }
  403. if (check_paranoia_here('artistsadded')) {
  404. $DB->query("
  405. SELECT COUNT(DISTINCT ArtistID)
  406. FROM torrents_artists
  407. WHERE UserID = $UserID");
  408. list($ArtistsAdded) = $DB->next_record();
  409. } else {
  410. $ArtistsAdded = 0;
  411. }
  412. //Do the ranks
  413. $UploadedRank = UserRank::get_rank('uploaded', $Uploaded);
  414. $DownloadedRank = UserRank::get_rank('downloaded', $Downloaded);
  415. $UploadsRank = UserRank::get_rank('uploads', $Uploads);
  416. $RequestRank = UserRank::get_rank('requests', $RequestsFilled);
  417. $PostRank = UserRank::get_rank('posts', $ForumPosts);
  418. $BountyRank = UserRank::get_rank('bounty', $TotalSpent);
  419. $ArtistsRank = UserRank::get_rank('artists', $ArtistsAdded);
  420. if ($Downloaded == 0) {
  421. $Ratio = 1;
  422. } elseif ($Uploaded == 0) {
  423. $Ratio = 0.5;
  424. } else {
  425. $Ratio = round($Uploaded / $Downloaded, 2);
  426. }
  427. $OverallRank = UserRank::overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio);
  428. ?>
  429. <div class="box box_info box_userinfo_percentile">
  430. <div class="head colhead_dark">Percentile Rankings (hover for values)</div>
  431. <ul class="stats nobullet">
  432. <? if (($Override = check_paranoia_here('uploaded'))) { ?>
  433. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Uploaded)?>">Data uploaded: <?=$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?></li>
  434. <?
  435. }
  436. if (($Override = check_paranoia_here('downloaded'))) { ?>
  437. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($Downloaded)?>">Data downloaded: <?=$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?></li>
  438. <?
  439. }
  440. if (($Override = check_paranoia_here('uploads+'))) { ?>
  441. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($Uploads)?>">Torrents uploaded: <?=$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?></li>
  442. <?
  443. }
  444. if (($Override = check_paranoia_here('requestsfilled_count'))) { ?>
  445. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($RequestsFilled)?>">Requests filled: <?=$RequestRank === false ? 'Server busy' : number_format($RequestRank)?></li>
  446. <?
  447. }
  448. if (($Override = check_paranoia_here('requestsvoted_bounty'))) { ?>
  449. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=Format::get_size($TotalSpent)?>">Bounty spent: <?=$BountyRank === false ? 'Server busy' : number_format($BountyRank)?></li>
  450. <? } ?>
  451. <li class="tooltip" title="<?=number_format($ForumPosts)?>">Posts made: <?=$PostRank === false ? 'Server busy' : number_format($PostRank)?></li>
  452. <? if (($Override = check_paranoia_here('artistsadded'))) { ?>
  453. <li class="tooltip<?=($Override === 2 ? ' paranoia_override' : '')?>" title="<?=number_format($ArtistsAdded)?>">Artists added: <?=$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?></li>
  454. <?
  455. }
  456. if (check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) { ?>
  457. <li><strong>Overall rank: <?=$OverallRank === false ? 'Server busy' : number_format($OverallRank)?></strong></li>
  458. <? } ?>
  459. </ul>
  460. </div>
  461. <?
  462. if (check_perms('users_mod', $Class) || check_perms('users_view_ips', $Class) || check_perms('users_view_keys', $Class)) {
  463. $DB->query("
  464. SELECT COUNT(*)
  465. FROM users_history_passwords
  466. WHERE UserID = '$UserID'");
  467. list($PasswordChanges) = $DB->next_record();
  468. if (check_perms('users_view_keys', $Class)) {
  469. $DB->query("
  470. SELECT COUNT(*)
  471. FROM users_history_passkeys
  472. WHERE UserID = '$UserID'");
  473. list($PasskeyChanges) = $DB->next_record();
  474. }
  475. if (check_perms('users_view_ips', $Class)) {
  476. $DB->query("
  477. SELECT COUNT(DISTINCT IP)
  478. FROM users_history_ips
  479. WHERE UserID = '$UserID'");
  480. list($IPChanges) = $DB->next_record();
  481. $DB->query("
  482. SELECT COUNT(DISTINCT IP)
  483. FROM xbt_snatched
  484. WHERE uid = '$UserID'
  485. AND IP != ''");
  486. list($TrackerIPs) = $DB->next_record();
  487. }
  488. if (check_perms('users_view_email', $Class)) {
  489. $DB->query("
  490. SELECT COUNT(*)
  491. FROM users_history_emails
  492. WHERE UserID = '$UserID'");
  493. list($EmailChanges) = $DB->next_record();
  494. }
  495. ?>
  496. <div class="box box_info box_userinfo_history">
  497. <div class="head colhead_dark">History</div>
  498. <ul class="stats nobullet">
  499. <? if (check_perms('users_view_email', $Class)) { ?>
  500. <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>
  501. <?
  502. }
  503. if (check_perms('users_view_ips', $Class)) {
  504. ?>
  505. <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>
  506. <? if (check_perms('users_view_ips', $Class) && check_perms('users_mod', $Class)) { ?>
  507. <li>Tracker IPs: <?=number_format($TrackerIPs)?> <a href="userhistory.php?action=tracker_ips&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  508. <?
  509. }
  510. }
  511. if (check_perms('users_view_keys', $Class)) {
  512. ?>
  513. <li>Passkeys: <?=number_format($PasskeyChanges)?> <a href="userhistory.php?action=passkeys&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  514. <?
  515. }
  516. if (check_perms('users_mod', $Class)) {
  517. ?>
  518. <li>Passwords: <?=number_format($PasswordChanges)?> <a href="userhistory.php?action=passwords&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  519. <li>Stats: N/A <a href="userhistory.php?action=stats&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  520. <? } ?>
  521. </ul>
  522. </div>
  523. <? } ?>
  524. <div class="box box_info box_userinfo_personal">
  525. <div class="head colhead_dark">Personal</div>
  526. <ul class="stats nobullet">
  527. <li>Class: <?=$ClassLevels[$Class]['Name']?></li>
  528. <?
  529. $UserInfo = Users::user_info($UserID);
  530. if (!empty($UserInfo['ExtraClasses'])) {
  531. ?>
  532. <li>
  533. <ul class="stats">
  534. <?
  535. foreach ($UserInfo['ExtraClasses'] as $PermID => $Val) {
  536. ?>
  537. <li><?=$Classes[$PermID]['Name']?></li>
  538. <? } ?>
  539. </ul>
  540. </li>
  541. <?
  542. }
  543. // An easy way for people to measure the paranoia of a user, for e.g. contest eligibility
  544. if ($ParanoiaLevel == 0) {
  545. $ParanoiaLevelText = 'Off';
  546. } elseif ($ParanoiaLevel == 1) {
  547. $ParanoiaLevelText = 'Very Low';
  548. } elseif ($ParanoiaLevel <= 5) {
  549. $ParanoiaLevelText = 'Low';
  550. } elseif ($ParanoiaLevel <= 20) {
  551. $ParanoiaLevelText = 'High';
  552. } else {
  553. $ParanoiaLevelText = 'Very high';
  554. }
  555. ?>
  556. <li>Paranoia level: <span class="tooltip" title="<?=$ParanoiaLevel?>"><?=$ParanoiaLevelText?></span></li>
  557. <? if (check_perms('users_view_email', $Class) || $OwnProfile) { ?>
  558. <li>Email: <a href="mailto:<?=display_str($Email)?>"><?=display_str($Email)?></a>
  559. <? if (check_perms('users_view_email', $Class)) { ?>
  560. <a href="user.php?action=search&amp;email_history=on&amp;email=<?=display_str($Email)?>" title="Search" class="brackets tooltip">S</a>
  561. <? } ?>
  562. </li>
  563. <? }
  564. if (check_perms('users_view_ips', $Class)) {
  565. $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  566. ?>
  567. <li>IP: <?=Tools::display_ip($IP)?></li>
  568. <li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
  569. <?
  570. }
  571. if (check_perms('users_view_keys', $Class) || $OwnProfile) {
  572. ?>
  573. <li>Passkey: <a href="#" id="passkey" onclick="togglePassKey('<?=display_str($torrent_pass)?>'); return false;" class="brackets">View</a></li>
  574. <?
  575. }
  576. if (check_perms('users_view_invites')) {
  577. if (!$InviterID) {
  578. $Invited = '<span style="font-style: italic;">Nobody</span>';
  579. } else {
  580. $Invited = "<a href=\"user.php?id=$InviterID\">$InviterName</a>";
  581. }
  582. ?>
  583. <li>Invited by: <?=$Invited?></li>
  584. <li>Invites: <?
  585. $DB->query("
  586. SELECT COUNT(InviterID)
  587. FROM invites
  588. WHERE InviterID = '$UserID'");
  589. list($Pending) = $DB->next_record();
  590. if ($DisableInvites) {
  591. echo 'X';
  592. } else {
  593. echo number_format($Invites);
  594. }
  595. echo " ($Pending)"
  596. ?></li>
  597. <?
  598. }
  599. if (!isset($SupportFor)) {
  600. $DB->query('
  601. SELECT SupportFor
  602. FROM users_info
  603. WHERE UserID = '.$LoggedUser['ID']);
  604. list($SupportFor) = $DB->next_record();
  605. }
  606. if ($Override = check_perms('users_mod') || $OwnProfile || !empty($SupportFor)) {
  607. ?>
  608. <li<?=(($Override === 2 || $SupportFor) ? ' class="paranoia_override"' : '')?>>Clients: <?
  609. $DB->query("
  610. SELECT DISTINCT useragent
  611. FROM xbt_files_users
  612. WHERE uid = $UserID");
  613. $Clients = $DB->collect(0);
  614. echo implode('; ', $Clients);
  615. ?></li>
  616. <?
  617. }
  618. ?>
  619. </ul>
  620. </div>
  621. <?
  622. include(SERVER_ROOT.'/sections/user/community_stats.php');
  623. DonationsView::render_donor_stats($UserID);
  624. ?>
  625. </div>
  626. <div class="main_column">
  627. <?
  628. if ($RatioWatchEnds && (time() < strtotime($RatioWatchEnds)) && ($Downloaded * $RequiredRatio) > $Uploaded) {
  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 data-toggle-target="#profilediv" data-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.NameRJ,
  664. g.NameJP,
  665. g.WikiImage
  666. FROM xbt_snatched AS s
  667. INNER JOIN torrents AS t ON t.ID = s.fid
  668. INNER JOIN torrents_group AS g ON t.GroupID = g.ID
  669. WHERE s.uid = '$UserID'
  670. AND g.WikiImage != ''
  671. GROUP BY g.ID,s.tstamp
  672. ORDER BY s.tstamp DESC
  673. LIMIT 5");
  674. $RecentSnatches = $DB->to_array();
  675. $Artists = Artists::get_artists($DB->collect('ID'));
  676. foreach ($RecentSnatches as $Key => $SnatchInfo) {
  677. $RecentSnatches[$Key]['Artist'] = Artists::display_artists($Artists[$SnatchInfo['ID']], false, true);
  678. }
  679. $Cache->cache_value("recent_snatches_$UserID", $RecentSnatches, 0); //inf cache
  680. }
  681. if (!empty($RecentSnatches)) {
  682. ?>
  683. <div class="box" id="recent_snatches">
  684. <div class="head">
  685. Recent Snatches
  686. <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;
  687. </div>
  688. <div id="recent_snatches_images" class="collage_images hidden">
  689. <? foreach ($RecentSnatches as $RS) {
  690. $RSName = empty($RS['Name']) ? (empty($RS['NameRJ']) ? $RS['NameJP'] : $RS['NameRJ']) : $RS['Name'];
  691. ?>
  692. <div style='width: 100px;' class='collage_image' >
  693. <a href="torrents.php?id=<?=$RS['ID']?>">
  694. <img class="tooltip" title="<?=display_str($RS['Artist'])?><?=display_str($RSName)?>" src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RSName)?>" width="100%" />
  695. </a>
  696. </div>
  697. <? } ?>
  698. </div>
  699. </div>
  700. <?
  701. }
  702. }
  703. if (check_paranoia_here('uploads')) {
  704. $RecentUploads = $Cache->get_value("recent_uploads_$UserID");
  705. if ($RecentUploads === false) {
  706. $DB->query("
  707. SELECT
  708. g.ID,
  709. g.Name,
  710. g.NameRJ,
  711. g.NameJP,
  712. g.WikiImage
  713. FROM torrents_group AS g
  714. INNER JOIN torrents AS t ON t.GroupID = g.ID
  715. WHERE t.UserID = '$UserID'
  716. AND g.WikiImage != ''
  717. GROUP BY g.ID,t.Time
  718. ORDER BY t.Time DESC
  719. LIMIT 5");
  720. $RecentUploads = $DB->to_array();
  721. $Artists = Artists::get_artists($DB->collect('ID'));
  722. foreach ($RecentUploads as $Key => $UploadInfo) {
  723. $RecentUploads[$Key]['Artist'] = Artists::display_artists($Artists[$UploadInfo['ID']], false, true);
  724. }
  725. $Cache->cache_value("recent_uploads_$UserID", $RecentUploads, 0); //inf cache
  726. }
  727. if (!empty($RecentUploads)) {
  728. ?>
  729. <div class="box" id="recent_uploads">
  730. <div class="head">
  731. Recent Uploads
  732. <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;
  733. </div>
  734. <div id="recent_uploads_images" class="collage_images hidden">
  735. <? foreach ($RecentUploads as $RU) {
  736. $RUName = empty($RU['Name']) ? (empty($RU['NameRJ']) ? $RU['NameJP'] : $RU['NameRJ']) : $RU['Name'];
  737. ?>
  738. <div style='width: 100px;' class='collage_image' >
  739. <a href="torrents.php?id=<?=$RU['ID']?>">
  740. <img class="tooltip" title="<?=$RU['Artist']?><?=$RUName?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RUName?>" width="100%" />
  741. </a>
  742. </div>
  743. <? } ?>
  744. </div>
  745. </div>
  746. <?
  747. }
  748. }
  749. $DB->query("
  750. SELECT ID, Name
  751. FROM collages
  752. WHERE UserID = '$UserID'
  753. AND CategoryID = '0'
  754. AND Deleted = '0'
  755. ORDER BY Featured DESC,
  756. Name ASC");
  757. $Collages = $DB->to_array(false, MYSQLI_NUM, false);
  758. foreach ($Collages as $CollageInfo) {
  759. list($CollageID, $CName) = $CollageInfo;
  760. $DB->query("
  761. SELECT ct.GroupID,
  762. tg.WikiImage,
  763. tg.CategoryID
  764. FROM collages_torrents AS ct
  765. JOIN torrents_group AS tg ON tg.ID = ct.GroupID
  766. WHERE ct.CollageID = '$CollageID'
  767. ORDER BY ct.Sort
  768. LIMIT 5");
  769. $Collage = $DB->to_array(false, MYSQLI_ASSOC, false);
  770. ?>
  771. <div class="box" id="collage<?=$CollageID?>_box">
  772. <div class="head">
  773. <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
  774. <span style="float: right;">
  775. <a data-toggle-target="#collage<?=$CollageID?>_box .collage_images" data-toggle-replace="Show" class="brackets">Hide</a>
  776. </span>
  777. </div>
  778. <div id="user_collage_images" class="collage_images" data-wall-child=".collage_image" data-wall-size="5">
  779. <? foreach ($Collage as $C) {
  780. $Group = Torrents::get_groups(array($C['GroupID']), true, true, false);
  781. extract(Torrents::array_group($Group[$C['GroupID']]));
  782. if (!$C['WikiImage']) {
  783. $C['WikiImage'] = STATIC_SERVER.'common/noartwork/nocover.png';
  784. }
  785. $Name = '';
  786. $Name .= Artists::display_artists($Artists, false, true);
  787. $Name .= $GroupName;
  788. ?>
  789. <div class="collage_image">
  790. <a href="torrents.php?id=<?=$GroupID?>">
  791. <img class="tooltip" title="<?=$Name?>" src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="100%" />
  792. </a>
  793. </div>
  794. <? } ?>
  795. </div>
  796. </div>
  797. <?
  798. }
  799. ?>
  800. <!-- for the "jump to staff tools" button -->
  801. <a id="staff_tools"></a>
  802. <?
  803. // Linked accounts
  804. if (check_perms('users_mod')) {
  805. include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
  806. user_dupes_table($UserID);
  807. }
  808. if ((check_perms('users_view_invites')) && $Invited > 0) {
  809. include(SERVER_ROOT.'/classes/invite_tree.class.php');
  810. $Tree = new INVITE_TREE($UserID, array('visible' => false));
  811. ?>
  812. <div class="box" id="invitetree_box">
  813. <div class="head">
  814. Invite Tree <span style="float: right"><a data-toggle-target="#invitetree" class="brackets">Toggle</a></span>
  815. </div>
  816. <div id="invitetree" class="hidden">
  817. <? $Tree->make_tree(); ?>
  818. </div>
  819. </div>
  820. <?
  821. }
  822. if (check_perms('users_mod')) {
  823. DonationsView::render_donation_history(Donations::get_donation_history($UserID));
  824. }
  825. // Requests
  826. if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) {
  827. $SphQL = new SphinxqlQuery();
  828. $SphQLResult = $SphQL->select('id, votes, bounty')
  829. ->from('requests, requests_delta')
  830. ->where('userid', $UserID)
  831. ->where('torrentid', 0)
  832. ->order_by('votes', 'desc')
  833. ->order_by('bounty', 'desc')
  834. ->limit(0, 100, 100) // Limit to 100 requests
  835. ->query();
  836. if ($SphQLResult->has_results()) {
  837. $SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC);
  838. ?>
  839. <div class="box" id="requests_box">
  840. <div class="head">
  841. Requests <span style="float: right;"><a data-toggle-target="#requests" class="brackets">Show</a></span>
  842. </div>
  843. <div id="requests" class="hidden">
  844. <table cellpadding="6" cellspacing="1" border="0" width="100%">
  845. <tr class="colhead_dark">
  846. <td style="width: 48%;">
  847. <strong>Request Name</strong>
  848. </td>
  849. <td>
  850. <strong>Vote</strong>
  851. </td>
  852. <td>
  853. <strong>Bounty</strong>
  854. </td>
  855. <td>
  856. <strong>Added</strong>
  857. </td>
  858. </tr>
  859. <?
  860. $Requests = Requests::get_requests(array_keys($SphRequests));
  861. foreach ($SphRequests as $RequestID => $SphRequest) {
  862. $Request = $Requests[$RequestID];
  863. $VotesCount = $SphRequest['votes'];
  864. $Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
  865. $CategoryName = $Categories[$Request['CategoryID'] - 1];
  866. if ($CategoryName == 'Music') {
  867. $ArtistForm = Requests::get_artists($RequestID);
  868. $ArtistLink = Artists::display_artists($ArtistForm, true, true);
  869. $FullName = "$ArtistLink<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  870. } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
  871. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  872. } else {
  873. if (!$Request['Title']) { $Request['Title'] = $Request['TitleRJ']; }
  874. if (!$Request['Title']) { $Request['Title'] = $Request['TitleJP']; }
  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 data-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 data-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) { ?> checked="checked"<? } ?> />
  1260. </td>
  1261. </tr>
  1262. <? if (!$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 { ?>
  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, Time
  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 = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  1377. $Address = apcu_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. <? View::show_footer(); ?>