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

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