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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553
  1. <?
  2. if (empty($_GET['id']) || !is_number($_GET['id']) || (!empty($_GET['preview']) && !is_number($_GET['preview']))) {
  3. error(404);
  4. }
  5. $UserID = (int)$_GET['id'];
  6. $Preview = isset($_GET['preview']) ? $_GET['preview'] : 0;
  7. if ($UserID == $LoggedUser['ID']) {
  8. $OwnProfile = true;
  9. if ($Preview == 1) {
  10. $OwnProfile = false;
  11. $ParanoiaString = $_GET['paranoia'];
  12. $CustomParanoia = explode(',', $ParanoiaString);
  13. }
  14. } else {
  15. $OwnProfile = false;
  16. //Don't allow any kind of previewing on others' profiles
  17. $Preview = 0;
  18. }
  19. $EnabledRewards = Donations::get_enabled_rewards($UserID);
  20. $ProfileRewards = Donations::get_profile_rewards($UserID);
  21. if (check_perms('users_mod')) { // Person viewing is a staff member
  22. $DB->query("
  23. SELECT
  24. m.Username,
  25. m.Email,
  26. m.LastAccess,
  27. m.IP,
  28. p.Level AS Class,
  29. m.Uploaded,
  30. m.Downloaded,
  31. m.RequiredRatio,
  32. m.Title,
  33. m.torrent_pass,
  34. m.Enabled,
  35. m.Paranoia,
  36. m.Invites,
  37. m.can_leech,
  38. m.Visible,
  39. m.BonusPoints,
  40. m.IRCLines,
  41. i.JoinDate,
  42. i.Info,
  43. i.Avatar,
  44. i.AdminComment,
  45. i.Donor,
  46. i.Artist,
  47. i.Warned,
  48. i.SupportFor,
  49. i.RestrictedForums,
  50. i.PermittedForums,
  51. i.Inviter,
  52. inviter.Username,
  53. COUNT(posts.id) AS ForumPosts,
  54. i.RatioWatchEnds,
  55. i.RatioWatchDownload,
  56. i.DisableAvatar,
  57. i.DisableInvites,
  58. i.DisablePosting,
  59. i.DisableForums,
  60. i.DisableTagging,
  61. i.DisableUpload,
  62. i.DisableWiki,
  63. i.DisablePM,
  64. i.DisablePoints,
  65. i.DisablePromotion,
  66. i.DisableIRC,
  67. i.DisableRequests," . "
  68. m.FLTokens,
  69. SHA1(i.AdminComment),
  70. i.InfoTitle,
  71. la.Type AS LockedAccount
  72. FROM users_main AS m
  73. JOIN users_info AS i ON i.UserID = m.ID
  74. LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID
  75. LEFT JOIN permissions AS p ON p.ID = m.PermissionID
  76. LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID
  77. LEFT JOIN locked_accounts AS la ON la.UserID = m.ID
  78. WHERE m.ID = '$UserID'
  79. GROUP BY AuthorID");
  80. if (!$DB->has_results()) { // If user doesn't exist
  81. header("Location: log.php?search=User+$UserID");
  82. }
  83. list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $BonusPoints, $IRCLines, $JoinDate, $Info, $Avatar, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisablePoints, $DisablePromotion, $DisableIRC, $DisableRequests, $FLTokens, $CommentHash, $InfoTitle, $LockedAccount) = $DB->next_record(MYSQLI_NUM, array(8, 11));
  84. } else { // Person viewing is a normal user
  85. $DB->query("
  86. SELECT
  87. m.Username,
  88. m.Email,
  89. m.LastAccess,
  90. m.IP,
  91. p.Level AS Class,
  92. m.Uploaded,
  93. m.Downloaded,
  94. m.RequiredRatio,
  95. m.Enabled,
  96. m.Paranoia,
  97. m.Invites,
  98. m.Title,
  99. m.torrent_pass,
  100. m.can_leech,
  101. i.JoinDate,
  102. i.Info,
  103. i.Avatar,
  104. m.FLTokens,
  105. m.BonusPoints,
  106. m.IRCLines,
  107. i.Donor,
  108. i.Warned,
  109. COUNT(posts.id) AS ForumPosts,
  110. i.Inviter,
  111. i.DisableInvites,
  112. inviter.username,
  113. i.InfoTitle
  114. FROM users_main AS m
  115. JOIN users_info AS i ON i.UserID = m.ID
  116. LEFT JOIN permissions AS p ON p.ID = m.PermissionID
  117. LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID
  118. LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID
  119. WHERE m.ID = $UserID
  120. GROUP BY AuthorID");
  121. if (!$DB->has_results()) { // If user doesn't exist
  122. header("Location: log.php?search=User+$UserID");
  123. }
  124. list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded,
  125. $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass,
  126. $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $BonusPoints, $IRCLines, $Donor, $Warned,
  127. $ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(9, 11));
  128. }
  129. $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
  130. $DB->query("
  131. SELECT SUM(t.Size)
  132. FROM xbt_files_users AS xfu
  133. JOIN torrents AS t on t.ID = xfu.fid
  134. WHERE
  135. xfu.uid = '$UserID'
  136. AND xfu.active = 1
  137. AND xfu.Remaining = 0");
  138. if ($DB->has_results()) {
  139. list($TotalSeeding) = $DB->next_record(MYSQLI_NUM, false);
  140. }
  141. // Image proxy CTs
  142. $DisplayCustomTitle = $CustomTitle;
  143. if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
  144. $DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
  145. function($Matches) {
  146. return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
  147. }, $CustomTitle);
  148. }
  149. if ($Preview == 1) {
  150. if (strlen($ParanoiaString) == 0) {
  151. $Paranoia = array();
  152. } else {
  153. $Paranoia = $CustomParanoia;
  154. }
  155. } else {
  156. $Paranoia = unserialize($Paranoia);
  157. if (!is_array($Paranoia)) {
  158. $Paranoia = array();
  159. }
  160. }
  161. $ParanoiaLevel = 0;
  162. foreach ($Paranoia as $P) {
  163. $ParanoiaLevel++;
  164. if (strpos($P, '+') !== false) {
  165. $ParanoiaLevel++;
  166. }
  167. }
  168. $JoinedDate = time_diff($JoinDate);
  169. $LastAccess = time_diff($LastAccess);
  170. function check_paranoia_here($Setting) {
  171. global $Paranoia, $Class, $UserID, $Preview;
  172. if ($Preview == 1) {
  173. return check_paranoia($Setting, $Paranoia, $Class);
  174. } else {
  175. return check_paranoia($Setting, $Paranoia, $Class, $UserID);
  176. }
  177. }
  178. View::show_header($Username, "jquery.imagesloaded,user,bbcode,requests,comments,info_paster,wall");
  179. ?>
  180. <div class="thin">
  181. <div class="header">
  182. <h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2>
  183. </div>
  184. <div class="linkbox">
  185. <?
  186. if (!$OwnProfile) {
  187. ?>
  188. <a href="inbox.php?action=compose&amp;to=<?=$UserID?>" class="brackets">Send message</a>
  189. <?
  190. $DB->query("
  191. SELECT FriendID
  192. FROM friends
  193. WHERE UserID = '$LoggedUser[ID]'
  194. AND FriendID = '$UserID'");
  195. if (!$DB->has_results()) {
  196. ?>
  197. <a href="friends.php?action=add&amp;friendid=<?=$UserID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Add to friends</a>
  198. <? } ?>
  199. <a href="reports.php?action=report&amp;type=user&amp;id=<?=$UserID?>" class="brackets">Report user</a>
  200. <?
  201. }
  202. if (check_perms('users_edit_profiles', $Class) || $LoggedUser['ID'] == $UserID) {
  203. ?>
  204. <a href="user.php?action=edit&amp;userid=<?=$UserID?>" class="brackets">Settings</a>
  205. <?
  206. }
  207. if ($LoggedUser['ID'] == $UserID) {
  208. ?>
  209. <a href="userhistory.php?action=useremail&userid=<?=$UserID?>" class="brackets">Email History</a>
  210. <?
  211. }
  212. if (check_perms('users_view_invites', $Class)) {
  213. ?>
  214. <a href="user.php?action=invite&amp;userid=<?=$UserID?>" class="brackets">Invites</a>
  215. <?
  216. }
  217. if (check_perms('admin_manage_permissions', $Class)) {
  218. ?>
  219. <a href="user.php?action=permissions&amp;userid=<?=$UserID?>" class="brackets">Permissions</a>
  220. <?
  221. }
  222. if (check_perms('users_view_ips', $Class)) {
  223. ?>
  224. <a href="user.php?action=sessions&amp;userid=<?=$UserID?>" class="brackets">Sessions</a>
  225. <?
  226. }
  227. if (check_perms('admin_reports')) {
  228. ?>
  229. <a href="reportsv2.php?view=reporter&amp;id=<?=$UserID?>" class="brackets">Reports</a>
  230. <?
  231. }
  232. if (check_perms('users_mod')) {
  233. ?>
  234. <a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>" class="brackets">FL tokens</a>
  235. <?
  236. }
  237. if (check_perms('admin_clear_cache') && check_perms('users_override_paranoia')) {
  238. ?>
  239. <a href="user.php?action=clearcache&amp;id=<?=$UserID?>" class="brackets">Clear cache</a>
  240. <?
  241. }
  242. if (check_perms('users_mod')) {
  243. ?>
  244. <a href="#staff_tools" class="brackets">Jump to staff tools</a>
  245. <?
  246. }
  247. ?>
  248. </div>
  249. <div class="sidebar">
  250. <?
  251. if ($Avatar && Users::has_avatars_enabled()) {
  252. ?>
  253. <div class="box box_image box_image_avatar">
  254. <div class="head colhead_dark">User</div>
  255. <div class="avatar" align="center">
  256. <?= Users::show_avatar($Avatar, $UserID, $Username, $HeavyInfo['DisableAvatars'])?>
  257. </div>
  258. </div>
  259. <? }
  260. $Badges = Badges::get_badges($UserID);
  261. if (!empty($Badges)) { ?>
  262. <div class="box">
  263. <div class="head colhead_dark">Badges</div>
  264. <div class="pad">
  265. <?=Badges::display_badges($Badges, true)?>
  266. </div>
  267. </div>
  268. <?
  269. }
  270. if (!$OwnProfile && !$LoggedUser['DisablePoints']) { ?>
  271. <div class="box point_gift_box">
  272. <div class="head colhead_dark">Send <?=BONUS_POINTS?></div>
  273. <div class="pad">
  274. <form action="user.php" method="post">
  275. <input type="hidden" name="action" value="points">
  276. <input type="hidden" name="to" value="<?=$UserID?>">
  277. <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 != NULL) {
  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 = apc_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 != NULL
  629. && (time() < strtotime($RatioWatchEnds))
  630. && ($Downloaded * $RequiredRatio) > $Uploaded
  631. ) {
  632. ?>
  633. <div class="box">
  634. <div class="head">Ratio watch</div>
  635. <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>
  636. </div>
  637. <?
  638. }
  639. ?>
  640. <div class="box">
  641. <div class="head">
  642. <?=!empty($InfoTitle) ? $InfoTitle : 'Profile';?>
  643. <span style="float: right;"><a toggle-target="#profilediv" toggle-replace="Show" class="brackets">Hide</a></span>&nbsp;
  644. </div>
  645. <div class="pad profileinfo" id="profilediv">
  646. <?
  647. if (!$Info) {
  648. ?>
  649. This profile is currently empty.
  650. <?
  651. } else {
  652. echo Text::full_format($Info);
  653. }
  654. ?>
  655. </div>
  656. </div>
  657. <?
  658. DonationsView::render_profile_rewards($EnabledRewards, $ProfileRewards);
  659. if (check_paranoia_here('snatched')) {
  660. $RecentSnatches = $Cache->get_value("recent_snatches_$UserID");
  661. if ($RecentSnatches === false) {
  662. $DB->query("
  663. SELECT
  664. g.ID,
  665. g.Name,
  666. g.NameRJ,
  667. g.NameJP,
  668. g.WikiImage
  669. FROM xbt_snatched AS s
  670. INNER JOIN torrents AS t ON t.ID = s.fid
  671. INNER JOIN torrents_group AS g ON t.GroupID = g.ID
  672. WHERE s.uid = '$UserID'
  673. AND g.WikiImage != ''
  674. GROUP BY g.ID,s.tstamp
  675. ORDER BY s.tstamp DESC
  676. LIMIT 5");
  677. $RecentSnatches = $DB->to_array();
  678. $Artists = Artists::get_artists($DB->collect('ID'));
  679. foreach ($RecentSnatches as $Key => $SnatchInfo) {
  680. $RecentSnatches[$Key]['Artist'] = Artists::display_artists($Artists[$SnatchInfo['ID']], false, true);
  681. }
  682. $Cache->cache_value("recent_snatches_$UserID", $RecentSnatches, 0); //inf cache
  683. }
  684. if (!empty($RecentSnatches)) {
  685. ?>
  686. <div class="box" id="recent_snatches">
  687. <div class="head">
  688. Recent Snatches
  689. <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;
  690. </div>
  691. <div id="recent_snatches_images" class="collage_images hidden">
  692. <? foreach ($RecentSnatches as $RS) {
  693. $RSName = empty($RS['Name']) ? (empty($RS['NameRJ']) ? $RS['NameJP'] : $RS['NameRJ']) : $RS['Name'];
  694. ?>
  695. <div style='width: 100px;' class='collage_image' >
  696. <a href="torrents.php?id=<?=$RS['ID']?>">
  697. <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%" />
  698. </a>
  699. </div>
  700. <? } ?>
  701. </div>
  702. </div>
  703. <?
  704. }
  705. }
  706. if (check_paranoia_here('uploads')) {
  707. $RecentUploads = $Cache->get_value("recent_uploads_$UserID");
  708. if ($RecentUploads === false) {
  709. $DB->query("
  710. SELECT
  711. g.ID,
  712. g.Name,
  713. g.NameRJ,
  714. g.NameJP,
  715. g.WikiImage
  716. FROM torrents_group AS g
  717. INNER JOIN torrents AS t ON t.GroupID = g.ID
  718. WHERE t.UserID = '$UserID'
  719. AND g.WikiImage != ''
  720. GROUP BY g.ID,t.Time
  721. ORDER BY t.Time DESC
  722. LIMIT 5");
  723. $RecentUploads = $DB->to_array();
  724. $Artists = Artists::get_artists($DB->collect('ID'));
  725. foreach ($RecentUploads as $Key => $UploadInfo) {
  726. $RecentUploads[$Key]['Artist'] = Artists::display_artists($Artists[$UploadInfo['ID']], false, true);
  727. }
  728. $Cache->cache_value("recent_uploads_$UserID", $RecentUploads, 0); //inf cache
  729. }
  730. if (!empty($RecentUploads)) {
  731. ?>
  732. <div class="box" id="recent_uploads">
  733. <div class="head">
  734. Recent Uploads
  735. <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;
  736. </div>
  737. <div id="recent_uploads_images" class="collage_images hidden">
  738. <? foreach ($RecentUploads as $RU) {
  739. $RUName = empty($RU['Name']) ? (empty($RU['NameRJ']) ? $RU['NameJP'] : $RU['NameRJ']) : $RU['Name'];
  740. ?>
  741. <div style='width: 100px;' class='collage_image' >
  742. <a href="torrents.php?id=<?=$RU['ID']?>">
  743. <img class="tooltip" title="<?=$RU['Artist']?><?=$RUName?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RUName?>" width="100%" />
  744. </a>
  745. </div>
  746. <? } ?>
  747. </div>
  748. </div>
  749. <?
  750. }
  751. }
  752. $DB->query("
  753. SELECT ID, Name
  754. FROM collages
  755. WHERE UserID = '$UserID'
  756. AND CategoryID = '0'
  757. AND Deleted = '0'
  758. ORDER BY Featured DESC,
  759. Name ASC");
  760. $Collages = $DB->to_array(false, MYSQLI_NUM, false);
  761. foreach ($Collages as $CollageInfo) {
  762. list($CollageID, $CName) = $CollageInfo;
  763. $DB->query("
  764. SELECT ct.GroupID,
  765. tg.WikiImage,
  766. tg.CategoryID
  767. FROM collages_torrents AS ct
  768. JOIN torrents_group AS tg ON tg.ID = ct.GroupID
  769. WHERE ct.CollageID = '$CollageID'
  770. ORDER BY ct.Sort
  771. LIMIT 5");
  772. $Collage = $DB->to_array(false, MYSQLI_ASSOC, false);
  773. ?>
  774. <div class="box" id="collage<?=$CollageID?>_box">
  775. <div class="head">
  776. <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
  777. <span style="float: right;">
  778. <a toggle-target="#collage<?=$CollageID?>_box .collage_images" toggle-replace="Show" class="brackets">Hide</a>
  779. </span>
  780. </div>
  781. <div id="user_collage_images" class="collage_images">
  782. <? foreach ($Collage as $C) {
  783. $Group = Torrents::get_groups(array($C['GroupID']), true, true, false);
  784. extract(Torrents::array_group($Group[$C['GroupID']]));
  785. if (!$C['WikiImage']) {
  786. $C['WikiImage'] = STATIC_SERVER.'common/noartwork/nocover.png';
  787. }
  788. $Name = '';
  789. $Name .= Artists::display_artists($Artists, false, true);
  790. $Name .= $GroupName;
  791. ?>
  792. <div class="collage_image">
  793. <a href="torrents.php?id=<?=$GroupID?>">
  794. <img class="tooltip" title="<?=$Name?>" src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="100%" />
  795. </a>
  796. </div>
  797. <? } ?>
  798. </div>
  799. <script>
  800. $('#user_collage_images .collage_image img').load(function() {
  801. var test = true
  802. $('#user_collage_images .collage_image img').toArray().forEach(function(el) {
  803. if (!el.complete) test = false
  804. })
  805. if (test) wall('#user_collage_images', '.collage_image', 5)
  806. })
  807. wall('#user_collage_images','.collage_image',5)
  808. </script>
  809. </div>
  810. <?
  811. }
  812. ?>
  813. <!-- for the "jump to staff tools" button -->
  814. <a id="staff_tools"></a>
  815. <?
  816. // Linked accounts
  817. if (check_perms('users_mod')) {
  818. include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
  819. user_dupes_table($UserID);
  820. }
  821. if ((check_perms('users_view_invites')) && $Invited > 0) {
  822. include(SERVER_ROOT.'/classes/invite_tree.class.php');
  823. $Tree = new INVITE_TREE($UserID, array('visible' => false));
  824. ?>
  825. <div class="box" id="invitetree_box">
  826. <div class="head">
  827. Invite Tree <span style="float: right"><a toggle-target="#invitetree" class="brackets">Toggle</a></span>
  828. </div>
  829. <div id="invitetree" class="hidden">
  830. <? $Tree->make_tree(); ?>
  831. </div>
  832. </div>
  833. <?
  834. }
  835. if (check_perms('users_mod')) {
  836. DonationsView::render_donation_history(Donations::get_donation_history($UserID));
  837. }
  838. // Requests
  839. if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) {
  840. $SphQL = new SphinxqlQuery();
  841. $SphQLResult = $SphQL->select('id, votes, bounty')
  842. ->from('requests, requests_delta')
  843. ->where('userid', $UserID)
  844. ->where('torrentid', 0)
  845. ->order_by('votes', 'desc')
  846. ->order_by('bounty', 'desc')
  847. ->limit(0, 100, 100) // Limit to 100 requests
  848. ->query();
  849. if ($SphQLResult->has_results()) {
  850. $SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC);
  851. ?>
  852. <div class="box" id="requests_box">
  853. <div class="head">
  854. Requests <span style="float: right;"><a toggle-target="#requests" class="brackets">Show</a></span>
  855. </div>
  856. <div id="requests" class="hidden">
  857. <table cellpadding="6" cellspacing="1" border="0" width="100%">
  858. <tr class="colhead_dark">
  859. <td style="width: 48%;">
  860. <strong>Request Name</strong>
  861. </td>
  862. <td>
  863. <strong>Vote</strong>
  864. </td>
  865. <td>
  866. <strong>Bounty</strong>
  867. </td>
  868. <td>
  869. <strong>Added</strong>
  870. </td>
  871. </tr>
  872. <?
  873. $Requests = Requests::get_requests(array_keys($SphRequests));
  874. foreach ($SphRequests as $RequestID => $SphRequest) {
  875. $Request = $Requests[$RequestID];
  876. $VotesCount = $SphRequest['votes'];
  877. $Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
  878. $CategoryName = $Categories[$Request['CategoryID'] - 1];
  879. if ($CategoryName == 'Music') {
  880. $ArtistForm = Requests::get_artists($RequestID);
  881. $ArtistLink = Artists::display_artists($ArtistForm, true, true);
  882. $FullName = "$ArtistLink<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  883. } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
  884. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  885. } else {
  886. if (!$Request['Title']) { $Request['Title'] = $Request['TitleRJ']; }
  887. if (!$Request['Title']) { $Request['Title'] = $Request['TitleJP']; }
  888. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title]</a>";
  889. }
  890. ?>
  891. <tr class="row">
  892. <td>
  893. <?=$FullName ?>
  894. <div class="tags">
  895. <?
  896. $Tags = $Request['Tags'];
  897. $TagList = array();
  898. foreach ($Tags as $TagID => $TagName) {
  899. $TagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
  900. }
  901. $TagList = implode(', ', $TagList);
  902. ?>
  903. <?=$TagList?>
  904. </div>
  905. </td>
  906. <td>
  907. <span id="vote_count_<?=$RequestID?>"><?=$VotesCount?></span>
  908. <? if (check_perms('site_vote')) { ?>
  909. &nbsp;&nbsp; <a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets">+</a>
  910. <? } ?>
  911. </td>
  912. <td>
  913. <span id="bounty_<?=$RequestID?>"><?=Format::get_size($Bounty)?></span>
  914. </td>
  915. <td>
  916. <?=time_diff($Request['TimeAdded']) ?>
  917. </td>
  918. </tr>
  919. <? } ?>
  920. </table>
  921. </div>
  922. </div>
  923. <?
  924. }
  925. }
  926. $IsFLS = isset($LoggedUser['ExtraClasses'][FLS_TEAM]);
  927. if (check_perms('users_mod', $Class) || $IsFLS) {
  928. $UserLevel = $LoggedUser['EffectiveClass'];
  929. $DB->query("
  930. SELECT
  931. SQL_CALC_FOUND_ROWS
  932. ID,
  933. Subject,
  934. Status,
  935. Level,
  936. AssignedToUser,
  937. Date,
  938. ResolverID
  939. FROM staff_pm_conversations
  940. WHERE UserID = $UserID
  941. AND (Level <= $UserLevel OR AssignedToUser = '".$LoggedUser['ID']."')
  942. ORDER BY Date DESC");
  943. if ($DB->has_results()) {
  944. $StaffPMs = $DB->to_array();
  945. ?>
  946. <div class="box" id="staffpms_box">
  947. <div class="head">
  948. Staff PMs <a toggle-target="#staffpms" class="brackets" style="float:right;">Toggle</a>
  949. </div>
  950. <table width="100%" class="message_table hidden" id="staffpms">
  951. <tr class="colhead">
  952. <td>Subject</td>
  953. <td>Date</td>
  954. <td>Assigned to</td>
  955. <td>Resolved by</td>
  956. </tr>
  957. <?
  958. foreach ($StaffPMs as $StaffPM) {
  959. list($ID, $Subject, $Status, $Level, $AssignedToUser, $Date, $ResolverID) = $StaffPM;
  960. // Get assigned
  961. if ($AssignedToUser == '') {
  962. // Assigned to class
  963. $Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
  964. // No + on Sysops
  965. if ($Assigned != 'Sysop') {
  966. $Assigned .= '+';
  967. }
  968. } else {
  969. // Assigned to user
  970. $Assigned = Users::format_username($UserID, true, true, true, true);
  971. }
  972. if ($ResolverID) {
  973. $Resolver = Users::format_username($ResolverID, true, true, true, true);
  974. } else {
  975. $Resolver = '(unresolved)';
  976. }
  977. ?>
  978. <tr>
  979. <td><a href="staffpm.php?action=viewconv&amp;id=<?=$ID?>"><?=display_str($Subject)?></a></td>
  980. <td><?=time_diff($Date, 2, true)?></td>
  981. <td><?=$Assigned?></td>
  982. <td><?=$Resolver?></td>
  983. </tr>
  984. <? } ?>
  985. </table>
  986. </div>
  987. <?
  988. }
  989. }
  990. // Displays a table of forum warnings viewable only to Forum Moderators
  991. if ($LoggedUser['Class'] == 650 && check_perms('users_warn', $Class)) {
  992. $DB->query("
  993. SELECT Comment
  994. FROM users_warnings_forums
  995. WHERE UserID = '$UserID'");
  996. list($ForumWarnings) = $DB->next_record();
  997. if ($DB->has_results()) {
  998. ?>
  999. <div class="box">
  1000. <div class="head">Forum warnings</div>
  1001. <div class="pad">
  1002. <div id="forumwarningslinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($ForumWarnings)?></div>
  1003. </div>
  1004. </div>
  1005. <?
  1006. }
  1007. }
  1008. if (check_perms('users_mod', $Class)) { ?>
  1009. <form class="manage_form" name="user" id="form" action="user.php" method="post">
  1010. <input type="hidden" name="action" value="moderate" />
  1011. <input type="hidden" name="userid" value="<?=$UserID?>" />
  1012. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  1013. <div class="box box2" id="staff_notes_box">
  1014. <div class="head">
  1015. Staff Notes
  1016. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
  1017. <span style="float: right;">
  1018. <a toggle-target="#staffnotes" class="brackets">Toggle</a>
  1019. </span>
  1020. </div>
  1021. <div id="staffnotes" class="pad">
  1022. <input type="hidden" name="comment_hash" value="<?=$CommentHash?>" />
  1023. <div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($AdminComment)?></div>
  1024. <textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?=display_str($AdminComment)?></textarea>
  1025. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a>
  1026. <script type="text/javascript">
  1027. resize('admincomment');
  1028. </script>
  1029. </div>
  1030. </div>
  1031. <table class="layout box" id="user_info_box">
  1032. <tr class="colhead">
  1033. <td colspan="2">
  1034. User Information
  1035. </td>
  1036. </tr>
  1037. <? if (check_perms('users_edit_usernames', $Class)) { ?>
  1038. <tr>
  1039. <td class="label">Username:</td>
  1040. <td><input type="text" size="20" name="Username" value="<?=display_str($Username)?>" /></td>
  1041. </tr>
  1042. <?
  1043. }
  1044. if (check_perms('users_edit_titles')) {
  1045. ?>
  1046. <tr>
  1047. <td class="label">Custom title:</td>
  1048. <td><input type="text" class="wide_input_text" name="Title" value="<?=display_str($CustomTitle)?>" /></td>
  1049. </tr>
  1050. <?
  1051. }
  1052. if (check_perms('users_promote_below', $Class) || check_perms('users_promote_to', $Class - 1)) {
  1053. ?>
  1054. <tr>
  1055. <td class="label">Primary class:</td>
  1056. <td>
  1057. <select name="Class">
  1058. <?
  1059. foreach ($ClassLevels as $CurClass) {
  1060. if (check_perms('users_promote_below', $Class) && $CurClass['ID'] >= $LoggedUser['EffectiveClass']) {
  1061. break;
  1062. }
  1063. if ($CurClass['ID'] > $LoggedUser['EffectiveClass']) {
  1064. break;
  1065. }
  1066. if ($CurClass['Secondary']) {
  1067. continue;
  1068. }
  1069. if ($Class === $CurClass['Level']) {
  1070. $Selected = ' selected="selected"';
  1071. } else {
  1072. $Selected = '';
  1073. }
  1074. ?>
  1075. <option value="<?=$CurClass['ID']?>"<?=$Selected?>><?=$CurClass['Name'].' ('.$CurClass['Level'].')'?></option>
  1076. <? } ?>
  1077. </select>
  1078. </td>
  1079. </tr>
  1080. <?
  1081. }
  1082. if (check_perms('users_give_donor')) {
  1083. ?>
  1084. <tr>
  1085. <td class="label">Donor:</td>
  1086. <td><input type="checkbox" name="Donor"<? if ($Donor == 1) { ?> checked="checked"<? } ?> /></td>
  1087. </tr>
  1088. <?
  1089. }
  1090. if (check_perms('users_promote_below') || check_perms('users_promote_to')) { ?>
  1091. <tr>
  1092. <td class="label">Secondary classes:</td>
  1093. <td>
  1094. <?
  1095. $DB->query("
  1096. SELECT p.ID, p.Name, l.UserID
  1097. FROM permissions AS p
  1098. LEFT JOIN users_levels AS l ON l.PermissionID = p.ID AND l.UserID = '$UserID'
  1099. WHERE p.Secondary = 1
  1100. ORDER BY p.Name");
  1101. $i = 0;
  1102. while (list($PermID, $PermName, $IsSet) = $DB->next_record()) {
  1103. $i++;
  1104. ?>
  1105. <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>
  1106. <? if ($i % 3 == 0) {
  1107. echo "\t\t\t\t<br />\n";
  1108. }
  1109. } ?>
  1110. </td>
  1111. </tr>
  1112. <? }
  1113. if (check_perms('users_make_invisible')) {
  1114. ?>
  1115. <tr>
  1116. <td class="label">Visible in peer lists:</td>
  1117. <td><input type="checkbox" name="Visible"<? if ($Visible == 1) { ?> checked="checked"<? } ?> /></td>
  1118. </tr>
  1119. <?
  1120. }
  1121. if (check_perms('users_edit_ratio', $Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
  1122. ?>
  1123. <tr>
  1124. <td class="label tooltip" title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Uploaded:</td>
  1125. <td>
  1126. <input type="hidden" name="OldUploaded" value="<?=$Uploaded?>" />
  1127. <input type="text" size="20" name="Uploaded" value="<?=$Uploaded?>" />
  1128. </td>
  1129. </tr>
  1130. <tr>
  1131. <td class="label tooltip" title="Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Downloaded:</td>
  1132. <td>
  1133. <input type="hidden" name="OldDownloaded" value="<?=$Downloaded?>" />
  1134. <input type="text" size="20" name="Downloaded" value="<?=$Downloaded?>" />
  1135. </td>
  1136. </tr>
  1137. <tr>
  1138. <td class="label"><?=BONUS_POINTS?>:</td>
  1139. <td>
  1140. <input type="text" size="20" name="BonusPoints" value="<?=$BonusPoints?>" />
  1141. <?
  1142. if (!$DisablePoints) {
  1143. $PointsRate = 0.5;
  1144. $getTorrents = $DB->query("
  1145. SELECT COUNT(DISTINCT x.fid) AS Torrents,
  1146. SUM(t.Size) AS Size,
  1147. SUM(xs.seedtime) AS Seedtime,
  1148. SUM(t.Seeders) AS Seeders
  1149. FROM users_main AS um
  1150. LEFT JOIN users_info AS i on um.ID = i.UserID
  1151. LEFT JOIN xbt_files_users AS x ON um.ID=x.uid
  1152. LEFT JOIN torrents AS t ON t.ID=x.fid
  1153. LEFT JOIN xbt_snatched AS xs ON x.uid=xs.uid AND x.fid=xs.fid
  1154. WHERE
  1155. um.ID = $UserID
  1156. AND um.Enabled = '1'
  1157. AND x.active = 1
  1158. AND x.completed = 0
  1159. AND x.Remaining = 0
  1160. GROUP BY um.ID");
  1161. if ($DB->has_results()) {
  1162. list($NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
  1163. $PointsRate += (0.67*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3));
  1164. }
  1165. $PointsRate = intval($PointsRate**0.95);
  1166. $PointsPerHour = number_format($PointsRate)." ".BONUS_POINTS."/hour";
  1167. $PointsPerDay = number_format($PointsRate*24)." ".BONUS_POINTS."/day";
  1168. } else {
  1169. $PointsPerHour = "0 ".BONUS_POINTS."/hour";
  1170. $PointsPerDay = BONUS_POINTS." disabled";
  1171. }
  1172. ?>
  1173. <?=$PointsPerHour?> (<?=$PointsPerDay?>)
  1174. </td>
  1175. </tr>
  1176. <tr>
  1177. <td class="label tooltip" title="Enter a username.">Merge stats <strong>from:</strong></td>
  1178. <td>
  1179. <input type="text" size="40" name="MergeStatsFrom" />
  1180. </td>
  1181. </tr>
  1182. <tr>
  1183. <td class="label">Freeleech tokens:</td>
  1184. <td>
  1185. <input type="text" size="5" name="FLTokens" value="<?=$FLTokens?>" />
  1186. </td>
  1187. </tr>
  1188. <?
  1189. }
  1190. if (check_perms('users_edit_invites')) {
  1191. ?>
  1192. <tr>
  1193. <td class="label tooltip" title="Number of invites">Invites:</td>
  1194. <td><input type="text" size="5" name="Invites" value="<?=$Invites?>" /></td>
  1195. </tr>
  1196. <?
  1197. }
  1198. if (check_perms('admin_manage_fls') || (check_perms('users_mod') && $OwnProfile)) {
  1199. ?>
  1200. <tr>
  1201. <td class="label tooltip" title="This is the message shown in the right-hand column on /staff.php">FLS/Staff remark:</td>
  1202. <td><input type="text" class="wide_input_text" name="SupportFor" value="<?=display_str($SupportFor)?>" /></td>
  1203. </tr>
  1204. <?
  1205. }
  1206. if (check_perms('users_edit_reset_keys')) {
  1207. ?>
  1208. <tr>
  1209. <td class="label">Reset:</td>
  1210. <td>
  1211. <input type="checkbox" name="ResetRatioWatch" id="ResetRatioWatch" /> <label for="ResetRatioWatch">Ratio watch</label> |
  1212. <input type="checkbox" name="ResetPasskey" id="ResetPasskey" /> <label for="ResetPasskey">Passkey</label> |
  1213. <input type="checkbox" name="ResetAuthkey" id="ResetAuthkey" /> <label for="ResetAuthkey">Authkey</label> |
  1214. <input type="checkbox" name="ResetIPHistory" id="ResetIPHistory" /> <label for="ResetIPHistory">IP history</label> |
  1215. <input type="checkbox" name="ResetEmailHistory" id="ResetEmailHistory" /> <label for="ResetEmailHistory">Email history</label>
  1216. <br />
  1217. <input type="checkbox" name="ResetSnatchList" id="ResetSnatchList" /> <label for="ResetSnatchList">Snatch list</label> |
  1218. <input type="checkbox" name="ResetDownloadList" id="ResetDownloadList" /> <label for="ResetDownloadList">Download list</label>
  1219. </td>
  1220. </tr>
  1221. <?
  1222. }
  1223. if (check_perms('users_edit_password')) {
  1224. ?>
  1225. <tr>
  1226. <td class="label">New password:</td>
  1227. <td>
  1228. <input type="text" size="30" id="change_password" name="ChangePassword" />
  1229. <button type="button" id="random_password">Generate</button>
  1230. </td>
  1231. </tr>
  1232. <? }
  1233. if (check_perms('users_edit_badges')) {
  1234. ?>
  1235. <tr id="user_badge_edit_tr">
  1236. <td class="label">Badges Owned:</td>
  1237. <td>
  1238. <?
  1239. $DB->query("
  1240. SELECT ID AS BadgeID, Icon, Name, Description
  1241. FROM badges");
  1242. if ($DB->has_results()) { //If the DB has no results here, something is dangerously fucked
  1243. $AllBadges = $DB->to_array();
  1244. $UserBadgeIDs = array();
  1245. foreach (Badges::get_badges($UserID) as $Badge) {
  1246. $UserBadgeIDs[] = $Badge['BadgeID'];
  1247. }
  1248. $i = 0;
  1249. foreach ($AllBadges as $Badge) {
  1250. ?><input type="checkbox" name="badges[]" class="badge_checkbox" value="<?=$Badge['BadgeID']?>" <?=(in_array($Badge['BadgeID'], $UserBadgeIDs))?" checked":""?>/><?=Badges::display_badge($Badge, true)?>
  1251. <? $i++;
  1252. if ($i % 8 == 0) {
  1253. echo "<br />";
  1254. }
  1255. }
  1256. }
  1257. ?>
  1258. </td>
  1259. </tr>
  1260. <? } ?>
  1261. </table>
  1262. <? if (check_perms('users_warn')) { ?>
  1263. <table class="layout box" id="warn_user_box">
  1264. <tr class="colhead">
  1265. <td colspan="2">
  1266. Warnings
  1267. </td>
  1268. </tr>
  1269. <tr>
  1270. <td class="label">Warned:</td>
  1271. <td>
  1272. <input type="checkbox" name="Warned"<? if ($Warned != NULL) { ?> checked="checked"<? } ?> />
  1273. </td>
  1274. </tr>
  1275. <? if ($Warned == NULL) { // user is not warned ?>
  1276. <tr>
  1277. <td class="label">Expiration:</td>
  1278. <td>
  1279. <select name="WarnLength">
  1280. <option value="">---</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. <? } else { // user is warned ?>
  1289. <tr>
  1290. <td class="label">Extension:</td>
  1291. <td>
  1292. <select name="ExtendWarning" onchange="ToggleWarningAdjust(this);">
  1293. <option>---</option>
  1294. <option value="1">1 week</option>
  1295. <option value="2">2 weeks</option>
  1296. <option value="4">4 weeks</option>
  1297. <option value="8">8 weeks</option>
  1298. </select>
  1299. </td>
  1300. </tr>
  1301. <tr id="ReduceWarningTR">
  1302. <td class="label">Reduction:</td>
  1303. <td>
  1304. <select name="ReduceWarning">
  1305. <option>---</option>
  1306. <option value="1">1 week</option>
  1307. <option value="2">2 weeks</option>
  1308. <option value="4">4 weeks</option>
  1309. <option value="8">8 weeks</option>
  1310. </select>
  1311. </td>
  1312. </tr>
  1313. <? } ?>
  1314. <tr>
  1315. <td class="label tooltip" title="This message *will* be sent to the user in the warning PM!">Warning reason:</td>
  1316. <td>
  1317. <input type="text" class="wide_input_text" name="WarnReason" />
  1318. </td>
  1319. </tr>
  1320. <? } ?>
  1321. </table>
  1322. <? if (check_perms('users_disable_any')) { ?>
  1323. <table class="layout box">
  1324. <tr class="colhead">
  1325. <td colspan="2">
  1326. Lock Account
  1327. </td>
  1328. </tr>
  1329. <tr>
  1330. <td class="label">Lock Account:</td>
  1331. <td>
  1332. <input type="checkbox" name="LockAccount" id="LockAccount" <? if($LockedAccount) { ?> checked="checked" <? } ?>/>
  1333. </td>
  1334. </tr>
  1335. <tr>
  1336. <td class="label">Reason:</td>
  1337. <td>
  1338. <select name="LockReason">
  1339. <option value="---">---</option>
  1340. <option value="<?=STAFF_LOCKED?>" <? if ($LockedAccount == STAFF_LOCKED) { ?> selected <? } ?>>Staff Lock</option>
  1341. </select>
  1342. </td>
  1343. </tr>
  1344. </table>
  1345. <? } ?>
  1346. <table class="layout box" id="user_privs_box">
  1347. <tr class="colhead">
  1348. <td colspan="2">
  1349. User Privileges
  1350. </td>
  1351. </tr>
  1352. <? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
  1353. $DB->query("
  1354. SELECT DISTINCT Email, IP, Time
  1355. FROM users_history_emails
  1356. WHERE UserID = $UserID
  1357. ORDER BY Time ASC");
  1358. $Emails = $DB->to_array();
  1359. ?>
  1360. <tr>
  1361. <td class="label">Disable:</td>
  1362. <td>
  1363. <input type="checkbox" name="DisablePosting" id="DisablePosting"<? if ($DisablePosting == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
  1364. <? if (check_perms('users_disable_any')) { ?> |
  1365. <input type="checkbox" name="DisableAvatar" id="DisableAvatar"<? if ($DisableAvatar == 1) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
  1366. <input type="checkbox" name="DisableForums" id="DisableForums"<? if ($DisableForums == 1) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
  1367. <input type="checkbox" name="DisableIRC" id="DisableIRC"<? if ($DisableIRC == 1) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label> |
  1368. <input type="checkbox" name="DisablePM" id="DisablePM"<? if ($DisablePM == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
  1369. <br /><br />
  1370. <input type="checkbox" name="DisableLeech" id="DisableLeech"<? if ($DisableLeech == 0) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
  1371. <input type="checkbox" name="DisableRequests" id="DisableRequests"<? if ($DisableRequests == 1) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label> |
  1372. <input type="checkbox" name="DisableUpload" id="DisableUpload"<? if ($DisableUpload == 1) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Torrent upload</label> |
  1373. <input type="checkbox" name="DisablePoints" id="DisablePoints"<? if ($DisablePoints == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePoints"><?=BONUS_POINTS?></label>
  1374. <br /><br />
  1375. <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> |
  1376. <input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
  1377. <input type="checkbox" name="DisablePromotion" id="DisablePromotion"<? if ($DisablePromotion == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePromotion">Promotions</label> |
  1378. <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
  1379. </td>
  1380. </tr>
  1381. <tr>
  1382. <td class="label">Hacked:</td>
  1383. <td>
  1384. <input type="checkbox" name="SendHackedMail" id="SendHackedMail" /> <label for="SendHackedMail">Send hacked account email</label> to
  1385. <select name="HackedEmail">
  1386. <?
  1387. foreach ($Emails as $Email) {
  1388. list($Address, $IP) = $Email;
  1389. $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  1390. $Address = apc_exists('DBKEY') ? DBCrypt::decrypt($Address) : '[Encrypted]';
  1391. ?>
  1392. <option value="<?=display_str($Address)?>"><?=display_str($Address)?> - <?=display_str($IP)?></option>
  1393. <? } ?>
  1394. </select>
  1395. </td>
  1396. </tr>
  1397. <?
  1398. }
  1399. }
  1400. if (check_perms('users_disable_any')) {
  1401. ?>
  1402. <tr>
  1403. <td class="label">Account:</td>
  1404. <td>
  1405. <select name="UserStatus">
  1406. <option value="0"<? if ($Enabled == '0') { ?> selected="selected"<? } ?>>Unconfirmed</option>
  1407. <option value="1"<? if ($Enabled == '1') { ?> selected="selected"<? } ?>>Enabled</option>
  1408. <option value="2"<? if ($Enabled == '2') { ?> selected="selected"<? } ?>>Disabled</option>
  1409. <? if (check_perms('users_delete_users')) { ?>
  1410. <optgroup label="-- WARNING --">
  1411. <option value="delete">Delete account</option>
  1412. </optgroup>
  1413. <? } ?>
  1414. </select>
  1415. </td>
  1416. </tr>
  1417. <tr>
  1418. <td class="label">User reason:</td>
  1419. <td>
  1420. <input type="text" class="wide_input_text" name="UserReason" />
  1421. </td>
  1422. </tr>
  1423. <tr>
  1424. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Restricted forums:</td>
  1425. <td>
  1426. <input type="text" class="wide_input_text" name="RestrictedForums" value="<?=display_str($RestrictedForums)?>" />
  1427. </td>
  1428. </tr>
  1429. <tr>
  1430. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Extra forums:</td>
  1431. <td>
  1432. <input type="text" class="wide_input_text" name="PermittedForums" value="<?=display_str($PermittedForums)?>" />
  1433. </td>
  1434. </tr>
  1435. <? } ?>
  1436. </table>
  1437. <? if (check_perms('users_logout')) { ?>
  1438. <table class="layout box" id="session_box">
  1439. <tr class="colhead">
  1440. <td colspan="2">
  1441. Session
  1442. </td>
  1443. </tr>
  1444. <tr>
  1445. <td class="label">Reset session:</td>
  1446. <td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
  1447. </tr>
  1448. <tr>
  1449. <td class="label">Log out:</td>
  1450. <td><input type="checkbox" name="LogOut" id="LogOut" /></td>
  1451. </tr>
  1452. </table>
  1453. <?
  1454. }
  1455. if (check_perms('users_mod')) {
  1456. DonationsView::render_mod_donations($UserID);
  1457. }
  1458. ?>
  1459. <table class="layout box" id="submit_box">
  1460. <tr class="colhead">
  1461. <td colspan="2">
  1462. Submit
  1463. </td>
  1464. </tr>
  1465. <tr>
  1466. <td class="label tooltip" title="This message will be entered into staff notes only.">Reason:</td>
  1467. <td>
  1468. <textarea rows="1" cols="35" class="wide_input_text" name="Reason" id="Reason" onkeyup="resize('Reason');"></textarea>
  1469. </td>
  1470. </tr>
  1471. <tr>
  1472. <td class="label">Paste user stats:</td>
  1473. <td>
  1474. <button type="button" id="paster">Paste</button>
  1475. </td>
  1476. </tr>
  1477. <tr>
  1478. <td align="right" colspan="2">
  1479. <input type="submit" value="Save changes" />
  1480. </td>
  1481. </tr>
  1482. </table>
  1483. </form>
  1484. <?
  1485. }
  1486. ?>
  1487. </div>
  1488. </div>
  1489. <script>
  1490. $('.tooltip').tooltipster();
  1491. </script>
  1492. <? View::show_footer(); ?>