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.

report.php 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. /*
  3. * This is the frontend of reporting a torrent, it's what users see when
  4. * they visit reportsv2.php?id=xxx
  5. */
  6. include(SERVER_ROOT.'/sections/torrents/functions.php');
  7. // If we're not coming from torrents.php, check we're being returned because of an error.
  8. if (!isset($_GET['id']) || !is_number($_GET['id'])) {
  9. if (!isset($Err)) {
  10. error(404);
  11. }
  12. } else {
  13. $TorrentID = $_GET['id'];
  14. $DB->query("
  15. SELECT tg.CategoryID, t.GroupID, u.Username
  16. FROM torrents_group AS tg
  17. LEFT JOIN torrents AS t ON t.GroupID = tg.ID
  18. LEFT JOIN users_main AS u ON t.UserID = u.ID
  19. WHERE t.ID = " . $_GET['id']);
  20. list($CategoryID, $GroupID, $Username) = $DB->next_record();
  21. $Artists = Artists::get_artist($GroupID);
  22. $TorrentCache = get_group_info($GroupID, true);
  23. $GroupDetails = $TorrentCache[0];
  24. $TorrentList = $TorrentCache[1];
  25. // Resolve the torrentlist to the one specific torrent being reported
  26. foreach ($TorrentList as &$Torrent) {
  27. // Remove unneeded entries
  28. if ($Torrent['ID'] != $TorrentID) {
  29. unset($TorrentList[$Torrent['ID']]);
  30. }
  31. }
  32. // Group details
  33. list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupTitle2, $GroupNameJP,
  34. $GroupYear, $GroupStudio, $GroupSeries, $GroupCatalogueNumber,
  35. $GroupCategoryID, $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs,
  36. $TorrentTagUserIDs, $Screenshots, $GroupFlags) = array_values($GroupDetails);
  37. $DisplayName = $GroupName;
  38. $AltName = $GroupName; // Goes in the alt text of the image
  39. $Title = $GroupName; // Goes in <title>
  40. $WikiBody = Text::full_format($WikiBody);
  41. // Get the artist name, group name etc.
  42. $Artists = Artists::get_artist($GroupID);
  43. if ($Artists) {
  44. $DisplayName = '<span dir="ltr">' . Artists::display_artists($Artists, true) . "<a href=\"torrents.php?torrentid=$TorrentID\">$DisplayName</a></span>";
  45. $AltName = display_str(Artists::display_artists($Artists, false)) . $AltName;
  46. $Title = $AltName;
  47. }
  48. if ($GroupYear > 0) {
  49. $DisplayName .= " [$GroupYear]";
  50. $AltName .= " [$GroupYear]";
  51. $Title .= " [$GroupYear]";
  52. }
  53. /*
  54. if ($GroupCategoryID === 1) {
  55. $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
  56. $AltName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
  57. }
  58. */
  59. }
  60. View::show_header('Report', 'reportsv2,browse,torrent,bbcode,recommend');
  61. ?>
  62. <div>
  63. <div class="header">
  64. <h2>Report a torrent</h2>
  65. </div>
  66. <div class="header">
  67. <h3><?=$DisplayName?></h3>
  68. </div>
  69. <div class="box">
  70. <table class="torrent_table details<?=((isset($GroupFlags['IsSnatched']) && $GroupFlags['IsSnatched']) ? ' snatched' : '')?>" id="torrent_details">
  71. <tr class="colhead_dark">
  72. <td width="80%"><strong>Reported torrent</strong></td>
  73. <td><strong>Size</strong></td>
  74. <td class="sign snatches">
  75. </td>
  76. <td class="sign seeders">
  77. &uarr;
  78. </td>
  79. <td class="sign leechers">
  80. &darr;
  81. </td>
  82. </tr>
  83. <?php
  84. $LangName = $GroupName ? $GroupName : ($GroupTitle2 ? $GroupTitle2 : $GroupNameJP);
  85. build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $LangName, $GroupCategoryID, $TorrentList, $Types, $Username);
  86. ?>
  87. </table>
  88. </div>
  89. <form class="create_form" name="report" action="reportsv2.php?action=takereport" enctype="multipart/form-data" method="post" id="reportform">
  90. <div>
  91. <input type="hidden" name="submit" value="true" />
  92. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  93. <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
  94. <input type="hidden" name="categoryid" value="<?=$CategoryID?>" />
  95. </div>
  96. <h3>Report Information</h3>
  97. <div class="box pad">
  98. <table class="layout">
  99. <tr>
  100. <td class="label">Reason</td>
  101. <td>
  102. <select id="type" name="type" class="change_report_type">
  103. <?php
  104. if (!empty($Types[$CategoryID])) {
  105. $TypeList = $Types['master'] + $Types[$CategoryID];
  106. $Priorities = [];
  107. foreach ($TypeList as $Key => $Value) {
  108. $Priorities[$Key] = $Value['priority'];
  109. }
  110. array_multisort($Priorities, SORT_ASC, $TypeList);
  111. } else {
  112. $TypeList = $Types['master'];
  113. }
  114. foreach ($TypeList as $Type => $Data) {
  115. ?>
  116. <option value="<?=($Type)?>"><?=($Data['title'])?></option>
  117. <?php
  118. } ?>
  119. </select>
  120. </td>
  121. </tr>
  122. </table>
  123. <p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
  124. <p><strong>Following the below report type specific guidelines will help the moderators deal with your report in a timely fashion.</strong></p>
  125. <div id="dynamic_form">
  126. <?php
  127. /*
  128. * THIS IS WHERE SEXY AJAX COMES IN
  129. * The following malarky is needed so that if you get sent back here, the fields are filled in.
  130. */
  131. ?>
  132. <input id="sitelink" type="hidden" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
  133. <input id="image" type="hidden" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
  134. <input id="track" type="hidden" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" />
  135. <input id="link" type="hidden" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
  136. <input id="extra" type="hidden" name="extra" value="<?=(!empty($_POST['extra']) ? display_str($_POST['extra']) : '')?>" />
  137. </div>
  138. </div>
  139. <input type="submit" value="Report" />
  140. </form>
  141. </div>
  142. <?php
  143. View::show_footer();