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 53KB

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