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

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