Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.php 53KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538
  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.WikiImage
  664. FROM xbt_snatched AS s
  665. INNER JOIN torrents AS t ON t.ID = s.fid
  666. INNER JOIN torrents_group AS g ON t.GroupID = g.ID
  667. WHERE s.uid = '$UserID'
  668. AND g.WikiImage != ''
  669. GROUP BY g.ID
  670. ORDER BY s.tstamp DESC
  671. LIMIT 5");
  672. $RecentSnatches = $DB->to_array();
  673. $Artists = Artists::get_artists($DB->collect('ID'));
  674. foreach ($RecentSnatches as $Key => $SnatchInfo) {
  675. $RecentSnatches[$Key]['Artist'] = Artists::display_artists($Artists[$SnatchInfo['ID']], false, true);
  676. }
  677. $Cache->cache_value("recent_snatches_$UserID", $RecentSnatches, 0); //inf cache
  678. }
  679. if (!empty($RecentSnatches)) {
  680. ?>
  681. <div class="box" id="recent_snatches">
  682. <div class="head">
  683. Recent Snatches
  684. <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;
  685. </div>
  686. <div id="recent_snatches_images" class="collage_images hidden">
  687. <? foreach ($RecentSnatches as $RS) { ?>
  688. <div style='width: 100px;' class='collage_image' >
  689. <a href="torrents.php?id=<?=$RS['ID']?>">
  690. <img class="tooltip" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="100%" />
  691. </a>
  692. </div>
  693. <? } ?>
  694. </div>
  695. </div>
  696. <?
  697. }
  698. }
  699. if (check_paranoia_here('uploads')) {
  700. $RecentUploads = $Cache->get_value("recent_uploads_$UserID");
  701. if ($RecentUploads === false) {
  702. $DB->query("
  703. SELECT
  704. g.ID,
  705. g.Name,
  706. g.WikiImage
  707. FROM torrents_group AS g
  708. INNER JOIN torrents AS t ON t.GroupID = g.ID
  709. WHERE t.UserID = '$UserID'
  710. AND g.WikiImage != ''
  711. GROUP BY g.ID
  712. ORDER BY t.Time DESC
  713. LIMIT 5");
  714. $RecentUploads = $DB->to_array();
  715. $Artists = Artists::get_artists($DB->collect('ID'));
  716. foreach ($RecentUploads as $Key => $UploadInfo) {
  717. $RecentUploads[$Key]['Artist'] = Artists::display_artists($Artists[$UploadInfo['ID']], false, true);
  718. }
  719. $Cache->cache_value("recent_uploads_$UserID", $RecentUploads, 0); //inf cache
  720. }
  721. if (!empty($RecentUploads)) {
  722. ?>
  723. <div class="box" id="recent_uploads">
  724. <div class="head">
  725. Recent Uploads
  726. <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;
  727. </div>
  728. <div id="recent_uploads_images" class="collage_images hidden">
  729. <? foreach ($RecentUploads as $RU) { ?>
  730. <div style='width: 100px;' class='collage_image' >
  731. <a href="torrents.php?id=<?=$RU['ID']?>">
  732. <img class="tooltip" title="<?=$RU['Artist']?><?=$RU['Name']?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="100%" />
  733. </a>
  734. </div>
  735. <? } ?>
  736. </div>
  737. </div>
  738. <?
  739. }
  740. }
  741. $DB->query("
  742. SELECT ID, Name
  743. FROM collages
  744. WHERE UserID = '$UserID'
  745. AND CategoryID = '0'
  746. AND Deleted = '0'
  747. ORDER BY Featured DESC,
  748. Name ASC");
  749. $Collages = $DB->to_array(false, MYSQLI_NUM, false);
  750. $FirstCol = true;
  751. foreach ($Collages as $CollageInfo) {
  752. list($CollageID, $CName) = $CollageInfo;
  753. $DB->query("
  754. SELECT ct.GroupID,
  755. tg.WikiImage,
  756. tg.CategoryID
  757. FROM collages_torrents AS ct
  758. JOIN torrents_group AS tg ON tg.ID = ct.GroupID
  759. WHERE ct.CollageID = '$CollageID'
  760. ORDER BY ct.Sort
  761. LIMIT 5");
  762. $Collage = $DB->to_array(false, MYSQLI_ASSOC, false);
  763. ?>
  764. <div class="box" id="collage<?=$CollageID?>_box">
  765. <div class="head">
  766. <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
  767. <span style="float: right;">
  768. <a toggle-target="#collage<?=$CollageID?>_box .images" toggle-replace="<?=$FirstCol ? 'Show' : 'Hide' ?>" class="brackets"><?=$FirstCol ? 'Hide' : 'Show' ?></a>
  769. </span>
  770. </div>
  771. <div id="user_collage_images" class="collage_images">
  772. <? foreach ($Collage as $C) {
  773. $Group = Torrents::get_groups(array($C['GroupID']), true, true, false);
  774. extract(Torrents::array_group($Group[$C['GroupID']]));
  775. $Name = '';
  776. $Name .= Artists::display_artists($Artists, false, true);
  777. $Name .= $GroupName;
  778. ?>
  779. <div class="collage_image">
  780. <a href="torrents.php?id=<?=$GroupID?>">
  781. <img class="tooltip" title="<?=$Name?>" src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="100%" />
  782. </a>
  783. </div>
  784. <? } ?>
  785. </div>
  786. <script>
  787. $('#user_collage_images .collage_image img').load(function() {
  788. var test = true
  789. $('#user_collage_images .collage_image img').toArray().forEach(function(el) {
  790. if (!el.complete) test = false
  791. })
  792. if (test) wall('#user_collage_images', '.collage_image', 5)
  793. })
  794. wall('#user_collage_images','.collage_image',5)
  795. </script>
  796. </div>
  797. <?
  798. $FirstCol = false;
  799. }
  800. ?>
  801. <!-- for the "jump to staff tools" button -->
  802. <a id="staff_tools"></a>
  803. <?
  804. // Linked accounts
  805. if (check_perms('users_mod')) {
  806. include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
  807. user_dupes_table($UserID);
  808. }
  809. if ((check_perms('users_view_invites')) && $Invited > 0) {
  810. include(SERVER_ROOT.'/classes/invite_tree.class.php');
  811. $Tree = new INVITE_TREE($UserID, array('visible' => false));
  812. ?>
  813. <div class="box" id="invitetree_box">
  814. <div class="head">
  815. Invite Tree <span style="float: right"><a toggle-target="#invitetree" class="brackets">Toggle</a></span>
  816. </div>
  817. <div id="invitetree" class="hidden">
  818. <? $Tree->make_tree(); ?>
  819. </div>
  820. </div>
  821. <?
  822. }
  823. if (check_perms('users_mod')) {
  824. DonationsView::render_donation_history(Donations::get_donation_history($UserID));
  825. }
  826. // Requests
  827. if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) {
  828. $SphQL = new SphinxqlQuery();
  829. $SphQLResult = $SphQL->select('id, votes, bounty')
  830. ->from('requests, requests_delta')
  831. ->where('userid', $UserID)
  832. ->where('torrentid', 0)
  833. ->order_by('votes', 'desc')
  834. ->order_by('bounty', 'desc')
  835. ->limit(0, 100, 100) // Limit to 100 requests
  836. ->query();
  837. if ($SphQLResult->has_results()) {
  838. $SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC);
  839. ?>
  840. <div class="box" id="requests_box">
  841. <div class="head">
  842. Requests <span style="float: right;"><a toggle-target="#requests" class="brackets">Show</a></span>
  843. </div>
  844. <div id="requests" class="hidden">
  845. <table cellpadding="6" cellspacing="1" border="0" width="100%">
  846. <tr class="colhead_dark">
  847. <td style="width: 48%;">
  848. <strong>Request Name</strong>
  849. </td>
  850. <td>
  851. <strong>Vote</strong>
  852. </td>
  853. <td>
  854. <strong>Bounty</strong>
  855. </td>
  856. <td>
  857. <strong>Added</strong>
  858. </td>
  859. </tr>
  860. <?
  861. $Requests = Requests::get_requests(array_keys($SphRequests));
  862. foreach ($SphRequests as $RequestID => $SphRequest) {
  863. $Request = $Requests[$RequestID];
  864. $VotesCount = $SphRequest['votes'];
  865. $Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
  866. $CategoryName = $Categories[$Request['CategoryID'] - 1];
  867. if ($CategoryName == 'Music') {
  868. $ArtistForm = Requests::get_artists($RequestID);
  869. $ArtistLink = Artists::display_artists($ArtistForm, true, true);
  870. $FullName = "$ArtistLink<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  871. } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
  872. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
  873. } else {
  874. $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title]</a>";
  875. }
  876. ?>
  877. <tr class="row">
  878. <td>
  879. <?=$FullName ?>
  880. <div class="tags">
  881. <?
  882. $Tags = $Request['Tags'];
  883. $TagList = array();
  884. foreach ($Tags as $TagID => $TagName) {
  885. $TagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
  886. }
  887. $TagList = implode(', ', $TagList);
  888. ?>
  889. <?=$TagList?>
  890. </div>
  891. </td>
  892. <td>
  893. <span id="vote_count_<?=$RequestID?>"><?=$VotesCount?></span>
  894. <? if (check_perms('site_vote')) { ?>
  895. &nbsp;&nbsp; <a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets">+</a>
  896. <? } ?>
  897. </td>
  898. <td>
  899. <span id="bounty_<?=$RequestID?>"><?=Format::get_size($Bounty)?></span>
  900. </td>
  901. <td>
  902. <?=time_diff($Request['TimeAdded']) ?>
  903. </td>
  904. </tr>
  905. <? } ?>
  906. </table>
  907. </div>
  908. </div>
  909. <?
  910. }
  911. }
  912. $IsFLS = isset($LoggedUser['ExtraClasses'][FLS_TEAM]);
  913. if (check_perms('users_mod', $Class) || $IsFLS) {
  914. $UserLevel = $LoggedUser['EffectiveClass'];
  915. $DB->query("
  916. SELECT
  917. SQL_CALC_FOUND_ROWS
  918. ID,
  919. Subject,
  920. Status,
  921. Level,
  922. AssignedToUser,
  923. Date,
  924. ResolverID
  925. FROM staff_pm_conversations
  926. WHERE UserID = $UserID
  927. AND (Level <= $UserLevel OR AssignedToUser = '".$LoggedUser['ID']."')
  928. ORDER BY Date DESC");
  929. if ($DB->has_results()) {
  930. $StaffPMs = $DB->to_array();
  931. ?>
  932. <div class="box" id="staffpms_box">
  933. <div class="head">
  934. Staff PMs <a toggle-target="#staffpms" class="brackets" style="float:right;">Toggle</a>
  935. </div>
  936. <table width="100%" class="message_table hidden" id="staffpms">
  937. <tr class="colhead">
  938. <td>Subject</td>
  939. <td>Date</td>
  940. <td>Assigned to</td>
  941. <td>Resolved by</td>
  942. </tr>
  943. <?
  944. foreach ($StaffPMs as $StaffPM) {
  945. list($ID, $Subject, $Status, $Level, $AssignedToUser, $Date, $ResolverID) = $StaffPM;
  946. // Get assigned
  947. if ($AssignedToUser == '') {
  948. // Assigned to class
  949. $Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
  950. // No + on Sysops
  951. if ($Assigned != 'Sysop') {
  952. $Assigned .= '+';
  953. }
  954. } else {
  955. // Assigned to user
  956. $Assigned = Users::format_username($UserID, true, true, true, true);
  957. }
  958. if ($ResolverID) {
  959. $Resolver = Users::format_username($ResolverID, true, true, true, true);
  960. } else {
  961. $Resolver = '(unresolved)';
  962. }
  963. ?>
  964. <tr>
  965. <td><a href="staffpm.php?action=viewconv&amp;id=<?=$ID?>"><?=display_str($Subject)?></a></td>
  966. <td><?=time_diff($Date, 2, true)?></td>
  967. <td><?=$Assigned?></td>
  968. <td><?=$Resolver?></td>
  969. </tr>
  970. <? } ?>
  971. </table>
  972. </div>
  973. <?
  974. }
  975. }
  976. // Displays a table of forum warnings viewable only to Forum Moderators
  977. if ($LoggedUser['Class'] == 650 && check_perms('users_warn', $Class)) {
  978. $DB->query("
  979. SELECT Comment
  980. FROM users_warnings_forums
  981. WHERE UserID = '$UserID'");
  982. list($ForumWarnings) = $DB->next_record();
  983. if ($DB->has_results()) {
  984. ?>
  985. <div class="box">
  986. <div class="head">Forum warnings</div>
  987. <div class="pad">
  988. <div id="forumwarningslinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($ForumWarnings)?></div>
  989. </div>
  990. </div>
  991. <?
  992. }
  993. }
  994. if (check_perms('users_mod', $Class)) { ?>
  995. <form class="manage_form" name="user" id="form" action="user.php" method="post">
  996. <input type="hidden" name="action" value="moderate" />
  997. <input type="hidden" name="userid" value="<?=$UserID?>" />
  998. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  999. <div class="box box2" id="staff_notes_box">
  1000. <div class="head">
  1001. Staff Notes
  1002. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
  1003. <span style="float: right;">
  1004. <a toggle-target="#staffnotes" class="brackets">Toggle</a>
  1005. </span>
  1006. </div>
  1007. <div id="staffnotes" class="pad">
  1008. <input type="hidden" name="comment_hash" value="<?=$CommentHash?>" />
  1009. <div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($AdminComment)?></div>
  1010. <textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?=display_str($AdminComment)?></textarea>
  1011. <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a>
  1012. <script type="text/javascript">
  1013. resize('admincomment');
  1014. </script>
  1015. </div>
  1016. </div>
  1017. <table class="layout box" id="user_info_box">
  1018. <tr class="colhead">
  1019. <td colspan="2">
  1020. User Information
  1021. </td>
  1022. </tr>
  1023. <? if (check_perms('users_edit_usernames', $Class)) { ?>
  1024. <tr>
  1025. <td class="label">Username:</td>
  1026. <td><input type="text" size="20" name="Username" value="<?=display_str($Username)?>" /></td>
  1027. </tr>
  1028. <?
  1029. }
  1030. if (check_perms('users_edit_titles')) {
  1031. ?>
  1032. <tr>
  1033. <td class="label">Custom title:</td>
  1034. <td><input type="text" class="wide_input_text" name="Title" value="<?=display_str($CustomTitle)?>" /></td>
  1035. </tr>
  1036. <?
  1037. }
  1038. if (check_perms('users_promote_below', $Class) || check_perms('users_promote_to', $Class - 1)) {
  1039. ?>
  1040. <tr>
  1041. <td class="label">Primary class:</td>
  1042. <td>
  1043. <select name="Class">
  1044. <?
  1045. foreach ($ClassLevels as $CurClass) {
  1046. if (check_perms('users_promote_below', $Class) && $CurClass['ID'] >= $LoggedUser['EffectiveClass']) {
  1047. break;
  1048. }
  1049. if ($CurClass['ID'] > $LoggedUser['EffectiveClass']) {
  1050. break;
  1051. }
  1052. if ($CurClass['Secondary']) {
  1053. continue;
  1054. }
  1055. if ($Class === $CurClass['Level']) {
  1056. $Selected = ' selected="selected"';
  1057. } else {
  1058. $Selected = '';
  1059. }
  1060. ?>
  1061. <option value="<?=$CurClass['ID']?>"<?=$Selected?>><?=$CurClass['Name'].' ('.$CurClass['Level'].')'?></option>
  1062. <? } ?>
  1063. </select>
  1064. </td>
  1065. </tr>
  1066. <?
  1067. }
  1068. if (check_perms('users_give_donor')) {
  1069. ?>
  1070. <tr>
  1071. <td class="label">Donor:</td>
  1072. <td><input type="checkbox" name="Donor"<? if ($Donor == 1) { ?> checked="checked"<? } ?> /></td>
  1073. </tr>
  1074. <?
  1075. }
  1076. if (check_perms('users_promote_below') || check_perms('users_promote_to')) { ?>
  1077. <tr>
  1078. <td class="label">Secondary classes:</td>
  1079. <td>
  1080. <?
  1081. $DB->query("
  1082. SELECT p.ID, p.Name, l.UserID
  1083. FROM permissions AS p
  1084. LEFT JOIN users_levels AS l ON l.PermissionID = p.ID AND l.UserID = '$UserID'
  1085. WHERE p.Secondary = 1
  1086. ORDER BY p.Name");
  1087. $i = 0;
  1088. while (list($PermID, $PermName, $IsSet) = $DB->next_record()) {
  1089. $i++;
  1090. ?>
  1091. <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>
  1092. <? if ($i % 3 == 0) {
  1093. echo "\t\t\t\t<br />\n";
  1094. }
  1095. } ?>
  1096. </td>
  1097. </tr>
  1098. <? }
  1099. if (check_perms('users_make_invisible')) {
  1100. ?>
  1101. <tr>
  1102. <td class="label">Visible in peer lists:</td>
  1103. <td><input type="checkbox" name="Visible"<? if ($Visible == 1) { ?> checked="checked"<? } ?> /></td>
  1104. </tr>
  1105. <?
  1106. }
  1107. if (check_perms('users_edit_ratio', $Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
  1108. ?>
  1109. <tr>
  1110. <td class="label tooltip" title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Uploaded:</td>
  1111. <td>
  1112. <input type="hidden" name="OldUploaded" value="<?=$Uploaded?>" />
  1113. <input type="text" size="20" name="Uploaded" value="<?=$Uploaded?>" />
  1114. </td>
  1115. </tr>
  1116. <tr>
  1117. <td class="label tooltip" title="Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Downloaded:</td>
  1118. <td>
  1119. <input type="hidden" name="OldDownloaded" value="<?=$Downloaded?>" />
  1120. <input type="text" size="20" name="Downloaded" value="<?=$Downloaded?>" />
  1121. </td>
  1122. </tr>
  1123. <tr>
  1124. <td class="label"><?=BONUS_POINTS?>:</td>
  1125. <td>
  1126. <input type="text" size="20" name="BonusPoints" value="<?=$BonusPoints?>" />
  1127. <?
  1128. if (!$DisablePoints) {
  1129. $PointsRate = 0.5;
  1130. $getTorrents = $DB->query("
  1131. SELECT COUNT(DISTINCT x.fid) AS Torrents,
  1132. SUM(t.Size) AS Size,
  1133. SUM(xs.seedtime) AS Seedtime,
  1134. SUM(t.Seeders) AS Seeders
  1135. FROM users_main AS um
  1136. LEFT JOIN users_info AS i on um.ID = i.UserID
  1137. LEFT JOIN xbt_files_users AS x ON um.ID=x.uid
  1138. LEFT JOIN torrents AS t ON t.ID=x.fid
  1139. LEFT JOIN xbt_snatched AS xs ON x.uid=xs.uid AND x.fid=xs.fid
  1140. WHERE
  1141. um.ID = $UserID
  1142. AND um.Enabled = '1'
  1143. AND x.active = 1
  1144. AND x.completed = 0
  1145. AND x.Remaining = 0
  1146. GROUP BY um.ID");
  1147. if ($DB->has_results()) {
  1148. list($NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
  1149. $PointsRate += (0.67*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3));
  1150. }
  1151. $PointsRate = intval($PointsRate**0.95);
  1152. $PointsPerHour = number_format($PointsRate)." ".BONUS_POINTS."/hour";
  1153. $PointsPerDay = number_format($PointsRate*24)." ".BONUS_POINTS."/day";
  1154. } else {
  1155. $PointsPerHour = "0 ".BONUS_POINTS."/hour";
  1156. $PointsPerDay = BONUS_POINTS." disabled";
  1157. }
  1158. ?>
  1159. <?=$PointsPerHour?> (<?=$PointsPerDay?>)
  1160. </td>
  1161. </tr>
  1162. <tr>
  1163. <td class="label tooltip" title="Enter a username.">Merge stats <strong>from:</strong></td>
  1164. <td>
  1165. <input type="text" size="40" name="MergeStatsFrom" />
  1166. </td>
  1167. </tr>
  1168. <tr>
  1169. <td class="label">Freeleech tokens:</td>
  1170. <td>
  1171. <input type="text" size="5" name="FLTokens" value="<?=$FLTokens?>" />
  1172. </td>
  1173. </tr>
  1174. <?
  1175. }
  1176. if (check_perms('users_edit_invites')) {
  1177. ?>
  1178. <tr>
  1179. <td class="label tooltip" title="Number of invites">Invites:</td>
  1180. <td><input type="text" size="5" name="Invites" value="<?=$Invites?>" /></td>
  1181. </tr>
  1182. <?
  1183. }
  1184. if (check_perms('admin_manage_fls') || (check_perms('users_mod') && $OwnProfile)) {
  1185. ?>
  1186. <tr>
  1187. <td class="label tooltip" title="This is the message shown in the right-hand column on /staff.php">FLS/Staff remark:</td>
  1188. <td><input type="text" class="wide_input_text" name="SupportFor" value="<?=display_str($SupportFor)?>" /></td>
  1189. </tr>
  1190. <?
  1191. }
  1192. if (check_perms('users_edit_reset_keys')) {
  1193. ?>
  1194. <tr>
  1195. <td class="label">Reset:</td>
  1196. <td>
  1197. <input type="checkbox" name="ResetRatioWatch" id="ResetRatioWatch" /> <label for="ResetRatioWatch">Ratio watch</label> |
  1198. <input type="checkbox" name="ResetPasskey" id="ResetPasskey" /> <label for="ResetPasskey">Passkey</label> |
  1199. <input type="checkbox" name="ResetAuthkey" id="ResetAuthkey" /> <label for="ResetAuthkey">Authkey</label> |
  1200. <input type="checkbox" name="ResetIPHistory" id="ResetIPHistory" /> <label for="ResetIPHistory">IP history</label> |
  1201. <input type="checkbox" name="ResetEmailHistory" id="ResetEmailHistory" /> <label for="ResetEmailHistory">Email history</label>
  1202. <br />
  1203. <input type="checkbox" name="ResetSnatchList" id="ResetSnatchList" /> <label for="ResetSnatchList">Snatch list</label> |
  1204. <input type="checkbox" name="ResetDownloadList" id="ResetDownloadList" /> <label for="ResetDownloadList">Download list</label>
  1205. </td>
  1206. </tr>
  1207. <?
  1208. }
  1209. if (check_perms('users_edit_password')) {
  1210. ?>
  1211. <tr>
  1212. <td class="label">New password:</td>
  1213. <td>
  1214. <input type="text" size="30" id="change_password" name="ChangePassword" />
  1215. <button type="button" id="random_password">Generate</button>
  1216. </td>
  1217. </tr>
  1218. <? }
  1219. if (check_perms('users_edit_badges')) {
  1220. ?>
  1221. <tr id="user_badge_edit_tr">
  1222. <td class="label">Badges Owned:</td>
  1223. <td>
  1224. <?
  1225. $DB->query("
  1226. SELECT ID AS BadgeID, Icon, Name, Description
  1227. FROM badges");
  1228. if ($DB->has_results()) { //If the DB has no results here, something is dangerously fucked
  1229. $AllBadges = $DB->to_array();
  1230. $UserBadgeIDs = array();
  1231. foreach (Badges::get_badges($UserID) as $Badge) {
  1232. $UserBadgeIDs[] = $Badge['BadgeID'];
  1233. }
  1234. $i = 0;
  1235. foreach ($AllBadges as $Badge) {
  1236. ?><input type="checkbox" name="badges[]" class="badge_checkbox" value="<?=$Badge['BadgeID']?>" <?=(in_array($Badge['BadgeID'], $UserBadgeIDs))?" checked":""?>/><?=Badges::display_badge($Badge, true)?>
  1237. <? $i++;
  1238. if ($i % 8 == 0) {
  1239. echo "<br />";
  1240. }
  1241. }
  1242. }
  1243. ?>
  1244. </td>
  1245. </tr>
  1246. <? } ?>
  1247. </table>
  1248. <? if (check_perms('users_warn')) { ?>
  1249. <table class="layout box" id="warn_user_box">
  1250. <tr class="colhead">
  1251. <td colspan="2">
  1252. Warnings
  1253. </td>
  1254. </tr>
  1255. <tr>
  1256. <td class="label">Warned:</td>
  1257. <td>
  1258. <input type="checkbox" name="Warned"<? if ($Warned != '0000-00-00 00:00:00') { ?> checked="checked"<? } ?> />
  1259. </td>
  1260. </tr>
  1261. <? if ($Warned == '0000-00-00 00:00:00') { // user is not warned ?>
  1262. <tr>
  1263. <td class="label">Expiration:</td>
  1264. <td>
  1265. <select name="WarnLength">
  1266. <option value="">---</option>
  1267. <option value="1">1 week</option>
  1268. <option value="2">2 weeks</option>
  1269. <option value="4">4 weeks</option>
  1270. <option value="8">8 weeks</option>
  1271. </select>
  1272. </td>
  1273. </tr>
  1274. <? } else { // user is warned ?>
  1275. <tr>
  1276. <td class="label">Extension:</td>
  1277. <td>
  1278. <select name="ExtendWarning" onchange="ToggleWarningAdjust(this);">
  1279. <option>---</option>
  1280. <option value="1">1 week</option>
  1281. <option value="2">2 weeks</option>
  1282. <option value="4">4 weeks</option>
  1283. <option value="8">8 weeks</option>
  1284. </select>
  1285. </td>
  1286. </tr>
  1287. <tr id="ReduceWarningTR">
  1288. <td class="label">Reduction:</td>
  1289. <td>
  1290. <select name="ReduceWarning">
  1291. <option>---</option>
  1292. <option value="1">1 week</option>
  1293. <option value="2">2 weeks</option>
  1294. <option value="4">4 weeks</option>
  1295. <option value="8">8 weeks</option>
  1296. </select>
  1297. </td>
  1298. </tr>
  1299. <? } ?>
  1300. <tr>
  1301. <td class="label tooltip" title="This message *will* be sent to the user in the warning PM!">Warning reason:</td>
  1302. <td>
  1303. <input type="text" class="wide_input_text" name="WarnReason" />
  1304. </td>
  1305. </tr>
  1306. <? } ?>
  1307. </table>
  1308. <? if (check_perms('users_disable_any')) { ?>
  1309. <table class="layout box">
  1310. <tr class="colhead">
  1311. <td colspan="2">
  1312. Lock Account
  1313. </td>
  1314. </tr>
  1315. <tr>
  1316. <td class="label">Lock Account:</td>
  1317. <td>
  1318. <input type="checkbox" name="LockAccount" id="LockAccount" <? if($LockedAccount) { ?> checked="checked" <? } ?>/>
  1319. </td>
  1320. </tr>
  1321. <tr>
  1322. <td class="label">Reason:</td>
  1323. <td>
  1324. <select name="LockReason">
  1325. <option value="---">---</option>
  1326. <option value="<?=STAFF_LOCKED?>" <? if ($LockedAccount == STAFF_LOCKED) { ?> selected <? } ?>>Staff Lock</option>
  1327. </select>
  1328. </td>
  1329. </tr>
  1330. </table>
  1331. <? } ?>
  1332. <table class="layout box" id="user_privs_box">
  1333. <tr class="colhead">
  1334. <td colspan="2">
  1335. User Privileges
  1336. </td>
  1337. </tr>
  1338. <? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
  1339. $DB->query("
  1340. SELECT DISTINCT Email, IP
  1341. FROM users_history_emails
  1342. WHERE UserID = $UserID
  1343. ORDER BY Time ASC");
  1344. $Emails = $DB->to_array();
  1345. ?>
  1346. <tr>
  1347. <td class="label">Disable:</td>
  1348. <td>
  1349. <input type="checkbox" name="DisablePosting" id="DisablePosting"<? if ($DisablePosting == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
  1350. <? if (check_perms('users_disable_any')) { ?> |
  1351. <input type="checkbox" name="DisableAvatar" id="DisableAvatar"<? if ($DisableAvatar == 1) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
  1352. <input type="checkbox" name="DisableForums" id="DisableForums"<? if ($DisableForums == 1) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
  1353. <input type="checkbox" name="DisableIRC" id="DisableIRC"<? if ($DisableIRC == 1) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label> |
  1354. <input type="checkbox" name="DisablePM" id="DisablePM"<? if ($DisablePM == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
  1355. <br /><br />
  1356. <input type="checkbox" name="DisableLeech" id="DisableLeech"<? if ($DisableLeech == 0) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
  1357. <input type="checkbox" name="DisableRequests" id="DisableRequests"<? if ($DisableRequests == 1) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label> |
  1358. <input type="checkbox" name="DisableUpload" id="DisableUpload"<? if ($DisableUpload == 1) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Torrent upload</label> |
  1359. <input type="checkbox" name="DisablePoints" id="DisablePoints"<? if ($DisablePoints == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePoints"><?=BONUS_POINTS?></label>
  1360. <br /><br />
  1361. <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> |
  1362. <input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
  1363. <input type="checkbox" name="DisablePromotion" id="DisablePromotion"<? if ($DisablePromotion == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePromotion">Promotions</label> |
  1364. <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
  1365. </td>
  1366. </tr>
  1367. <tr>
  1368. <td class="label">Hacked:</td>
  1369. <td>
  1370. <input type="checkbox" name="SendHackedMail" id="SendHackedMail" /> <label for="SendHackedMail">Send hacked account email</label> to
  1371. <select name="HackedEmail">
  1372. <?
  1373. foreach ($Emails as $Email) {
  1374. list($Address, $IP) = $Email;
  1375. $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
  1376. $Address = apc_exists('DBKEY') ? DBCrypt::decrypt($Address) : '[Encrypted]';
  1377. ?>
  1378. <option value="<?=display_str($Address)?>"><?=display_str($Address)?> - <?=display_str($IP)?></option>
  1379. <? } ?>
  1380. </select>
  1381. </td>
  1382. </tr>
  1383. <?
  1384. }
  1385. }
  1386. if (check_perms('users_disable_any')) {
  1387. ?>
  1388. <tr>
  1389. <td class="label">Account:</td>
  1390. <td>
  1391. <select name="UserStatus">
  1392. <option value="0"<? if ($Enabled == '0') { ?> selected="selected"<? } ?>>Unconfirmed</option>
  1393. <option value="1"<? if ($Enabled == '1') { ?> selected="selected"<? } ?>>Enabled</option>
  1394. <option value="2"<? if ($Enabled == '2') { ?> selected="selected"<? } ?>>Disabled</option>
  1395. <? if (check_perms('users_delete_users')) { ?>
  1396. <optgroup label="-- WARNING --">
  1397. <option value="delete">Delete account</option>
  1398. </optgroup>
  1399. <? } ?>
  1400. </select>
  1401. </td>
  1402. </tr>
  1403. <tr>
  1404. <td class="label">User reason:</td>
  1405. <td>
  1406. <input type="text" class="wide_input_text" name="UserReason" />
  1407. </td>
  1408. </tr>
  1409. <tr>
  1410. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Restricted forums:</td>
  1411. <td>
  1412. <input type="text" class="wide_input_text" name="RestrictedForums" value="<?=display_str($RestrictedForums)?>" />
  1413. </td>
  1414. </tr>
  1415. <tr>
  1416. <td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Extra forums:</td>
  1417. <td>
  1418. <input type="text" class="wide_input_text" name="PermittedForums" value="<?=display_str($PermittedForums)?>" />
  1419. </td>
  1420. </tr>
  1421. <? } ?>
  1422. </table>
  1423. <? if (check_perms('users_logout')) { ?>
  1424. <table class="layout box" id="session_box">
  1425. <tr class="colhead">
  1426. <td colspan="2">
  1427. Session
  1428. </td>
  1429. </tr>
  1430. <tr>
  1431. <td class="label">Reset session:</td>
  1432. <td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
  1433. </tr>
  1434. <tr>
  1435. <td class="label">Log out:</td>
  1436. <td><input type="checkbox" name="LogOut" id="LogOut" /></td>
  1437. </tr>
  1438. </table>
  1439. <?
  1440. }
  1441. if (check_perms('users_mod')) {
  1442. DonationsView::render_mod_donations($UserID);
  1443. }
  1444. ?>
  1445. <table class="layout box" id="submit_box">
  1446. <tr class="colhead">
  1447. <td colspan="2">
  1448. Submit
  1449. </td>
  1450. </tr>
  1451. <tr>
  1452. <td class="label tooltip" title="This message will be entered into staff notes only.">Reason:</td>
  1453. <td>
  1454. <textarea rows="1" cols="35" class="wide_input_text" name="Reason" id="Reason" onkeyup="resize('Reason');"></textarea>
  1455. </td>
  1456. </tr>
  1457. <tr>
  1458. <td class="label">Paste user stats:</td>
  1459. <td>
  1460. <button type="button" id="paster">Paste</button>
  1461. </td>
  1462. </tr>
  1463. <tr>
  1464. <td align="right" colspan="2">
  1465. <input type="submit" value="Save changes" />
  1466. </td>
  1467. </tr>
  1468. </table>
  1469. </form>
  1470. <?
  1471. }
  1472. ?>
  1473. </div>
  1474. </div>
  1475. <script>
  1476. $('.tooltip').tooltipster();
  1477. </script>
  1478. <? View::show_footer(); ?>