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

report.php 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?
  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. // Group details
  32. list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP,
  33. $GroupYear, $GroupStudio, $GroupSeries, $GroupCatalogueNumber,
  34. $GroupCategoryID, $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs,
  35. $TorrentTagUserIDs, $Screenshots, $GroupFlags) = array_values($GroupDetails);
  36. $DisplayName = $GroupName;
  37. $AltName = $GroupName; // Goes in the alt text of the image
  38. $Title = $GroupName; // goes in <title>
  39. $WikiBody = Text::full_format($WikiBody);
  40. //Get the artist name, group name etc.
  41. $Artists = Artists::get_artist($GroupID);
  42. if ($Artists) {
  43. $DisplayName = '<span dir="ltr">' . Artists::display_artists($Artists, true) . "<a href=\"torrents.php?torrentid=$TorrentID\">$DisplayName</a></span>";
  44. $AltName = display_str(Artists::display_artists($Artists, false)) . $AltName;
  45. $Title = $AltName;
  46. }
  47. if ($GroupYear > 0) {
  48. $DisplayName .= " [$GroupYear]";
  49. $AltName .= " [$GroupYear]";
  50. $Title .= " [$GroupYear]";
  51. }
  52. /*
  53. if ($GroupCategoryID == 1) {
  54. $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
  55. $AltName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
  56. }
  57. */
  58. }
  59. View::show_header('Report', 'reportsv2,browse,torrent,bbcode,recommend');
  60. ?>
  61. <div class="thin">
  62. <div class="header">
  63. <h2>Report a torrent</h2>
  64. </div>
  65. <div class="header">
  66. <h3><?=$DisplayName?></h3>
  67. </div>
  68. <div class="thin box">
  69. <table class="torrent_table details<?=((isset($GroupFlags['IsSnatched']) && $GroupFlags['IsSnatched']) ? ' snatched' : '')?>" id="torrent_details">
  70. <tr class="colhead_dark">
  71. <td width="80%"><strong>Reported torrent</strong></td>
  72. <td><strong>Size</strong></td>
  73. <td class="sign snatches">
  74. <a><svg width="15" height="15" fill="white" class="tooltip" alt="Snatches" title="Snatches" viewBox="3 0 88 98"><path d="M20 20 A43 43,0,1,0,77 23 L90 10 L55 10 L55 45 L68 32 A30.27 30.27,0,1,1,28 29"></path></svg></a>
  75. </td>
  76. <td class="sign seeders">
  77. <a><svg width="11" height="15" fill="white" class="tooltip" alt="Seeders" title="Seeders"><polygon points="0,7 5.5,0 11,7 8,7 8,15 3,15 3,7"></polygon></svg></a>
  78. </td>
  79. <td class="sign leechers">
  80. <a><svg width="11" height="15" fill="white" class="tooltip" alt="Leechers" title="Leechers"><polygon points="0,8 5.5,15 11,8 8,8 8,0 3,0 3,8"></polygon></svg></a>
  81. </td>
  82. </tr>
  83. <?
  84. $LangName = $GroupName ? $GroupName : ($GroupNameRJ ? $GroupNameRJ : $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. <?
  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. <? } ?>
  118. </select>
  119. </td>
  120. </tr>
  121. </table>
  122. <p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
  123. <br />
  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. <br />
  126. <div id="dynamic_form">
  127. <?
  128. /*
  129. * THIS IS WHERE SEXY AJAX COMES IN
  130. * The following malarky is needed so that if you get sent back here, the fields are filled in.
  131. */
  132. ?>
  133. <input id="sitelink" type="hidden" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
  134. <input id="image" type="hidden" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
  135. <input id="track" type="hidden" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" />
  136. <input id="link" type="hidden" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
  137. <input id="extra" type="hidden" name="extra" value="<?=(!empty($_POST['extra']) ? display_str($_POST['extra']) : '')?>" />
  138. </div>
  139. </div>
  140. <input type="submit" value="Submit report" />
  141. </form>
  142. </div>
  143. <?
  144. View::show_footer();
  145. ?>