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.

torrent_form.class.php 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. <?
  2. /********************************************************************************
  3. ************ Torrent form class *************** upload.php and torrents.php ****
  4. ********************************************************************************
  5. ** This class is used to create both the upload form, and the 'edit torrent' **
  6. ** form. It is broken down into several functions - head(), foot(), **
  7. ** music_form() [music], audiobook_form() [Audiobooks and comedy], and **
  8. ** simple_form() [everything else]. **
  9. ** **
  10. ** When it is called from the edit page, the forms are shortened quite a bit. **
  11. ** **
  12. ********************************************************************************/
  13. class TORRENT_FORM {
  14. var $UploadForm = '';
  15. var $Categories = array();
  16. var $Formats = array();
  17. var $Bitrates = array();
  18. var $Media = array();
  19. var $MediaManaga = array();
  20. var $Containers = array();
  21. var $ContainersGames = array();
  22. var $Codecs = array();
  23. var $Resolutions = array();
  24. var $AudioFormats = array();
  25. var $Subbing = array();
  26. var $Languages = array();
  27. var $Platform = array();
  28. var $NewTorrent = false;
  29. var $Torrent = array();
  30. var $Error = false;
  31. var $TorrentID = false;
  32. var $Disabled = '';
  33. var $DisabledFlag = false;
  34. function TORRENT_FORM($Torrent = false, $Error = false, $NewTorrent = true) {
  35. $this->NewTorrent = $NewTorrent;
  36. $this->Torrent = $Torrent;
  37. $this->Error = $Error;
  38. global $UploadForm, $Categories, $Formats, $Bitrates, $Media, $MediaManga, $TorrentID, $Containers, $ContainersGames, $Codecs, $Resolutions, $AudioFormats, $Subbing, $Languages, $Platform, $Archives, $ArchivesManga;
  39. $this->UploadForm = $UploadForm;
  40. $this->Categories = $Categories;
  41. $this->Formats = $Formats;
  42. $this->Bitrates = $Bitrates;
  43. $this->Media = $Media;
  44. $this->MediaManga = $MediaManga;
  45. $this->Containers = $Containers;
  46. $this->ContainersGames = $ContainersGames;
  47. $this->Codecs = $Codecs;
  48. $this->Resolutions = $Resolutions;
  49. $this->AudioFormats = $AudioFormats;
  50. $this->Subbing = $Subbing;
  51. $this->Languages = $Languages;
  52. $this->TorrentID = $TorrentID;
  53. $this->Platform = $Platform;
  54. $this->Archives = $Archives;
  55. $this->ArchivesManga = $ArchivesManga;
  56. if ($this->Torrent && $this->Torrent['GroupID']) {
  57. $this->Disabled = ' readonly="readonly"';
  58. $this->DisabledFlag = true;
  59. }
  60. }
  61. function head() {
  62. G::$DB->query("
  63. SELECT COUNT(ID)
  64. FROM torrents
  65. WHERE UserID = ".G::$LoggedUser['ID']);
  66. list($Uploads) = G::$DB->next_record();
  67. ?>
  68. <div class="thin">
  69. <? if ($this->NewTorrent) { ?>
  70. <p style="text-align: center;">
  71. If you would like to use your own torrent file, add the following to it:<br />
  72. <? $Announces = call_user_func_array('array_merge', ANNOUNCE_URLS);
  73. foreach ($Announces as $Announce) {
  74. ?>
  75. Announce: <input type="text" value="<?=$Announce . '/' . G::$LoggedUser['torrent_pass'] . '/announce'?>" size="74" onclick="this.select();" readonly="readonly" /> <br />
  76. <? } ?>
  77. Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20" onclick="this.select();" readonly="readonly" />
  78. <p style="text-align: center;">
  79. Otherwise, add none of it and simply redownload the torrent after uploading it. All of the above data will be added by the site.<br /><br />
  80. <strong<?=((!$Uploads)?' class="important_text"':'')?>>
  81. If you never have before, be sure to read this list of <a href="wiki.php?action=article&name=uploadingpitfalls">uploading pitfalls</a>
  82. </strong>
  83. </p>
  84. </p>
  85. <? }
  86. if ($this->Error) {
  87. echo "\t".'<p style="color: red; text-align: center;">'.$this->Error."</p>\n";
  88. }
  89. ?>
  90. <form class="create_form box pad" name="torrent" action="" enctype="multipart/form-data" method="post" onsubmit="$('#post').raw().disabled = 'disabled';">
  91. <div>
  92. <input type="hidden" name="submit" value="true" />
  93. <input type="hidden" name="auth" value="<?=G::$LoggedUser['AuthKey']?>" />
  94. <? if (!$this->NewTorrent) { ?>
  95. <input type="hidden" name="action" value="takeedit" />
  96. <input type="hidden" name="torrentid" value="<?=display_str($this->TorrentID)?>" />
  97. <input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID']-1)?>" />
  98. <?
  99. } else {
  100. if ($this->Torrent && $this->Torrent['GroupID']) {
  101. ?>
  102. <input type="hidden" name="groupid" value="<?=display_str($this->Torrent['GroupID'])?>" />
  103. <input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID']-1)?>" />
  104. <?
  105. }
  106. if ($this->Torrent && $this->Torrent['RequestID']) {
  107. ?>
  108. <input type="hidden" name="requestid" value="<?=display_str($this->Torrent['RequestID'])?>" />
  109. <?
  110. }
  111. }
  112. ?>
  113. </div>
  114. <? if ($this->NewTorrent) { ?>
  115. <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
  116. <tr>
  117. <td class="label">Torrent file:</td>
  118. <td><input id="file" type="file" name="file_input" size="50" /></td>
  119. </tr>
  120. <tr>
  121. <td class="label">Type:</td>
  122. <td>
  123. <select id="categories" name="type" onchange="Categories()"<?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  124. <?
  125. foreach (Misc::display_array($this->Categories) as $Index => $Cat) {
  126. echo "\t\t\t\t\t\t<option value=\"$Index\"";
  127. if ($Cat == $this->Torrent['CategoryName']) {
  128. echo ' selected="selected"';
  129. }
  130. echo ">$Cat</option>\n";
  131. }
  132. ?>
  133. </select>
  134. </td>
  135. </tr>
  136. </table>
  137. <? }//if ?>
  138. <div id="dynamic_form">
  139. <?
  140. } // function head
  141. function foot() {
  142. $Torrent = $this->Torrent;
  143. ?>
  144. </div>
  145. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  146. <?
  147. if (!$this->NewTorrent) {
  148. if (check_perms('torrents_freeleech')) {
  149. ?>
  150. <tr id="freetorrent">
  151. <td class="label">Freeleech</td>
  152. <td>
  153. <select name="freeleech">
  154. <?
  155. $FL = array("Normal", "Free", "Neutral");
  156. foreach ($FL as $Key => $Name) {
  157. ?>
  158. <option value="<?=$Key?>"<?=($Key == $Torrent['FreeTorrent'] ? ' selected="selected"' : '')?>><?=$Name?></option>
  159. <? } ?>
  160. </select>
  161. because
  162. <select name="freeleechtype">
  163. <?
  164. $FL = array("N/A", "Staff Pick", "Perma-FL", "Freeleechizer", "Site-Wide FL");
  165. foreach ($FL as $Key => $Name) {
  166. ?>
  167. <option value="<?=$Key?>"<?=($Key == $Torrent['FreeLeechType'] ? ' selected="selected"' : '')?>><?=$Name?></option>
  168. <? } ?>
  169. </select>
  170. </td>
  171. </tr>
  172. <?
  173. }
  174. }
  175. ?>
  176. <tr>
  177. <td colspan="2" style="text-align: center;">
  178. <p>Be sure that your torrent is approved by the <a href="rules.php?p=upload" target="_blank">rules</a>. Not doing this will result in a <strong class="important_text">warning</strong> or <strong class="important_text">worse</strong>.</p>
  179. <? if ($this->NewTorrent) { ?>
  180. <p>After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent. Make use of this time wisely, and <a href="requests.php">search the list of requests</a>.</p>
  181. <? } ?>
  182. <input id="post" type="submit"<? if ($this->NewTorrent) { echo ' value="Upload torrent"'; } else { echo ' value="Edit torrent"';} ?> />
  183. </td>
  184. </tr>
  185. </table>
  186. </form>
  187. </div>
  188. <?
  189. } //function foot
  190. function movies_form($GenreTags) {
  191. $QueryID = G::$DB->get_query_id();
  192. $Torrent = $this->Torrent;
  193. ?>
  194. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  195. <? if ($this->NewTorrent) { ?>
  196. <tr id="javdb_tr">
  197. <td class="label tooltip" title='Enter a JAV catalogue number, e.g., "CND-060"'>Catalogue Number:</td>
  198. <td>
  199. <input type="text" id="catalogue" name="catalogue" size="10" value="<?=display_str($Torrent['CatalogueNumber']) ?>" <?=$this->Disabled?>/>
  200. <? if (!$this->DisabledFlag) { ?>
  201. <input type="button" autofill="jav" value="Autofill"></input>
  202. <? } ?>
  203. </td>
  204. </tr>
  205. <tr id="title_tr">
  206. <td class="label">English Title:</td>
  207. <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?>/></td>
  208. </tr>
  209. <tr id="title_rj_tr">
  210. <td class="label">Romaji Title:</td>
  211. <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
  212. </tr>
  213. <tr id="title_jp_tr">
  214. <td class="label">Japanese Title:</td>
  215. <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
  216. </tr>
  217. <tr>
  218. <td class="label">Idol(s):</td>
  219. <td id="idolfields">
  220. <? if (!empty($Torrent['Artists'])) {
  221. foreach ($Torrent['Artists'] as $Num => $Artist) { ?>
  222. <input type="text" id="idols_<?=$Num?>" name="idols[]" size="45" value="<?=display_str($Artist['name'])?>" <?=$this->Disabled?>/>
  223. <? if ($Num == 0) { ?>
  224. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  225. <? }
  226. }
  227. } else { ?>
  228. <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?> />
  229. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  230. <? } ?>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td class="label">Studio:</td>
  235. <td><input type="text" id="studio" name="studio" size="60" value="<?=display_str($Torrent['Studio']) ?>" <?=$this->Disabled?>/></td>
  236. </tr>
  237. <tr>
  238. <td class="label">Series:</td>
  239. <td><input type="text" id="series" name="series" size="60" value="<?=display_str($Torrent['Series']) ?>" <?=$this->Disabled?>/></td>
  240. </tr>
  241. <tr id="year_tr">
  242. <td class="label">Year:</td>
  243. <td><input type="text" id="year" name="year" maxlength="4" size="5" value="<?=display_str($Torrent['Year']) ?>" <?=$this->Disabled?>/></td>
  244. </tr>
  245. <? } ?>
  246. <tr>
  247. <td class="label">Media:</td>
  248. <td>
  249. <select name="media">
  250. <option>---</option>
  251. <?
  252. foreach($this->Media as $Media) {
  253. echo "\t\t\t\t\t\t<option value=\"$Media\"";
  254. if ($Media == $Torrent['Media']) {
  255. echo " selected";
  256. }
  257. echo ">$Media</option>\n";
  258. }
  259. ?>
  260. </select>
  261. </td>
  262. </tr>
  263. <tr>
  264. <td class="label">Container:</td>
  265. <td>
  266. <select name="container">
  267. <option>---</option>
  268. <?
  269. foreach($this->Containers as $Cont) {
  270. echo "\t\t\t\t\t\t<option value=\"$Cont\"";
  271. if ($Cont == $Torrent['Container']) {
  272. echo " selected";
  273. }
  274. echo ">$Cont</option>\n";
  275. }
  276. ?>
  277. </select>
  278. </td>
  279. </tr>
  280. <tr>
  281. <td class="label">Codecs:</td>
  282. <td>
  283. <select name="codec">
  284. <option>---</option>
  285. <?
  286. foreach($this->Codecs as $Codec) {
  287. echo "\t\t\t\t\t\t<option value=\"$Codec\"";
  288. if ($Codec == $Torrent['Codec']) {
  289. echo " selected";
  290. }
  291. echo ">$Codec</option>\n";
  292. }
  293. ?>
  294. </select>
  295. </td>
  296. </tr>
  297. <tr>
  298. <td class="label">Resolution:</td>
  299. <td>
  300. <select id="ressel" name="ressel" onchange="SetResolution()">
  301. <option>---</option>
  302. <?
  303. foreach($this->Resolutions as $Res) {
  304. echo "\t\t\t\t\t\t<option value=\"$Res\"";
  305. if ($Res == $Torrent['Resolution'] || (!isset($FoundRes) && isset($Torrent['Resolution']) && $Res == "Other")) {
  306. echo " selected";
  307. $FoundRes = true;
  308. }
  309. echo ">$Res</option>\n";
  310. }
  311. ?>
  312. </select>
  313. <input type="text" id="resolution" name="resolution" size="10" class="hidden tooltip" title='Enter "Other" resolutions in the form ###x###' value="<?=$Torrent['Resolution']?>" readonly></input>
  314. <script>
  315. if ($('#ressel').raw().value == "Other") {
  316. $('#resolution').raw().readOnly = false
  317. $('#resolution').gshow()
  318. }
  319. </script>
  320. </td>
  321. </tr>
  322. <tr>
  323. <td class="label">Audio:</td>
  324. <td>
  325. <select name="audioformat">
  326. <option>---</option>
  327. <?
  328. foreach($this->AudioFormats as $AudioFormat) {
  329. echo "\t\t\t\t\t\t<option value=\"$AudioFormat\"";
  330. if ($AudioFormat == $Torrent['AudioFormat']) {
  331. echo " selected";
  332. }
  333. echo ">$AudioFormat</option>\n";
  334. }
  335. ?>
  336. </select>
  337. </td>
  338. </tr>
  339. <tr>
  340. <td class="label">Subbing:</td>
  341. <td>
  342. <select name="sub">
  343. <option>---</option>
  344. <?
  345. foreach($this->Subbing as $Subbing) {
  346. echo "\t\t\t\t\t\t<option value=\"$Subbing\"";
  347. if ($Subbing == $Torrent['Subbing']) {
  348. echo " selected";
  349. }
  350. echo ">$Subbing</option>\n";
  351. }
  352. ?>
  353. </select>
  354. </td>
  355. </tr>
  356. <tr>
  357. <td class="label">Language:</td>
  358. <td>
  359. <select name="lang">
  360. <option>---</option>
  361. <?
  362. foreach($this->Languages as $Language) {
  363. echo "\t\t\t\t\t\t<option value=\"$Language\"";
  364. if ($Language == $Torrent['Language']) {
  365. echo " selected";
  366. }
  367. echo ">$Language</option>\n";
  368. }
  369. ?>
  370. </select>
  371. </td>
  372. </tr>
  373. <tr>
  374. <td class="label">Censored?:</td>
  375. <td>
  376. <input type="checkbox" name="censored" value="1" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?>/>
  377. </td>
  378. </tr>
  379. <tr>
  380. <td class="label">Media Info:</td>
  381. <td>
  382. <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()" rows="8" cols="60"><?=display_str($Torrent['MediaInfo'])?></textarea>
  383. </td>
  384. </tr>
  385. <!--<tr>
  386. <td class="label">Release Group (optional):</td>
  387. <td><input type="text" id="release" name="release" size="60" /></td>
  388. </tr>-->
  389. <? if ($this->NewTorrent) { ?>
  390. <tr>
  391. <td class="label tooltip" title="Comma seperated list of tags">Tags:</td>
  392. <td>
  393. <?
  394. $GenreTags = G::$Cache->get_value('genre_tags');
  395. if (!$GenreTags) {
  396. $DB->query("
  397. SELECT Name
  398. FROM tags
  399. WHERE TagType = 'genre'
  400. ORDER BY Name");
  401. $GenreTags = $DB->collect('Name');
  402. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  403. }
  404. ?>
  405. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  406. <option>---</option>
  407. <? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  408. <option value="<?=$Genre?>"><?=$Genre?></option>
  409. <? } ?>
  410. </select>
  411. <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
  412. </td>
  413. </tr>
  414. <tr>
  415. <td class="label">Cover Image:</td>
  416. <td><input type="text" id="image" name="image" size="60" value="<?=display_str($Torrent['Image']) ?>"<?=$this->Disabled?> /></td>
  417. </tr>
  418. <? if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  419. <tr>
  420. <td class="label">Screenshots:</td>
  421. <td>
  422. <textarea rows="8" cols="60" name="screenshots" id="screenshots"><?=display_str($Torrent['Screenshots'])?></textarea>
  423. <p>Enter up to 10 links to screenshots for the torrent, one per line. The system will automatically remove malformed or invalid links, as well as any links after the 10th. <strong class="important_text">Remember to consult the <a href="/rules.php?p=upload#h1.4">rules for adding screenshots</a>.</strong></p>
  424. </tr>
  425. <? } ?>
  426. <tr>
  427. <td class="label">Torrent Group Description:</td>
  428. <td>
  429. <?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, !$this->DisabledFlag, !$this->DisabledFlag, false, array($this->Disabled)); ?>
  430. <p class="min_padding">Contains information such as a description of the movie, a link to a JAV catalogue, etc.</p>
  431. </td>
  432. </tr>
  433. <? } ?>
  434. <tr>
  435. <td class="label">Torrent Description (optional):</td>
  436. <td>
  437. <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?>
  438. <p class="min_padding">Contains information such as encoder settings.</p>
  439. </td>
  440. </tr>
  441. </table>
  442. <?
  443. // For AJAX requests (e.g. when changing the type from Music to Applications),
  444. // we don't need to include all scripts, but we do need to include the code
  445. // that generates previews. It will have to be eval'd after an AJAX request.
  446. if ($_SERVER['SCRIPT_NAME'] === '/ajax.php')
  447. TEXTAREA_PREVIEW::JavaScript(false);
  448. G::$DB->set_query_id($QueryID);
  449. }//function music_form
  450. function anime_form() {
  451. $Torrent = $this->Torrent;
  452. ?>
  453. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  454. <? if ($this->NewTorrent) { ?>
  455. <tr id="anidb_tr">
  456. <td class="label">AniDB Autofill (optional):</td>
  457. <td>
  458. <input type="text" id="anidb" size="10" <?=$this->Disabled?>/>
  459. <? if (!$this->DisabledFlag) { ?>
  460. <input type="button" autofill="anime" value="Autofill"/>
  461. <? } ?>
  462. </td>
  463. </tr>
  464. <tr id="title_tr">
  465. <td class="label">English Title:</td>
  466. <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?>/></td>
  467. </tr>
  468. <tr id="title_rj_tr">
  469. <td class="label">Romaji Title:</td>
  470. <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
  471. </tr>
  472. <tr id="title_jp_tr">
  473. <td class="label">Japanese Title:</td>
  474. <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
  475. </tr>
  476. <tr>
  477. <td class="label">Artist/Studio:</td>
  478. <td id="idolfields">
  479. <? if (!empty($Torrent['Artists'])) {
  480. foreach ($Torrent['Artists'] as $Num => $Artist) { ?>
  481. <input type="text" id="idols_<?=$Num?>" name="idols[]" size="45" value="<?=display_str($Artist['name'])?>" <?=$this->Disabled?> />
  482. <? if ($Num == 0) { ?>
  483. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  484. <? }
  485. }
  486. } else { ?>
  487. <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?> />
  488. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  489. <? } ?>
  490. </td>
  491. </tr>
  492. <tr>
  493. <td class="label">Circle (Optional):</td>
  494. <td><input type="text" id="series" name="series" size="60" value="<?=display_str($Torrent['Series']) ?>" <?=$this->Disabled?>/></td>
  495. </tr>
  496. <tr id="year_tr">
  497. <td class="label">Year:</td>
  498. <td><input type="text" id="year" name="year" maxlength="4" size="5" value="<?=display_str($Torrent['Year']) ?>" <?=$this->Disabled?> /></td>
  499. </tr>
  500. <? } ?>
  501. <tr>
  502. <td class="label">Media:</td>
  503. <td>
  504. <select name="media">
  505. <option>---</option>
  506. <?
  507. foreach($this->Media as $Media) {
  508. echo "\t\t\t\t\t\t<option value=\"$Media\"";
  509. if ($Media == $Torrent['Media']) {
  510. echo " selected";
  511. }
  512. echo ">$Media</option>\n";
  513. }
  514. ?>
  515. </select>
  516. </td>
  517. </tr>
  518. <tr>
  519. <td class="label">Container:</td>
  520. <td>
  521. <select name="container">
  522. <option>---</option>
  523. <?
  524. foreach($this->Containers as $Container) {
  525. echo "\t\t\t\t\t\t<option value=\"$Container\"";
  526. if ($Container == $Torrent['Container']) {
  527. echo " selected";
  528. }
  529. echo ">$Container</option>\n";
  530. }
  531. ?>
  532. </select>
  533. </td>
  534. </tr>
  535. <tr>
  536. <td class="label">Codecs:</td>
  537. <td>
  538. <select name="codec">
  539. <option>---</option>
  540. <?
  541. foreach($this->Codecs as $Codec) {
  542. echo "\t\t\t\t\t\t<option value=\"$Codec\"";
  543. if ($Codec == $Torrent['Codec']) {
  544. echo " selected";
  545. }
  546. echo ">$Codec</option>\n";
  547. }
  548. ?>
  549. </select>
  550. </td>
  551. </tr>
  552. <tr>
  553. <td class="label">Resolution:</td>
  554. <td>
  555. <select id="ressel" name="ressel" onchange="SetResolution()">
  556. <option>---</option>
  557. <?
  558. foreach($this->Resolutions as $Res) {
  559. echo "\t\t\t\t\t\t<option value=\"$Res\"";
  560. if ($Res == $Torrent['Resolution'] || (!isset($FoundRes) && isset($Torrent ['Resolution']) && $Res == "Other")) {
  561. echo " selected";
  562. $FoundRes = true;
  563. }
  564. echo ">$Res</option>\n";
  565. }
  566. ?>
  567. </select>
  568. <input type="text" id="resolution" name="resolution" size="10" class="hidden tooltip" title='Enter "Other" resolutions in the form ###x###' value="<?=$Torrent['Resolution']?>" readonly></input>
  569. <script>
  570. if ($('#ressel').raw().value == "Other") {
  571. $('#resolution').raw().readOnly = false
  572. $('#resolution').gshow()
  573. }
  574. </script>
  575. </td>
  576. </tr>
  577. <tr>
  578. <td class="label">Audio:</td>
  579. <td>
  580. <select name="audioformat">
  581. <option>---</option>
  582. <?
  583. foreach($this->AudioFormats as $AudioFormat) {
  584. echo "\t\t\t\t\t\t<option value=\"$AudioFormat\"";
  585. if ($AudioFormat == $Torrent['AudioFormat']) {
  586. echo " selected";
  587. }
  588. echo ">$AudioFormat</option>\n";
  589. }
  590. ?>
  591. </select>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td class="label">Language:</td>
  596. <td>
  597. <select name="lang">
  598. <option>---</option>
  599. <?
  600. foreach($this->Languages as $Language) {
  601. echo "\t\t\t\t\t\t<option value=\"$Language\"";
  602. if ($Language == $Torrent['Language']) {
  603. echo " selected";
  604. }
  605. echo ">$Language</option>\n";
  606. }
  607. ?>
  608. </select>
  609. </td>
  610. </tr>
  611. <tr>
  612. <td class="label">Subbing:</td>
  613. <td>
  614. <select name="sub" onchange="DisplayTrans()">
  615. <option>---</option>
  616. <?
  617. foreach($this->Subbing as $Subbing) {
  618. echo "\t\t\t\t\t\t<option value=\"$Subbing\"";
  619. if ($Subbing == $Torrent['Subbing']) {
  620. echo " selected";
  621. }
  622. echo ">$Subbing</option>\n";
  623. }
  624. ?>
  625. </select>
  626. </td>
  627. </tr>
  628. <tr>
  629. <td class="label">Translation Group (optional):</td>
  630. <td><input type="text" id="subber" name="subber" size="60" value="<?=display_str($Torrent['Subber']) ?>" /></td>
  631. </tr>
  632. <tr>
  633. <td class="label">Censored?:</td>
  634. <td>
  635. <input type="checkbox" name="censored" value="censored" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?> />
  636. </td>
  637. </tr>
  638. <tr>
  639. <td class="label">Media Info:</td>
  640. <td>
  641. <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()" rows="8" cols="60"><?=display_str($Torrent['MediaInfo'])?></textarea>
  642. </td>
  643. </tr>
  644. <? if ($this->NewTorrent) { ?>
  645. <tr>
  646. <td class="label tooltip" title="Comma seperated list of tags">Tags:</td>
  647. <td>
  648. <?
  649. $GenreTags = G::$Cache->get_value('genre_tags');
  650. if (!$GenreTags) {
  651. $DB->query("
  652. SELECT Name
  653. FROM tags
  654. WHERE TagType = 'genre'
  655. ORDER BY Name");
  656. $GenreTags = $DB->collect('Name');
  657. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  658. }
  659. ?>
  660. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  661. <option>---</option>
  662. <? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  663. <option value="<?=$Genre?>"><?=$Genre?></option>
  664. <? } ?>
  665. </select>
  666. <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
  667. <p class="min_padding">Remember to use the '3d' tag if your upload is 3DCG!</p>
  668. </td>
  669. </tr>
  670. <tr>
  671. <td class="label">Cover Image:</td>
  672. <td><input type="text" id="image" name="image" size="60" value="<?=display_str($Torrent['Image']) ?>"<?=$this->Disabled?> /></td>
  673. </tr>
  674. <? if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  675. <tr>
  676. <td class="label">Screenshots:</td>
  677. <td>
  678. <textarea rows="8" cols="60" name="screenshots" id="screenshots"><?=display_str($Torrent['Screenshots'])?></textarea>
  679. <p>Enter up to 10 links to screenshots for the torrent, one per line. The system will automatically remove malformed or invalid links, as well as any links after the 10th. Remember to consult the <a href="/rules.php?p=upload#h1.4">rules for adding screenshots</a>.</p>
  680. </tr>
  681. <? } ?>
  682. <tr>
  683. <td class="label">Torrent Group Description:</td>
  684. <td>
  685. <?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, !$this->DisabledFlag, !$this->DisabledFlag, false, array($this->Disabled)); ?>
  686. <p class="min_padding">Contains information such as a description of the anime, a link to AniDB, etc.</p>
  687. </td>
  688. </tr>
  689. <? } ?>
  690. <tr>
  691. <td class="label">Torrent Description (optional):</td>
  692. <td>
  693. <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?>
  694. <p class="min_padding">Contains information such as encoder settings.</p>
  695. </td>
  696. </tr>
  697. </table>
  698. <?
  699. if ($_SERVER['SCRIPT_NAME'] === '/ajax.php')
  700. TEXTAREA_PREVIEW::JavaScript(false);
  701. }//function audiobook_form
  702. function manga_form() {
  703. $Torrent = $this->Torrent;
  704. ?>
  705. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  706. <? if ($this->NewTorrent) { ?>
  707. <tr id="catalogue_tr">
  708. <td class="label">e-hentai URL (optional):</td>
  709. <td>
  710. <input type="text" id="catalogue" size="50" <?=$this->Disabled?> />
  711. <? if (!$this->DisabledFlag) { ?>
  712. <input type="button" autofill="douj" value="Autofill"/>
  713. <? } ?>
  714. </td>
  715. </tr>
  716. <tr id="title_tr">
  717. <td class="label">English Title:</td>
  718. <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?> /></td>
  719. </tr>
  720. <tr id="title_rj_tr">
  721. <td class="label">Romaji Title:</td>
  722. <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
  723. </tr>
  724. <tr id="title_jp_tr">
  725. <td class="label">Japanese Title:</td>
  726. <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
  727. </tr>
  728. <tr>
  729. <td class="label">Artist:</td>
  730. <td id="idolfields">
  731. <? if (!empty($Torrent['Artists'])) {
  732. foreach ($Torrent['Artists'] as $Num => $Artist) { ?>
  733. <input type="text" id="idols_<?=$Num?>" name="idols[]" size="45" value="<?=display_str($Artist['name'])?>" <?=$this->Disabled?> />
  734. <? if ($Num == 0) { ?>
  735. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  736. <? }
  737. }
  738. } else { ?>
  739. <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?> />
  740. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  741. <? } ?>
  742. </td>
  743. </tr>
  744. <tr>
  745. <td class="label">Circle (Optional):</td>
  746. <td><input type="text" id="series" name="series" size="60" value="<?=display_str($Torrent['Series']) ?>" <?=$this->Disabled?>/></td>
  747. </tr>
  748. <tr>
  749. <td class="label">Publisher (Optional):</td>
  750. <td><input type="text" id="studio" name="studio" size="60" value="<?=display_str($Torrent['Studio']) ?>" <?=$this->Disabled?>/></td>
  751. </tr>
  752. <tr id="year_tr">
  753. <td class="label">Year:</td>
  754. <td><input type="text" id="year" name="year" maxlength="4" size="5" value="<?=display_str($Torrent['Year']) ?>" <?=$this->Disabled?> /></td>
  755. </tr>
  756. <tr id="pages_tr">
  757. <td class="label">Pages:</td>
  758. <td><input type="text" id="pages" name="pages" maxlength="5" size="5" value="<?=display_str($Torrent['Pages']) ?>" <?=$this->Disabled?> /></td>
  759. </tr>
  760. <? } ?>
  761. <tr>
  762. <td class="label">Media:</td>
  763. <td>
  764. <select name="media">
  765. <option>---</option>
  766. <?
  767. foreach($this->MediaManga as $Media) {
  768. echo "\t\t\t\t\t\t<option value=\"$Media\"";
  769. if ($Media == $Torrent['Media']) {
  770. echo " selected";
  771. }
  772. echo ">$Media</option>\n";
  773. }
  774. ?>
  775. </select>
  776. </td>
  777. </tr>
  778. <tr>
  779. <td class='label'>Archive:</td>
  780. <td>
  781. <select name='archive'>
  782. <option>---</option>
  783. <?
  784. foreach(array_merge($this->Archives, $this->ArchivesManga) as $Archive) {
  785. echo "\t\t\t\t\t\t<option value=\"$Archive\"";
  786. if ($Archive == $Torrent['Archive']) {
  787. echo ' selected';
  788. }
  789. echo ">$Archive</option>\n";
  790. }
  791. ?>
  792. </select>
  793. </td>
  794. </tr>
  795. <tr>
  796. <td class="label">Language:</td>
  797. <td>
  798. <select name="lang" id="lang">
  799. <option>---</option>
  800. <?
  801. foreach($this->Languages as $Language) {
  802. echo "\t\t\t\t\t\t<option value=\"$Language\"";
  803. if ($Language == $Torrent['Language']) {
  804. echo " selected";
  805. }
  806. echo ">$Language</option>\n";
  807. }
  808. ?>
  809. </select>
  810. </td>
  811. </tr>
  812. <tr>
  813. <td class="label">Translation Group (optional):</td>
  814. <td><input type="text" id="subber" name="subber" size="60" value="<?=display_str($Torrent['Subber']) ?>" /></td>
  815. </tr>
  816. <tr>
  817. <td class="label">Censored?:</td>
  818. <td>
  819. <input type="checkbox" name="censored" value="censored" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?> />
  820. </td>
  821. </tr>
  822. <!--<tr>
  823. <td class="label">Release Group (optional):</td>
  824. <td><input type="text" id="release" name="release" size="60" /></td>
  825. </tr>-->
  826. <? if ($this->NewTorrent) { ?>
  827. <tr>
  828. <td class="label tooltip" title="Comma seperated list of tags">Tags:</td>
  829. <td>
  830. <?
  831. $GenreTags = G::$Cache->get_value('genre_tags');
  832. if (!$GenreTags) {
  833. $DB->query("
  834. SELECT Name
  835. FROM tags
  836. WHERE TagType = 'genre'
  837. ORDER BY Name");
  838. $GenreTags = $DB->collect('Name');
  839. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  840. }
  841. ?>
  842. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  843. <option>---</option>
  844. <? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  845. <option value="<?=$Genre?>"><?=$Genre?></option>
  846. <? } ?>
  847. </select>
  848. <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
  849. </td>
  850. </tr>
  851. <tr>
  852. <td class="label">Cover Image:</td>
  853. <td><input type="text" id="image" name="image" size="60" value="<?=display_str($Torrent['Image']) ?>"<?=$this->Disabled?> /></td>
  854. </tr>
  855. <? if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  856. <tr>
  857. <td class="label">Samples:</td>
  858. <td>
  859. <textarea rows="8" cols="60" name="screenshots" id="screenshots"><?=display_str($Torrent['Screenshots'])?></textarea>
  860. <p>Enter up to 10 links to samples for the torrent, one per line. The system will automatically remove malformed or invalid links, as well as any links after the 10th. Remember to consult the <a href="/rules.php?p=upload#h1.4">rules for adding screenshots</a>.</p>
  861. </tr>
  862. <? } ?>
  863. <tr>
  864. <td class="label">Torrent Group Description:</td>
  865. <td>
  866. <?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, !$this->DisabledFlag, !$this->DisabledFlag, false, array($this->Disabled)); ?>
  867. <p class="min_padding">Contains information such as a description of the doujin.</p>
  868. </td>
  869. </tr>
  870. <? } ?>
  871. <tr>
  872. <td class="label">Torrent Description (optional):</td>
  873. <td>
  874. <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?>
  875. <p class="min_padding">Contains information such as formatting information.</p>
  876. </td>
  877. </tr>
  878. </table>
  879. <?
  880. if ($_SERVER['SCRIPT_NAME'] === '/ajax.php')
  881. TEXTAREA_PREVIEW::JavaScript(false);
  882. }//function audiobook_form
  883. function simple_form($CategoryID) {
  884. $Torrent = $this->Torrent;
  885. ?> <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  886. <tr id="name">
  887. <? if ($this->NewTorrent) { ?>
  888. <td class="label">Title:</td>
  889. <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?> /></td>
  890. </tr>
  891. <tr id="title_rj_tr">
  892. <td class="label">Romaji Title:</td>
  893. <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
  894. </tr>
  895. <tr id="title_jp_tr">
  896. <td class="label">Japanese Title:</td>
  897. <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP'])?>" <?=$this->Disabled?>/></td>
  898. </tr>
  899. <? } ?>
  900. <tr>
  901. <td class="label">Censored?:</td>
  902. <td>
  903. <input type="checkbox" name="censored" value="1" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?>/>
  904. </td>
  905. </tr>
  906. <? if ($this->NewTorrent) { ?>
  907. <tr>
  908. <td class="label tooltip" title="Comma seperated list of tags">Tags:</td>
  909. <td>
  910. <?
  911. $GenreTags = G::$Cache->get_value('genre_tags');
  912. if (!$GenreTags) {
  913. $DB->query("
  914. SELECT Name
  915. FROM tags
  916. WHERE TagType = 'genre'
  917. ORDER BY Name");
  918. $GenreTags = $DB->collect('Name');
  919. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  920. }
  921. ?>
  922. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  923. <option>---</option>
  924. <? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  925. <option value="<?=$Genre?>"><?=$Genre?></option>
  926. <? } ?>
  927. </select>
  928. <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> /></td>
  929. </tr>
  930. <tr>
  931. <td class="label">Cover Image:</td>
  932. <td><input type="text" id="image" name="image" size="60" value="<?=display_str($Torrent['Image']) ?>"<?=$this->Disabled?> /></td>
  933. </tr>
  934. <? if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  935. <tr>
  936. <td class="label">Screenshots:</td>
  937. <td>
  938. <textarea rows="8" cols="60" name="screenshots" id="screenshots"><?=display_str($Torrent['Screenshots'])?></textarea>
  939. <p>Enter up to 10 links to screenshots for the torrent, one per line. The system will automatically remove malformed or invalid links, as well as any links after the 10th. Remember to consult the <a href="/rules.php?p=upload#h1.4">rules for adding screenshots</a>.</p>
  940. </tr>
  941. <? } ?>
  942. <tr>
  943. <td class="label">Description:</td>
  944. <td>
  945. <?php
  946. new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, !$this->DisabledFlag, !$this->DisabledFlag, false, array($this->Disabled));
  947. if ($_SERVER['SCRIPT_NAME'] === '/ajax.php')
  948. TEXTAREA_PREVIEW::JavaScript(false);
  949. ?>
  950. </td>
  951. </tr>
  952. <? } ?>
  953. </table>
  954. <? }//function simple_form
  955. function game_form($CategoryID) {
  956. $Torrent = $this->Torrent;
  957. ?> <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  958. <? if ($this->NewTorrent) { ?>
  959. <tr id="title_tr">
  960. <td class="label">English Title:</td>
  961. <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title'])?>" <?=$this->Disabled?> /></td>
  962. </tr>
  963. <tr id="title_rj_tr">
  964. <td class="label">Romaji Title:</td>
  965. <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
  966. </tr>
  967. <tr id="title_jp_tr">
  968. <td class="label">Japanese Title:</td>
  969. <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP'])?>" <?=$this->Disabled?> /></td>
  970. </tr>
  971. <tr>
  972. <td class="label">Developer:</td>
  973. <td id="idolfields">
  974. <? if (!empty($Torrent['Artists'])) {
  975. foreach ($Torrent['Artists'] as $Num => $Artist) { ?>
  976. <input type="text" id="idols_<?=$Num?>" name="idols[]" size="45" value="<?=display_str($Artist['name'])?>" <?=$this->Disabled?> />
  977. <? if ($Num == 0) { ?>
  978. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  979. <? }
  980. }
  981. } else { ?>
  982. <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?> />
  983. <a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a>
  984. <? } ?>
  985. </td>
  986. </tr>
  987. <tr>
  988. <td class="label">Circle (Optional):</td>
  989. <td><input type="text" id="series" name="series" size="60" value="<?=display_str($Torrent['Series']) ?>" <?=$this->Disabled?>/></td>
  990. </tr>
  991. <tr>
  992. <td class="label">Publisher (Optional):</td>
  993. <td><input type="text" id="studio" name="studio" size="60" value="<?=display_str($Torrent['Studio'])?>" <?=$this->Disabled?>/></td>
  994. </tr>
  995. <tr>
  996. <td class="label">Year:</td>
  997. <td><input type="text" id="year" name="year" maxlength="4" size="5" value="<?=display_str($Torrent['Year']) ?>" <?=$this->Disabled?> /></td>
  998. </tr>
  999. <tr>
  1000. <td class="label">DLsite ID:</td>
  1001. <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=display_str($Torrent['DLsiteID'])?>" <?=$this->Disabled?>/></td>
  1002. </tr>
  1003. <? } ?>
  1004. <tr>
  1005. <td class="label">Platform:</td>
  1006. <td>
  1007. <select id="platform" name="media">
  1008. <option>---</option>
  1009. <?
  1010. foreach($this->Platform as $Platform) {
  1011. echo "\t\t\t\t\t\t<option value=\"$Platform\"";
  1012. if ($Platform == $Torrent['Media']) {
  1013. echo " selected";
  1014. }
  1015. echo ">$Platform</option>\n";
  1016. }
  1017. ?>
  1018. </select>
  1019. </td>
  1020. </tr>
  1021. <tr>
  1022. <td class="label">Container:</td>
  1023. <td>
  1024. <select id="container" name="container">
  1025. <option>---</option>
  1026. <?
  1027. foreach($this->ContainersGames as $Container) {
  1028. echo "\t\t\t\t\t\t<option value=\"$Container\"";
  1029. if ($Container == $Torrent['Container']) {
  1030. echo " selected";
  1031. }
  1032. echo ">$Container</option>\n";
  1033. }
  1034. ?>
  1035. </select>
  1036. </td>
  1037. </tr>
  1038. <tr>
  1039. <td class='label'>Archive:</td>
  1040. <td>
  1041. <select name='archive'>
  1042. <option>---</option>
  1043. <?
  1044. foreach($this->Archives as $Archive) {
  1045. echo "\t\t\t\t\t\t<option value=\"$Archive\"";
  1046. if ($Archive == $Torrent['Archive']) {
  1047. echo ' selected';
  1048. }
  1049. echo ">$Archive</option>\n";
  1050. }
  1051. ?>
  1052. </select>
  1053. </td>
  1054. </tr>
  1055. <tr>
  1056. <td class="label">Language:</td>
  1057. <td>
  1058. <select name="lang">
  1059. <option>---</option>
  1060. <?
  1061. foreach($this->Languages as $Language) {
  1062. echo "\t\t\t\t\t\t<option value=\"$Language\"";
  1063. if ($Language == $Torrent['Language']) {
  1064. echo " selected";
  1065. }
  1066. echo ">$Language</option>\n";
  1067. }
  1068. ?>
  1069. </select>
  1070. </td>
  1071. </tr>
  1072. <tr>
  1073. <td class="label">Translation/Release Group (optional):</td>
  1074. <td><input type="text" id="subber" name="subber" size="60" value="<?=display_str($Torrent['Subber']) ?>" /></td>
  1075. </tr>
  1076. <tr>
  1077. <td class="label">Censored?:</td>
  1078. <td>
  1079. <input type="checkbox" name="censored" value="censored" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?> />
  1080. </td>
  1081. </tr>
  1082. <!--<tr>
  1083. <td class="label">Release Group (optional):</td>
  1084. <td><input type="text" id="release" name="release" size="60" /></td>
  1085. </tr>-->
  1086. <?
  1087. if ($this->NewTorrent) {
  1088. ?>
  1089. <tr>
  1090. <td class="label tooltip" title="Comma seperated list of tags">Tags:</td>
  1091. <td>
  1092. <?
  1093. $GenreTags = G::$Cache->get_value('genre_tags');
  1094. if (!$GenreTags) {
  1095. $DB->query("
  1096. SELECT Name
  1097. FROM tags
  1098. WHERE TagType = 'genre'
  1099. ORDER BY Name");
  1100. $GenreTags = $DB->collect('Name');
  1101. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  1102. }
  1103. ?>
  1104. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?=($this->DisabledFlag) ? ' disabled="disabled"' : ''?>>
  1105. <option>---</option>
  1106. <? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  1107. <option value="<?=$Genre?>"><?=$Genre?></option>
  1108. <? } ?>
  1109. </select>
  1110. <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
  1111. <p class="min_padding">Tags you should consider, if appropriate: <strong>visual.novel</strong>, <strong>nukige</strong></p>
  1112. </td>
  1113. </tr>
  1114. <tr>
  1115. <td class="label">Cover Image:</td>
  1116. <td><input type="text" id="image" name="image" size="60" value="<?=display_str($Torrent['Image'])?>"<?=$this->Disabled?> /></td>
  1117. </tr>
  1118. <? if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  1119. <tr>
  1120. <td class="label">Screenshots:</td>
  1121. <td>
  1122. <textarea rows="8" cols="60" name="screenshots" id="screenshots"><?=display_str($Torrent['Screenshots'])?></textarea>
  1123. <p>Enter up to 10 links to screenshots for the torrent, one per line. The system will automatically remove malformed or invalid links, as well as any links after the 10th. Remember to consult the <a href="/rules.php?p=upload#h1.4">rules for adding screenshots</a>.</p>
  1124. </tr>
  1125. <? } ?>
  1126. <tr>
  1127. <td class="label">Torrent Group Description:</td>
  1128. <td>
  1129. <?php
  1130. new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, !$this->DisabledFlag, !$this->DisabledFlag, false, array($this->Disabled));
  1131. ?>
  1132. <p class="min_padding">Contains information such as a description of the game, it's mechanics, etc.</p>
  1133. </td>
  1134. </tr>
  1135. <? } ?>
  1136. <tr>
  1137. <td class="label">Torrent Description (optional):</td>
  1138. <td>
  1139. <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?>
  1140. <p class="min_padding">Contains information such as install instructions, patching instructions, etc.</p>
  1141. </td>
  1142. </tr>
  1143. </table>
  1144. <?
  1145. if ($_SERVER['SCRIPT_NAME'] === '/ajax.php')
  1146. TEXTAREA_PREVIEW::JavaScript(false);
  1147. }
  1148. }//class
  1149. ?>