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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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, $GroupNameJP, $GroupYear,
  33. $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID,
  34. $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
  35. $TagPositiveVotes, $TagNegativeVotes, $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"><img src="static/styles/<?=($LoggedUser['StyleName'])?>/images/snatched.png" class="tooltip" alt="Snatches" title="Snatches" /></td>
  74. <td class="sign seeders">
  75. <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>
  76. </td>
  77. <td class="sign leechers">
  78. <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>
  79. </td>
  80. </tr>
  81. <?
  82. build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $TorrentList, $Types, $Username);
  83. ?>
  84. </table>
  85. </div>
  86. <form class="create_form" name="report" action="reportsv2.php?action=takereport" enctype="multipart/form-data" method="post" id="reportform">
  87. <div>
  88. <input type="hidden" name="submit" value="true" />
  89. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  90. <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
  91. <input type="hidden" name="categoryid" value="<?=$CategoryID?>" />
  92. </div>
  93. <h3>Report Information</h3>
  94. <div class="box pad">
  95. <table class="layout">
  96. <tr>
  97. <td class="label">Reason:</td>
  98. <td>
  99. <select id="type" name="type" onchange="ChangeReportType();">
  100. <?
  101. if (!empty($Types[$CategoryID])) {
  102. $TypeList = $Types['master'] + $Types[$CategoryID];
  103. $Priorities = array();
  104. foreach ($TypeList as $Key => $Value) {
  105. $Priorities[$Key] = $Value['priority'];
  106. }
  107. array_multisort($Priorities, SORT_ASC, $TypeList);
  108. } else {
  109. $TypeList = $Types['master'];
  110. }
  111. foreach ($TypeList as $Type => $Data) {
  112. ?>
  113. <option value="<?=($Type)?>"><?=($Data['title'])?></option>
  114. <? } ?>
  115. </select>
  116. </td>
  117. </tr>
  118. </table>
  119. <p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
  120. <br />
  121. <p><strong>Following the below report type specific guidelines will help the moderators deal with your report in a timely fashion. </strong></p>
  122. <br />
  123. <div id="dynamic_form">
  124. <?
  125. /*
  126. * THIS IS WHERE SEXY AJAX COMES IN
  127. * The following malarky is needed so that if you get sent back here, the fields are filled in.
  128. */
  129. ?>
  130. <input id="sitelink" type="hidden" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
  131. <input id="image" type="hidden" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
  132. <input id="track" type="hidden" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" />
  133. <input id="link" type="hidden" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
  134. <input id="extra" type="hidden" name="extra" value="<?=(!empty($_POST['extra']) ? display_str($_POST['extra']) : '')?>" />
  135. <script type="text/javascript">ChangeReportType();</script>
  136. </div>
  137. </div>
  138. <input type="submit" value="Submit report" />
  139. </form>
  140. </div>
  141. <?
  142. View::show_footer();
  143. ?>