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.

static.php 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This page is used for viewing reports in every viewpoint except auto.
  5. * It doesn't AJAX grab a new report when you resolve each one, use auto
  6. * for that (reports.php). If you wanted to add a new view, you'd simply
  7. * add to the case statement(s) below and add an entry to views.php to
  8. * explain it.
  9. * Any changes made to this page within the foreach loop should probably be
  10. * replicated on the auto page (reports.php).
  11. */
  12. if (!check_perms('admin_reports')) {
  13. error(403);
  14. }
  15. require_once SERVER_ROOT.'/classes/reports.class.php';
  16. define('REPORTS_PER_PAGE', '10');
  17. list($Page, $Limit) = Format::page_limit(REPORTS_PER_PAGE);
  18. if (isset($_GET['view'])) {
  19. $View = $_GET['view'];
  20. } else {
  21. error(404);
  22. }
  23. if (isset($_GET['id'])) {
  24. if (!is_number($_GET['id']) && $View !== 'type') {
  25. error(404);
  26. } else {
  27. $ID = db_string($_GET['id']);
  28. }
  29. } else {
  30. $ID = '';
  31. }
  32. /**
  33. * Large query builder
  34. */
  35. $Order = 'ORDER BY r.`ReportedTime` ASC';
  36. if (!$ID) {
  37. switch ($View) {
  38. case 'resolved':
  39. $Title = 'All the old smelly reports';
  40. $Where = "WHERE r.`Status` = 'Resolved'";
  41. $Order = 'ORDER BY r.`LastChangeTime` DESC';
  42. break;
  43. case 'unauto':
  44. $Title = 'New reports, not auto assigned!';
  45. $Where = "WHERE r.`Status` = 'New'";
  46. break;
  47. default:
  48. error(404);
  49. break;
  50. }
  51. } else {
  52. switch ($View) {
  53. case 'staff':
  54. $DB->prepared_query("
  55. SELECT `Username`
  56. FROM `users_main`
  57. WHERE `ID` = $ID");
  58. list($Username) = $DB->next_record();
  59. if ($Username) {
  60. $Title = "$Username's in-progress reports";
  61. } else {
  62. $Title = "$ID's in-progress reports";
  63. }
  64. $Where = "
  65. WHERE r.`Status` = 'InProgress'
  66. AND r.`ResolverID` = $ID";
  67. break;
  68. case 'resolver':
  69. $DB->prepared_query("
  70. SELECT `Username`
  71. FROM `users_main`
  72. WHERE `ID` = $ID");
  73. list($Username) = $DB->next_record();
  74. if ($Username) {
  75. $Title = "$Username's resolved reports";
  76. } else {
  77. $Title = "$ID's resolved reports";
  78. }
  79. $Where = "
  80. WHERE r.`Status` = 'Resolved'
  81. AND r.`ResolverID` = $ID";
  82. $Order = 'ORDER BY r.`LastChangeTime` DESC';
  83. break;
  84. case 'group':
  85. $Title = "Unresolved reports for the group $ID";
  86. $Where = "
  87. WHERE r.`Status` != 'Resolved'
  88. AND tg.`id` = $ID";
  89. break;
  90. case 'torrent':
  91. $Title = "All reports for the torrent $ID";
  92. $Where = "WHERE r.`TorrentID` = $ID";
  93. break;
  94. case 'report':
  95. $Title = "Viewing resolution of report $ID";
  96. $Where = "WHERE r.`ID` = $ID";
  97. break;
  98. case 'reporter':
  99. $DB->prepared_query("
  100. SELECT `Username`
  101. FROM `users_main`
  102. WHERE `ID` = $ID");
  103. list($Username) = $DB->next_record();
  104. if ($Username) {
  105. $Title = "All torrents reported by $Username";
  106. } else {
  107. $Title = "All torrents reported by user $ID";
  108. }
  109. $Where = "WHERE r.`ReporterID` = $ID";
  110. $Order = 'ORDER BY r.`ReportedTime` DESC';
  111. break;
  112. case 'uploader':
  113. $DB->prepared_query("
  114. SELECT `Username`
  115. FROM `users_main`
  116. WHERE `ID` = $ID");
  117. list($Username) = $DB->next_record();
  118. if ($Username) {
  119. $Title = "All reports for torrents uploaded by $Username";
  120. } else {
  121. $Title = "All reports for torrents uploaded by user $ID";
  122. }
  123. $Where = "
  124. WHERE r.`Status` != 'Resolved'
  125. AND t.`UserID` = $ID";
  126. break;
  127. case 'type':
  128. $Title = 'All new reports for the chosen type';
  129. $Where = "
  130. WHERE r.`Status` = 'New'
  131. AND r.`Type` = '$ID'";
  132. break;
  133. default:
  134. error(404);
  135. break;
  136. }
  137. }
  138. /**
  139. * The large query
  140. */
  141. $DB->prepared_query("
  142. SELECT
  143. SQL_CALC_FOUND_ROWS
  144. r.`ID`,
  145. r.`ReporterID`,
  146. reporter.`Username`,
  147. r.`TorrentID`,
  148. r.`Type`,
  149. r.`UserComment`,
  150. r.`ResolverID`,
  151. resolver.`Username`,
  152. r.`Status`,
  153. r.`ReportedTime`,
  154. r.`LastChangeTime`,
  155. r.`ModComment`,
  156. r.`Track`,
  157. r.`Image`,
  158. r.`ExtraID`,
  159. r.`Link`,
  160. r.`LogMessage`,
  161. COALESCE(NULLIF(tg.`title`, ''), NULLIF(tg.`subject`, ''), tg.`object`) AS Name,
  162. tg.`id`,
  163. CASE COUNT(ta.`GroupID`)
  164. WHEN 1 THEN ag.`ArtistID`
  165. ELSE '0'
  166. END AS `ArtistID`,
  167. CASE COUNT(ta.`GroupID`)
  168. WHEN 1 THEN ag.`Name`
  169. WHEN 0 THEN ''
  170. ELSE 'Various Artists'
  171. END AS ArtistName,
  172. tg.`year`,
  173. tg.`category_id`,
  174. t.`Time`,
  175. t.`Media`,
  176. t.`Size`,
  177. t.`UserID` AS UploaderID,
  178. uploader.`Username`
  179. FROM `reportsv2` AS r
  180. LEFT JOIN `torrents` AS t ON t.`ID` = r.`TorrentID`
  181. LEFT JOIN `torrents_group` AS tg ON tg.`id` = t.`GroupID`
  182. LEFT JOIN `torrents_artists` AS ta ON ta.`GroupID` = tg.`id`
  183. LEFT JOIN `artists_group` AS ag ON ag.`ArtistID` = ta.`ArtistID`
  184. LEFT JOIN `users_main` AS resolver ON resolver.`ID` = r.`ResolverID`
  185. LEFT JOIN `users_main` AS reporter ON reporter.`ID` = r.`ReporterID`
  186. LEFT JOIN `users_main` AS uploader ON uploader.`ID` = t.`UserID`
  187. $Where
  188. GROUP BY r.`ID`
  189. $Order
  190. LIMIT $Limit");
  191. $Reports = $DB->to_array();
  192. $DB->prepared_query('SELECT FOUND_ROWS()');
  193. list($Results) = $DB->next_record();
  194. $PageLinks = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
  195. View::show_header('Reports V2!', 'reportsv2');
  196. ?>
  197. <div class="header">
  198. <h2><?=$Title?></h2>
  199. <?php include('header.php'); ?>
  200. </div>
  201. <div class="buttonbox pad center">
  202. <?php if ($View !== 'resolved') { ?>
  203. <span class="tooltip" title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span>
  204. <span class="tooltip" title="Assigns all of the reports on the page to you!"><input type="button" onclick="Grab();" value="Claim all" /></span>
  205. <?php }
  206. if ($View === 'staff' && $LoggedUser['ID'] == $ID) { ?>
  207. | <span class="tooltip" title="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span>
  208. <?php } ?>
  209. </div>
  210. <?php if ($PageLinks) { ?>
  211. <div class="linkbox">
  212. <?=$PageLinks?>
  213. </div>
  214. <?php } ?>
  215. <div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;">
  216. <?php
  217. if (count($Reports) === 0) {
  218. ?>
  219. <div class="box pad center">
  220. <strong>No new reports</strong>
  221. </div>
  222. <?php
  223. } else {
  224. foreach ($Reports as $Report) {
  225. list($ReportID, $ReporterID, $ReporterName, $TorrentID, $Type, $UserComment,
  226. $ResolverID, $ResolverName, $Status, $ReportedTime, $LastChangeTime, $ModComment,
  227. $Tracks, $Images, $ExtraIDs, $Links, $LogMessage, $GroupName, $GroupID, $ArtistID,
  228. $ArtistName, $Year, $CategoryID, $Time, $Media, $Size, $UploaderID,
  229. $UploaderName) = Misc::display_array($Report, array('ModComment'));
  230. if (!$GroupID && $Status != 'Resolved') {
  231. //Torrent already deleted
  232. $DB->prepared_query("
  233. UPDATE `reportsv2`
  234. SET
  235. `Status` = 'Resolved',
  236. `LastChangeTime` = NOW(),
  237. `ModComment` = 'Report already dealt with (torrent deleted)'
  238. WHERE `ID` = $ReportID");
  239. $Cache->decrement('num_torrent_reportsv2'); ?>
  240. <div id="report<?=$ReportID?>" class="report box pad center" data-load-report="<?=$ReportID?>">
  241. <a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Hide" onclick="ClearReport(<?=$ReportID?>);" />
  242. </div>
  243. <?php
  244. } else {
  245. if (!$CategoryID && false) {
  246. //Torrent was deleted
  247. } else {
  248. // if (array_key_exists($Type, $Types[$CategoryID])) {
  249. // $ReportType = $Types[$CategoryID][$Type];
  250. /* } else*/if (array_key_exists($Type, $Types['master'])) {
  251. $ReportType = $Types['master'][$Type];
  252. } else {
  253. //There was a type but it wasn't an option!
  254. $Type = 'other';
  255. $ReportType = $Types['master']['other'];
  256. }
  257. }
  258. // $RemasterDisplayString = Reports::format_reports_remaster_info($Remastered, $RemasterTitle, $RemasterYear);
  259. /*
  260. if ($ArtistID == 0 && empty($ArtistName)) {
  261. $RawName = $GroupName.($Year ? " ($Year)" : '').($Format || $Encoding || $Media ? " [$Format/$Encoding/$Media]" : '') . $RemasterDisplayString . ($HasCue ? ' (Cue)' : '').($HasLog ? " (Log: {$LogScore}%)" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  262. $LinkName = "<a href=\"torrents.php?id=$GroupID\">$GroupName".($Year ? " ($Year)" : '')."</a> <a href=\"torrents.php?torrentid=$TorrentID\">".($Format || $Encoding || $Media ? " [$Format/$Encoding/$Media]" : '') . $RemasterDisplayString . '</a> '.($HasCue ? ' (Cue)' : '').($HasLog ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID\">(Log: {$LogScore}%)</a>" : '').' ('.number_format($Size / (1024 * 1024), 2)." MB)";
  263. $BBName = "[url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  264. } elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
  265. $RawName = "Various Artists - $GroupName".($Year ? " ($Year)" : '')." [$Format/$Encoding/$Media]{$RemasterDisplayString}" . ($HasCue ? ' (Cue)' : '').($HasLog ? " (Log: {$LogScore}%)" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  266. $LinkName = "Various Artists - <a href=\"torrents.php?id=$GroupID\">$GroupName".($Year ? " ($Year)" : '')."</a> <a href=\"torrents.php?torrentid=$TorrentID\"> [$Format/$Encoding/$Media]$RemasterDisplayString</a> ".($HasCue ? ' (Cue)' : '').($HasLog ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID\">(Log: {$LogScore}%)</a>" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  267. $BBName = "Various Artists - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  268. } else {
  269. */
  270. $RawName = "$ArtistName - $GroupName".($Year ? " ($Year)" : '')." [$Media] (".number_format($Size / (1024 * 1024), 2).' MB)';
  271. $LinkName = "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a> - <a href=\"torrents.php?id=$GroupID\">$GroupName".($Year ? " ($Year)" : '')."</a> <a href=\"torrents.php?torrentid=$TorrentID\"> [$Media]</a> (".number_format($Size / (1024 * 1024), 2).' MB)';
  272. $BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Media][/url] ".' ('.number_format($Size / (1024 * 1024), 2).' MB)';
  273. // }?>
  274. <div id="report<?=$ReportID?>" data-load-report="<?=$ReportID?>">
  275. <form class="manage_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post">
  276. <?php
  277. /*
  278. * Some of these are for takeresolve, namely the ones that aren't inputs, some for the JavaScript.
  279. */
  280. ?>
  281. <div>
  282. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  283. <input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" />
  284. <input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
  285. <input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" />
  286. <input type="hidden" id="uploaderid<?=$ReportID?>" name="uploaderid" value="<?=$UploaderID?>" />
  287. <input type="hidden" id="reporterid<?=$ReportID?>" name="reporterid" value="<?=$ReporterID?>" />
  288. <input type="hidden" id="report_reason<?=$ReportID?>" name="report_reason" value="<?=$UserComment?>" />
  289. <input type="hidden" id="raw_name<?=$ReportID?>" name="raw_name" value="<?=$RawName?>" />
  290. <input type="hidden" id="type<?=$ReportID?>" name="type" value="<?=$Type?>" />
  291. <input type="hidden" id="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" />
  292. </div>
  293. <div class="box pad">
  294. <table class="layout" cellpadding="5">
  295. <tr>
  296. <td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td>
  297. <td colspan="3">
  298. <?php if (!$GroupID) { ?>
  299. <a href="log.php?search=Torrent+<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)
  300. <?php } else { ?>
  301. <?=$LinkName?>
  302. <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets tooltip">DL</a>
  303. uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?>
  304. <br />
  305. <?php if ($ReporterName == '') {
  306. $ReporterName = 'System';
  307. } ?>
  308. <div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
  309. <?php if ($Status != 'Resolved') {
  310. $DB->prepared_query("
  311. SELECT r.`ID`
  312. FROM `reportsv2` AS r
  313. LEFT JOIN `torrents` AS t ON t.`ID` = r.`TorrentID`
  314. WHERE r.`Status` != 'Resolved'
  315. AND t.`GroupID` = $GroupID");
  316. $GroupOthers = ($DB->record_count() - 1);
  317. if ($GroupOthers > 0) { ?>
  318. <div style="text-align: right;">
  319. <a href="reportsv2.php?view=group&amp;id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrent(s) in this group</a>
  320. </div>
  321. <?php }
  322. $DB->prepared_query("
  323. SELECT t.`UserID`
  324. FROM `reportsv2` AS r
  325. JOIN `torrents` AS t ON t.`ID` = r.`TorrentID`
  326. WHERE r.`Status` != 'Resolved'
  327. AND t.`UserID` = $UploaderID");
  328. $UploaderOthers = ($DB->record_count() - 1);
  329. if ($UploaderOthers > 0) { ?>
  330. <div style="text-align: right;">
  331. <a href="reportsv2.php?view=uploader&amp;id=<?=$UploaderID?>">There <?=(($UploaderOthers > 1) ? "are $UploaderOthers other reports" : "is 1 other report")?> for torrent(s) uploaded by this user</a>
  332. </div>
  333. <?php }
  334. $DB->prepared_query("
  335. SELECT DISTINCT req.`ID`,
  336. req.`FillerID`,
  337. um.`Username`,
  338. req.`TimeFilled`
  339. FROM `requests` AS req
  340. LEFT JOIN `torrents` AS t ON t.`ID` = req.`TorrentID`
  341. LEFT JOIN `reportsv2` AS rep ON rep.`TorrentID` = t.`ID`
  342. JOIN `users_main` AS um ON um.`ID` = req.`FillerID`
  343. WHERE rep.`Status` != 'Resolved'
  344. AND req.`TimeFilled` > '2010-03-04 02:31:49'
  345. AND req.`TorrentID` = $TorrentID");
  346. $Requests = ($DB->has_results());
  347. if ($Requests > 0) {
  348. while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
  349. ?>
  350. <div style="text-align: right;">
  351. <strong class="important_text"><a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a> used this torrent to fill <a href="requests.php?action=view&amp;id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong>
  352. </div>
  353. <?php
  354. }
  355. }
  356. }
  357. } ?>
  358. </td>
  359. </tr>
  360. <?php if ($Tracks) { ?>
  361. <tr>
  362. <td class="label">Relevant tracks:</td>
  363. <td colspan="3">
  364. <?=str_replace(' ', ', ', $Tracks)?>
  365. </td>
  366. </tr>
  367. <?php
  368. }
  369. if ($Links) { ?>
  370. <tr>
  371. <td class="label">Relevant links:</td>
  372. <td colspan="3">
  373. <?php
  374. $Links = explode(' ', $Links);
  375. foreach ($Links as $Link) {
  376. if ($local_url = Text::local_url($Link)) {
  377. $Link = $local_url;
  378. } ?>
  379. <a href="<?=$Link?>"><?=$Link?></a>
  380. <?php
  381. } ?>
  382. </td>
  383. </tr>
  384. <?php
  385. }
  386. if ($ExtraIDs) { ?>
  387. <tr>
  388. <td class="label">Relevant other torrents:</td>
  389. <td colspan="3">
  390. <?php
  391. $First = true;
  392. $Extras = explode(' ', $ExtraIDs);
  393. foreach ($Extras as $ExtraID) {
  394. $DB->prepared_query("
  395. SELECT
  396. COALESCE(NULLIF(tg.`title`, ''), NULLIF(tg.`subject`, ''), tg.`object`) AS Name,
  397. tg.`id`,
  398. ta.`ArtistID`,
  399. CASE COUNT(ta.`GroupID`)
  400. WHEN 1 THEN ag.`Name`
  401. WHEN 0 THEN ''
  402. ELSE 'Various Artists'
  403. END AS ArtistName,
  404. tg.`year`,
  405. t.`Time`,
  406. t.`Media`,
  407. t.`Size`,
  408. t.`UserID` AS UploaderID,
  409. uploader.`Username`
  410. FROM `torrents` AS t
  411. LEFT JOIN `torrents_group` AS tg ON tg.`id` = t.`GroupID`
  412. LEFT JOIN `torrents_artists` AS ta ON ta.`GroupID` = tg.`id`
  413. LEFT JOIN `artists_group` AS ag ON ag.`ArtistID` = ta.`ArtistID`
  414. LEFT JOIN `users_main` AS uploader ON uploader.`ID` = t.`UserID`
  415. WHERE t.`ID` = ?
  416. GROUP BY tg.`id`", $ExtraID);
  417. list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime,
  418. $ExtraMedia, $ExtraSize, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
  419. if ($ExtraGroupName) {
  420. if ($ArtistID == 0 && empty($ArtistName)) {
  421. $ExtraLinkName = "<a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]</a> ".' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
  422. } elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
  423. $ExtraLinkName = "Various Artists - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]</a> (".number_format($ExtraSize / (1024 * 1024), 2).' MB)';
  424. } else {
  425. $ExtraLinkName = "<a href=\"artist.php?id=$ExtraArtistID\">$ExtraArtistName</a> - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [//$ExtraMedia]</a> (".number_format($ExtraSize / (1024 * 1024), 2).' MB)';
  426. } ?>
  427. <?=($First ? '' : '<br />')?>
  428. <?=$ExtraLinkName?>
  429. <a href="torrents.php?action=download&amp;id=<?=$ExtraID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets tooltip">DL</a>
  430. uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
  431. <?php
  432. $First = false;
  433. }
  434. }
  435. ?>
  436. </td>
  437. </tr>
  438. <?php
  439. }
  440. if ($Images) {
  441. ?>
  442. <tr>
  443. <td class="label">Relevant images:</td>
  444. <td colspan="3">
  445. <?php
  446. $Images = explode(' ', $Images);
  447. foreach ($Images as $Image) {
  448. ?>
  449. <img style="max-width: 200px;" class="lightbox-init" src="<?=ImageTools::process($Image)?>" alt="Relevant image" />
  450. <?php
  451. } ?>
  452. </td>
  453. </tr>
  454. <?php
  455. } ?>
  456. <tr>
  457. <td class="label">User comment:</td>
  458. <td colspan="3" class="wrap_overflow"><?=Text::full_format($UserComment)?></td>
  459. </tr>
  460. <?php // END REPORTED STUFF :|: BEGIN MOD STUFF
  461. if ($Status == 'InProgress') { ?>
  462. <tr>
  463. <td class="label">In progress by:</td>
  464. <td colspan="3">
  465. <a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a>
  466. </td>
  467. </tr>
  468. <?php }
  469. if ($Status != 'Resolved') { ?>
  470. <tr>
  471. <td class="label">Report comment:</td>
  472. <td colspan="3">
  473. <input type="text" name="comment" id="comment<?=$ReportID?>" size="70" value="<?=$ModComment?>" />
  474. <input type="button" value="Update now" onclick="UpdateComment(<?=$ReportID?>);" />
  475. </td>
  476. </tr>
  477. <tr>
  478. <td class="label">
  479. <a href="javascript:Load('<?=$ReportID?>')" class="tooltip" title="Click here to reset the resolution options to their default values.">Resolve</a>:
  480. </td>
  481. <td colspan="3">
  482. <select name="resolve_type" id="resolve_type<?=$ReportID?>" onchange="ChangeResolve(<?=$ReportID?>);">
  483. <?php
  484. $TypeList = $Types['master'] /* + $Types[$CategoryID] */ ;
  485. $Priorities = [];
  486. foreach ($TypeList as $Key => $Value) {
  487. $Priorities[$Key] = $Value['priority'];
  488. }
  489. array_multisort($Priorities, SORT_ASC, $TypeList);
  490. foreach ($TypeList as $Type => $Data) { ?>
  491. <option value="<?=$Type?>"><?=$Data['title']?></option>
  492. <?php } ?>
  493. </select>
  494. <span id="options<?=$ReportID?>">
  495. <?php if (check_perms('torrents_delete')) { ?>
  496. <span class="tooltip" title="Delete torrent?">
  497. <label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
  498. <input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
  499. </span>
  500. <?php } ?>
  501. <span class="tooltip" title="Warning length in weeks">
  502. <label for="warning<?=$ReportID?>"><strong>Warning</strong></label>
  503. <select name="warning" id="warning<?=$ReportID?>">
  504. <?php for ($i = 0; $i < 9; $i++) { ?>
  505. <option value="<?=$i?>"><?=$i?></option>
  506. <?php } ?>
  507. </select>
  508. </span>
  509. <span class="tooltip" title="Remove upload privileges?">
  510. <label for="upload<?=$ReportID?>"><strong>Remove upload privileges</strong></label>
  511. <input type="checkbox" name="upload" id="upload<?=$ReportID?>" />
  512. </span>
  513. &nbsp;&nbsp;
  514. <span class="tooltip" title="Update resolve type">
  515. <input type="button" name="update_resolve" id="update_resolve<?=$ReportID?>" value="Update now" onclick="UpdateResolve(<?=$ReportID?>);" />
  516. </span>
  517. </span>
  518. </td>
  519. </tr>
  520. <tr>
  521. <td class="label tooltip" title="Uploader: Appended to the regular message unless using &quot;Send now&quot;. Reporter: Must be used with &quot;Send now&quot;.">
  522. PM
  523. <select name="pm_type" id="pm_type<?=$ReportID?>">
  524. <option value="Uploader">Uploader</option>
  525. <option value="Reporter">Reporter</option>
  526. </select>:
  527. </td>
  528. <td colspan="3">
  529. <textarea name="uploader_pm" id="uploader_pm<?=$ReportID?>" cols="50" rows="1"></textarea>
  530. <input type="button" value="Send now" onclick="SendPM(<?=$ReportID?>);" />
  531. </td>
  532. </tr>
  533. <tr>
  534. <td class="label"><strong>Extra</strong> log message:</td>
  535. <td>
  536. <input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40"<?php
  537. if ($ExtraIDs) {
  538. $Extras = explode(' ', $ExtraIDs);
  539. $Value = '';
  540. foreach ($Extras as $ExtraID) {
  541. $Value .= site_url()."torrents.php?torrentid=$ExtraID ";
  542. }
  543. echo ' value="'.trim($Value).'"';
  544. } ?>
  545. />
  546. </td>
  547. <td class="label"><strong>Extra</strong> staff notes:</td>
  548. <td>
  549. <input type="text" name="admin_message" id="admin_message<?=$ReportID?>" size="40" />
  550. </td>
  551. </tr>
  552. <tr>
  553. <td colspan="4" style="text-align: center;">
  554. <input type="button" value="Invalidate report" onclick="Dismiss(<?=$ReportID?>);" />
  555. <input type="button" value="Resolve report manually" onclick="ManualResolve(<?=$ReportID?>);" />
  556. <?php if ($Status == 'InProgress' && $LoggedUser['ID'] == $ResolverID) { ?>
  557. | <input type="button" value="Unclaim" onclick="GiveBack(<?=$ReportID?>);" />
  558. <?php } else { ?>
  559. | <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
  560. <?php } ?>
  561. | Multi-resolve <input type="checkbox" name="multi" id="multi<?=$ReportID?>" checked="checked" />
  562. | <input type="button" id="submit_<?=$ReportID?>" value="Submit" onclick="TakeResolve(<?=$ReportID?>);" />
  563. </td>
  564. </tr>
  565. <?php } else { ?>
  566. <tr>
  567. <td class="label">Resolver:</td>
  568. <td colspan="3">
  569. <a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a>
  570. </td>
  571. </tr>
  572. <tr>
  573. <td class="label">Resolve time:</td>
  574. <td colspan="3">
  575. <?=time_diff($LastChangeTime); echo "\n"; ?>
  576. </td>
  577. </tr>
  578. <tr>
  579. <td class="label">Report comments:</td>
  580. <td colspan="3">
  581. <?=$ModComment; echo "\n"; ?>
  582. </td>
  583. </tr>
  584. <tr>
  585. <td class="label">Log message:</td>
  586. <td colspan="3">
  587. <?=$LogMessage; echo "\n"; ?>
  588. </td>
  589. </tr>
  590. <?php if ($GroupID) { ?>
  591. <tr>
  592. <td colspan="4" style="text-align: center;">
  593. <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
  594. </td>
  595. </tr>
  596. <?php }
  597. } ?>
  598. </table>
  599. </div>
  600. </form>
  601. </div>
  602. <?php
  603. }
  604. }
  605. }
  606. ?>
  607. </div>
  608. <?php if ($PageLinks) { ?>
  609. <div class="linkbox pager"><?=$PageLinks?></div>
  610. <?php } ?>
  611. <?php View::show_footer(); ?>