BioTorrents.de’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 55KB

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