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.

edit.php 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <?php
  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.FileList,
  32. t.MediaInfo,
  33. tg.CategoryID,
  34. tg.Name AS Title,
  35. tg.NameJP AS TitleJP,
  36. tg.Year,
  37. tg.Studio,
  38. tg.Series,
  39. tg.CatalogueNumber,
  40. ag.Name AS ArtistName,
  41. t.GroupID,
  42. t.UserID,
  43. bt.TorrentID AS BadTags,
  44. bf.TorrentID AS BadFolders,
  45. bfi.TorrentID AS BadFiles
  46. FROM torrents AS t
  47. LEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID
  48. LEFT JOIN torrents_artists AS ta ON tg.ID = ta.GroupID
  49. LEFT JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID
  50. LEFT JOIN torrents_bad_tags AS bt ON bt.TorrentID = t.ID
  51. LEFT JOIN torrents_bad_folders AS bf ON bf.TorrentID = t.ID
  52. LEFT JOIN torrents_bad_files AS bfi ON bfi.TorrentID = t.ID
  53. WHERE t.ID = '$TorrentID'");
  54. list($Properties) = $DB->to_array(false, MYSQLI_BOTH);
  55. if (!$Properties) {
  56. error(404);
  57. }
  58. $UploadForm = $Categories[$Properties['CategoryID'] - 1];
  59. if (($LoggedUser['ID'] !== $Properties['UserID'] && !check_perms('torrents_edit')) || $LoggedUser['DisableWiki']) {
  60. error(403);
  61. }
  62. View::show_header('Edit torrent', 'upload,torrent,bbcode');
  63. $TorrentForm = new TorrentForm($Properties, $Err, false);
  64. $TorrentForm->upload_form();
  65. if (check_perms('torrents_edit') || check_perms('users_mod')) {
  66. # Start the HTML edit form
  67. ?>
  68. <div class="thin">
  69. <?php
  70. #if ($Properties['CategoryID'] !== 5) {
  71. ?>
  72. <br />
  73. <div class="header">
  74. <h2>Change Group</h2>
  75. </div>
  76. <div class="box pad">
  77. <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
  78. <input type="hidden" name="action" value="editgroupid" />
  79. <input type="hidden" name="auth"
  80. value="<?=$LoggedUser['AuthKey']?>" />
  81. <input type="hidden" name="torrentid"
  82. value="<?=$TorrentID?>" />
  83. <input type="hidden" name="oldgroupid"
  84. value="<?=$Properties['GroupID']?>" />
  85. <table class="layout">
  86. <tr>
  87. <td class="label">Group ID</td>
  88. <td>
  89. <input type="text" name="groupid"
  90. value="<?=$Properties['GroupID']?>"
  91. size="10" />
  92. </td>
  93. </tr>
  94. <tr>
  95. <td colspan="2" class="center">
  96. <input type="submit" value="Change Group ID" />
  97. </td>
  98. </tr>
  99. </table>
  100. </form>
  101. </div>
  102. <br />
  103. <h2>Split off into new group</h2>
  104. <div class="box pad">
  105. <form class="split_form" name="torrent_group" action="torrents.php" method="post">
  106. <input type="hidden" name="action" value="newgroup" />
  107. <input type="hidden" name="auth"
  108. value="<?=$LoggedUser['AuthKey']?>" />
  109. <input type="hidden" name="torrentid"
  110. value="<?=$TorrentID?>" />
  111. <input type="hidden" name="oldgroupid"
  112. value="<?=$Properties['GroupID']?>" />
  113. <table class="layout">
  114. <tr>
  115. <td class="label">Author</td>
  116. <td>
  117. <input type="text" name="artist"
  118. value="<?=$Properties['ArtistName']?>"
  119. size="50" />
  120. </td>
  121. </tr>
  122. <tr>
  123. <td class="label">Torrent Title</td>
  124. <td>
  125. <input type="text" name="title"
  126. value="<?=$Properties['Title']?>"
  127. size="50" />
  128. </td>
  129. </tr>
  130. <tr>
  131. <td class="label">Strain/Variety</td>
  132. <td>
  133. <input type="test" name="title_jp"
  134. value="<?=$Properties['TitleJP']?>"
  135. size=50" />
  136. </td>
  137. <tr>
  138. <td class="label">Year</td>
  139. <td>
  140. <input type="text" name="year"
  141. value="<?=$Properties['Year']?>"
  142. size="10" />
  143. </td>
  144. </tr>
  145. <tr>
  146. <td colspan="2" class="center">
  147. <input type="submit" value="Split into new group" />
  148. </td>
  149. </tr>
  150. </table>
  151. </form>
  152. </div>
  153. <br />
  154. <?php
  155. #}
  156. if (check_perms('users_mod')) { ?>
  157. <h2>Change Category</h2>
  158. <div class="box pad">
  159. <form action="torrents.php" method="post">
  160. <input type="hidden" name="action" value="changecategory" />
  161. <input type="hidden" name="auth"
  162. value="<?=$LoggedUser['AuthKey']?>" />
  163. <input type="hidden" name="torrentid"
  164. value="<?=$TorrentID?>" />
  165. <input type="hidden" name="oldgroupid"
  166. value="<?=$Properties['GroupID']?>" />
  167. <input type="hidden" name="oldartistid"
  168. value="<?=$Properties['ArtistID']?>" />
  169. <input type="hidden" name="oldcategoryid"
  170. value="<?=$Properties['CategoryID']?>" />
  171. <table>
  172. <tr>
  173. <td class="label">Category</td>
  174. <td>
  175. <select id="newcategoryid" name="newcategoryid">
  176. <?php foreach ($Categories as $CatID => $CatName) { ?>
  177. <option value="<?=($CatID + 1)?>" <?Format::selected('CategoryID', $CatID + 1, 'selected', $Properties)?>><?=($CatName)?>
  178. </option>
  179. <?php } ?>
  180. </select>
  181. </td>
  182. </tr>
  183. <tr id="split_artist">
  184. <td class="label">Artist</td>
  185. <td>
  186. <input type="text" name="artist"
  187. value="<?=$Properties['ArtistName']?>"
  188. size="50" />
  189. </td>
  190. </tr>
  191. <tr id="split_title">
  192. <td class="label">Torrent Title</td>
  193. <td>
  194. <input type="text" name="title"
  195. value="<?=$Properties['Title']?>"
  196. size="50" />
  197. </td>
  198. </tr>
  199. <tr id="split_year">
  200. <td class="label">Year</td>
  201. <td>
  202. <input type="text" name="year"
  203. value="<?=$Properties['Year']?>"
  204. size="10" />
  205. </td>
  206. </tr>
  207. <tr>
  208. <td colspan="2" class="center">
  209. <input type="submit" value="Change Category" />
  210. </td>
  211. </tr>
  212. </table>
  213. <script type="text/javascript">
  214. ChangeCategory($('#newcategoryid').raw().value);
  215. </script>
  216. </form>
  217. </div>
  218. <?php
  219. } ?>
  220. </div>
  221. <?php
  222. } // if check_perms('torrents_edit')
  223. View::show_footer();