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.

edit.php 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?
  2. //**********************************************************************//
  3. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
  4. // This page relies on the TorrentForm class. All it does is call //
  5. // the necessary functions. //
  6. //----------------------------------------------------------------------//
  7. // At the bottom, there are grouping functions which are off limits to //
  8. // most members. //
  9. //**********************************************************************//
  10. require_once(SERVER_ROOT.'/classes/torrent_form.class.php');
  11. if (!is_number($_GET['id']) || !$_GET['id']) {
  12. error(0);
  13. }
  14. $TorrentID = $_GET['id'];
  15. $DB->query("
  16. SELECT
  17. t.Media,
  18. t.Container,
  19. t.Codec,
  20. t.Resolution,
  21. t.AudioFormat,
  22. t.Subbing,
  23. t.Language,
  24. t.Subber,
  25. t.Censored,
  26. t.Anonymous,
  27. t.Archive,
  28. t.FreeTorrent,
  29. t.FreeLeechType,
  30. t.Description AS TorrentDescription,
  31. t.MediaInfo,
  32. tg.CategoryID,
  33. tg.Name AS Title,
  34. tg.NameJP AS TitleJP,
  35. tg.Year,
  36. tg.Studio,
  37. tg.Series,
  38. tg.CatalogueNumber,
  39. ag.Name AS ArtistName,
  40. t.GroupID,
  41. t.UserID,
  42. bt.TorrentID AS BadTags,
  43. bf.TorrentID AS BadFolders,
  44. bfi.TorrentID AS BadFiles
  45. FROM torrents AS t
  46. LEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID
  47. LEFT JOIN torrents_artists AS ta ON tg.ID = ta.GroupID
  48. LEFT JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID
  49. LEFT JOIN torrents_bad_tags AS bt ON bt.TorrentID = t.ID
  50. LEFT JOIN torrents_bad_folders AS bf ON bf.TorrentID = t.ID
  51. LEFT JOIN torrents_bad_files AS bfi ON bfi.TorrentID = t.ID
  52. WHERE t.ID = '$TorrentID'");
  53. list($Properties) = $DB->to_array(false, MYSQLI_BOTH);
  54. if (!$Properties) {
  55. error(404);
  56. }
  57. $UploadForm = $Categories[$Properties['CategoryID'] - 1];
  58. if (($LoggedUser['ID'] != $Properties['UserID'] && !check_perms('torrents_edit')) || $LoggedUser['DisableWiki']) {
  59. error(403);
  60. }
  61. View::show_header('Edit torrent', 'upload,torrent,bbcode');
  62. $TorrentForm = new TorrentForm($Properties, $Err, false);
  63. $TorrentForm->upload_form();
  64. if (check_perms('torrents_edit') || check_perms('users_mod')) {
  65. ?>
  66. <div class="thin">
  67. <?
  68. if ($Properties['CategoryID'] != 5) {
  69. ?>
  70. <div class="header">
  71. <h2>Change group</h2>
  72. </div>
  73. <div class="box pad">
  74. <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
  75. <input type="hidden" name="action" value="editgroupid" />
  76. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  77. <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
  78. <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
  79. <table class="layout">
  80. <tr>
  81. <td class="label">Group ID</td>
  82. <td>
  83. <input type="text" name="groupid" value="<?=$Properties['GroupID']?>" size="10" />
  84. </td>
  85. </tr>
  86. <tr>
  87. <td colspan="2" class="center">
  88. <input type="submit" value="Change group ID" />
  89. </td>
  90. </tr>
  91. </table>
  92. </form>
  93. </div>
  94. <h2>Split off into new group</h2>
  95. <div class="box pad">
  96. <form class="split_form" name="torrent_group" action="torrents.php" method="post">
  97. <input type="hidden" name="action" value="newgroup" />
  98. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  99. <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
  100. <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
  101. <table class="layout">
  102. <tr>
  103. <td class="label">Artist</td>
  104. <td>
  105. <input type="text" name="artist" value="<?=$Properties['ArtistName']?>" size="50" />
  106. </td>
  107. </tr>
  108. <tr>
  109. <td class="label">Title</td>
  110. <td>
  111. <input type="text" name="title" value="<?=$Properties['Title']?>" size="50" />
  112. </td>
  113. </tr>
  114. <tr>
  115. <td class="label">Japanese Title</td>
  116. <td>
  117. <input type="test" name="title_jp" value="<?=$Properties['TitleJP']?>" size=50" />
  118. </td>
  119. <tr>
  120. <td class="label">Year</td>
  121. <td>
  122. <input type="text" name="year" value="<?=$Properties['Year']?>" size="10" />
  123. </td>
  124. </tr>
  125. <tr>
  126. <td colspan="2" class="center">
  127. <input type="submit" value="Split into new group" />
  128. </td>
  129. </tr>
  130. </table>
  131. </form>
  132. </div>
  133. <br />
  134. <?
  135. }
  136. if (check_perms('users_mod')) { ?>
  137. <h2>Change category</h2>
  138. <div class="box pad">
  139. <form action="torrents.php" method="post">
  140. <input type="hidden" name="action" value="changecategory" />
  141. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  142. <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
  143. <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
  144. <input type="hidden" name="oldartistid" value="<?=$Properties['ArtistID']?>" />
  145. <input type="hidden" name="oldcategoryid" value="<?=$Properties['CategoryID']?>" />
  146. <table>
  147. <tr>
  148. <td class="label">Change category</td>
  149. <td>
  150. <select id="newcategoryid" name="newcategoryid">
  151. <? foreach ($Categories as $CatID => $CatName) { ?>
  152. <option value="<?=($CatID + 1)?>"<?Format::selected('CategoryID', $CatID + 1, 'selected', $Properties)?>><?=($CatName)?></option>
  153. <? } ?>
  154. </select>
  155. </td>
  156. <tr id="split_releasetype">
  157. <td class="label">Release type</td>
  158. <td>
  159. <select name="releasetype">
  160. <? foreach ($ReleaseTypes as $RTID => $ReleaseType) { ?>
  161. <option value="<?=($RTID)?>"><?=($ReleaseType)?></option>
  162. <? } ?>
  163. </select>
  164. </td>
  165. </tr>
  166. <tr id="split_artist">
  167. <td class="label">Artist</td>
  168. <td>
  169. <input type="text" name="artist" value="<?=$Properties['ArtistName']?>" size="50" />
  170. </td>
  171. </tr>
  172. <tr id="split_title">
  173. <td class="label">Title</td>
  174. <td>
  175. <input type="text" name="title" value="<?=$Properties['Title']?>" size="50" />
  176. </td>
  177. </tr>
  178. <tr id="split_year">
  179. <td class="label">Year</td>
  180. <td>
  181. <input type="text" name="year" value="<?=$Properties['Year']?>" size="10" />
  182. </td>
  183. </tr>
  184. <tr>
  185. <td colspan="2" class="center">
  186. <input type="submit" value="Change category" />
  187. </td>
  188. </tr>
  189. </table>
  190. <script type="text/javascript">ChangeCategory($('#newcategoryid').raw().value);</script>
  191. </form>
  192. </div>
  193. <?
  194. }
  195. ?>
  196. </div>
  197. <?
  198. } // if check_perms('torrents_edit')
  199. View::show_footer(); ?>