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.

torrent_form.class.php 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. <?php
  2. // This class is used in upload.php to display the upload form, and the edit
  3. // section of torrents.php to display a shortened version of the same form
  4. class TorrentForm
  5. {
  6. public $UploadForm = '';
  7. public $Categories = [];
  8. #public $Formats = [];
  9. #public $Bitrates = [];
  10. public $Media = [];
  11. public $MediaManga = [];
  12. public $Containers = [];
  13. public $ContainersGames = [];
  14. public $ContainersProt = [];
  15. public $ContainersExtra = [];
  16. public $Codecs = [];
  17. public $Resolutions = [];
  18. #public $AudioFormats = [];
  19. #public $Subbing = [];
  20. #public $Languages = [];
  21. #public $Platform = [];
  22. public $NewTorrent = false;
  23. public $Torrent = [];
  24. public $Error = false;
  25. public $TorrentID = false;
  26. public $Disabled = '';
  27. public $DisabledFlag = false;
  28. public function __construct($Torrent = false, $Error = false, $NewTorrent = true)
  29. {
  30. $this->NewTorrent = $NewTorrent;
  31. $this->Torrent = $Torrent;
  32. $this->Error = $Error;
  33. global $UploadForm, $Categories, $Media, $MediaManga, $TorrentID, $Containers, $ContainersGames, $ContainersProt, $ContainersExtra, $Codecs, $Resolutions, $Archives;
  34. #global $UploadForm, $Categories, $Formats, $Bitrates, $Media, $MediaManga, $TorrentID, $Containers, $ContainersGames, $Codecs, $Resolutions, $AudioFormats, $Subbing, $Languages, $Platform, $Archives, $ArchivesManga;
  35. $this->UploadForm = $UploadForm;
  36. $this->Categories = $Categories;
  37. #$this->Formats = $Formats;
  38. #$this->Bitrates = $Bitrates;
  39. $this->Media = $Media;
  40. $this->MediaManga = $MediaManga;
  41. $this->Containers = $Containers;
  42. $this->ContainersGames = $ContainersGames;
  43. $this->ContainersProt = $ContainersProt;
  44. $this->ContainersExtra = $ContainersExtra;
  45. $this->Codecs = $Codecs;
  46. $this->Resolutions = $Resolutions;
  47. #$this->AudioFormats = $AudioFormats;
  48. #$this->Subbing = $Subbing;
  49. #$this->Languages = $Languages;
  50. $this->TorrentID = $TorrentID;
  51. #$this->Platform = $Platform;
  52. $this->Archives = $Archives;
  53. #$this->ArchivesManga = $ArchivesManga;
  54. if ($this->Torrent && $this->Torrent['GroupID']) {
  55. $this->Disabled = ' readonly="readonly"';
  56. $this->DisabledFlag = true;
  57. }
  58. }
  59. public function head()
  60. {
  61. G::$DB->query("
  62. SELECT COUNT(ID)
  63. FROM torrents
  64. WHERE UserID = ?", G::$LoggedUser['ID']);
  65. list($Uploads) = G::$DB->next_record(); ?>
  66. <!--
  67. Everything until the catalogue number field
  68. Server-side torrent scrubbing admonishment
  69. -->
  70. <div class="thin">
  71. <?php if ($this->NewTorrent) { ?>
  72. <p style="text-align: center;">
  73. If you would like to use your own torrent file, add the following to it.
  74. Otherwise, add none of it and redownload the torrent file after uploading it.
  75. All of the above data will be added to it by the site.
  76. <strong>If you never have before, be sure to read this list of
  77. <a href="wiki.php?action=article&name=uploadingpitfalls">uploading pitfalls</a>.</strong>
  78. </p>
  79. <!--
  80. Announce URLs displayed on the form
  81. They're added to torrents in classes/torrentsdl.class.php
  82. BioTorrents.de Gazelle supports tiered swarms, T1 private and T2 public
  83. -->
  84. <p style="text-align: center;">
  85. <?php
  86. $Announces = ANNOUNCE_URLS[0];
  87. #$Announces = call_user_func_array('array_merge', ANNOUNCE_URLS);
  88. foreach ($Announces as $Announce) {
  89. # Loop through tracker URLs
  90. ?>
  91. <strong>Announce</strong>
  92. <input type="text"
  93. value="<?= $Announce . '/' . G::$LoggedUser['torrent_pass'] . '/announce' ?>"
  94. size="74" onclick="this.select();" readonly="readonly" /> <br />
  95. <?php
  96. }
  97. ?>
  98. <!-- Source -->
  99. <strong>Source</strong>
  100. <input type="text" value="<?= Users::get_upload_sources()[0] ?>"
  101. size="20" onclick="this.select();" readonly="readonly" />
  102. </p>
  103. <!-- Error display -->
  104. <p style="text-align: center;">
  105. <?php
  106. }
  107. if ($this->Error) {
  108. echo "\t".'<p style="color: red; text-align: center;">' . $this->Error . "</p>\n";
  109. } ?>
  110. </p>
  111. <!-- Torrent form hidden values -->
  112. <form class="create_form box pad" name="torrent" action="" enctype="multipart/form-data" method="post"
  113. onsubmit="$('#post').raw().disabled = 'disabled';">
  114. <div>
  115. <input type="hidden" name="submit" value="true" />
  116. <input type="hidden" name="auth"
  117. value="<?=G::$LoggedUser['AuthKey']?>" />
  118. <?php if (!$this->NewTorrent) { ?>
  119. <input type="hidden" name="action" value="takeedit" />
  120. <input type="hidden" name="torrentid"
  121. value="<?=display_str($this->TorrentID)?>" />
  122. <input type="hidden" name="type"
  123. value="<?=display_str($this->Torrent['CategoryID']-1)?>" />
  124. <?php
  125. } else {
  126. if ($this->Torrent && $this->Torrent['GroupID']) {
  127. # Find groups and requests
  128. ?>
  129. <input type="hidden" name="groupid"
  130. value="<?= display_str($this->Torrent['GroupID']) ?>" />
  131. <input type="hidden" name="type"
  132. value="<?= display_str($this->Torrent['CategoryID']-1) ?>" />
  133. <?php
  134. }
  135. if ($this->Torrent && ($this->Torrent['RequestID'] ?? false)) {
  136. ?>
  137. <input type="hidden" name="requestid"
  138. value="<?=display_str($this->Torrent['RequestID'])?>" />
  139. <?php
  140. }
  141. } ?>
  142. </div>
  143. <!-- New torrent options: file and category -->
  144. <?php if ($this->NewTorrent) { ?>
  145. <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
  146. <tr>
  147. <td class="label">
  148. Torrent File
  149. <strong class="important_text">*</strong>
  150. </td>
  151. <td><input id="file" type="file" name="file_input" size="50" /><br />
  152. Use the above announce URL and set the private flag in your BitTorrent client, e.g.,
  153. <code>mktorrent -p -a &lt;announce&gt; &lt;target folder&gt;</code>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td class="label">
  158. Category
  159. <strong class="important_text">*</strong>
  160. </td>
  161. <td>
  162. <select id="categories" name="type" onchange="Categories()" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
  163. <?php
  164. foreach (Misc::display_array($this->Categories) as $Index => $Cat) {
  165. echo "\t\t\t\t\t\t<option value=\"$Index\"";
  166. if ($Cat === $this->Torrent['CategoryName']) {
  167. echo ' selected="selected"';
  168. }
  169. echo ">$Cat</option>\n";
  170. }
  171. ?>
  172. </select><br />
  173. What alphabet the sequence uses, unless it's images or supplemental data
  174. </td>
  175. </tr>
  176. </table>
  177. <!-- Start the dynamic form -->
  178. <?php } # if?>
  179. <div id="dynamic_form">
  180. <?php
  181. }
  182. # Make the endmatter
  183. public function foot()
  184. {
  185. $Torrent = $this->Torrent; ?>
  186. </div>
  187. <!-- Freeleech type -->
  188. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  189. <?php
  190. if (!$this->NewTorrent) {
  191. if (check_perms('torrents_freeleech')) {
  192. ?>
  193. <tr id="freetorrent">
  194. <td class="label">Freeleech</td>
  195. <td>
  196. <select name="freeleech">
  197. <?php
  198. $FL = array("Normal", "Free", "Neutral");
  199. foreach ($FL as $Key => $Name) {
  200. # Cycle types
  201. ?>
  202. <option value="<?= $Key ?>" <?= ($Key === $Torrent['FreeTorrent'] ? ' selected="selected"' : '') ?>><?= $Name ?>
  203. </option>
  204. <?php
  205. } ?>
  206. </select>
  207. because
  208. <select name="freeleechtype">
  209. <?php
  210. $FL = array("N/A", "Staff Pick", "Perma-FL", "Freeleechizer", "Site-Wide FL");
  211. foreach ($FL as $Key => $Name) {
  212. # Cycle reasons
  213. ?>
  214. <option value="<?=$Key?>" <?= ($Key === $Torrent['FreeLeechType'] ? ' selected="selected"' : '') ?>><?= $Name ?>
  215. </option>
  216. <?php
  217. } ?>
  218. </select>
  219. </td>
  220. </tr>
  221. <?php
  222. }
  223. } ?>
  224. <!-- Rules notice and submit button -->
  225. <tr>
  226. <td colspan="2" style="text-align: center;">
  227. <p>
  228. Be sure that your torrent is approved by the <a href="rules.php?p=upload" target="_blank">rules</a>.
  229. Not doing this will result in a <strong class="important_text">warning</strong> or <strong
  230. class="important_text">worse</strong>.
  231. </p>
  232. <?php if ($this->NewTorrent) { ?>
  233. <p>
  234. After uploading the torrent, you will have a one hour grace period during which no one other than you can
  235. fill requests with this torrent.
  236. Make use of this time wisely, and <a href="requests.php">search the list of requests</a>.
  237. </p>
  238. <?php } ?>
  239. <input id="post" type="submit" <?php
  240. if ($this->NewTorrent) {
  241. echo ' value="Upload"';
  242. } else {
  243. echo ' value="Edit"';
  244. } ?>
  245. />
  246. </td>
  247. </tr>
  248. </table>
  249. </form>
  250. </div>
  251. <?php
  252. } # End
  253. # Okay, finally the real form
  254. public function upload_form()
  255. {
  256. $QueryID = G::$DB->get_query_id();
  257. $this->head();
  258. $Torrent = $this->Torrent; ?>
  259. <!-- Catalogue number autofill -->
  260. <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
  261. <?php if ($this->NewTorrent) { ?>
  262. <tr id="javdb_tr">
  263. <td class="label tooltip" title="">Accession Number</td>
  264. <td>
  265. <input type="text" id="catalogue" name="catalogue" size="10"
  266. value="<?= display_str($Torrent['CatalogueNumber']) ?>"
  267. <?= $this->Disabled ?>/>
  268. <?php if (!$this->DisabledFlag) { ?>
  269. <input type="button" autofill="jav" value="Autofill" style="pointer-events: none; opacity: 0.5;">
  270. </input><br />
  271. <!-- Autofill only supports RefSeq and UniProt; -->
  272. Enter any ID number that corresponds to the data,
  273. preferring RefSeq and UniProt
  274. <?php } ?>
  275. </td>
  276. </tr>
  277. <!-- Autofill 2 -->
  278. <tr id="anidb_tr" class="hidden">
  279. <td class="label">AniDB Autofill (optional)</td>
  280. <td>
  281. <input type="text" id="anidb" size="10" <?= $this->Disabled ?>/>
  282. <?php if (!$this->DisabledFlag) { ?>
  283. <input type="button" autofill="anime" value="Autofill" />
  284. <?php } ?>
  285. </td>
  286. </tr>
  287. <!-- Autofill 3 -->
  288. <tr id="ehentai_tr" class="hidden">
  289. <td class="label">e-hentai URL (optional)</td>
  290. <td>
  291. <input type="text" id="catalogue" size="50" <?= $this->Disabled ?> />
  292. <?php if (!$this->DisabledFlag) { ?>
  293. <input type="button" autofill="douj" value="Autofill" />
  294. <?php } ?>
  295. </td>
  296. </tr>
  297. <!-- Semantic Versioning -->
  298. <tr id="audio_tr">
  299. <td class="label">Version</td>
  300. <td>
  301. <input type="text" id="audioformat" name="audioformat" size="10" pattern="\d+\.\d+\.\d+"
  302. value="<?= display_str($Torrent['AudioFormat']) ?>"
  303. <?= $this->Disabled ?>/><br />
  304. Please see <a href="https://semver.org target=" _blank">Semantic Versioning</a>; start with 0.1.0
  305. </td>
  306. </tr>
  307. <!-- Three title fields -->
  308. <tr id="title_tr">
  309. <td class="label">
  310. Torrent Title
  311. <strong class="important_text">*</strong>
  312. </td>
  313. <td>
  314. <input type="text" id="title" name="title" size="60"
  315. value="<?= display_str($Torrent['Title']) ?>"
  316. <?= $this->Disabled ?>/><br />
  317. Definition line, e.g., Alcohol dehydrogenase ADH1
  318. </td>
  319. </tr>
  320. <!-- 2 -->
  321. <tr id="title_rj_tr">
  322. <td class="label" title="">Organism</td>
  323. <td>
  324. <input type="text" id="title_rj" name="title_rj" size="60"
  325. value="<?= display_str($Torrent['TitleRJ']) ?>"
  326. <?= $this->Disabled ?>/><br />
  327. Organism line binomial, e.g., <em>Saccharomyces cerevisiae</em>
  328. </td>
  329. </tr>
  330. <!-- 3 -->
  331. <tr id="title_jp_tr">
  332. <td class="label">Strain/Variety</td>
  333. <td>
  334. <input type="text" id="title_jp" name="title_jp" size="60"
  335. value="<?= display_str($Torrent['TitleJP']) ?>"
  336. <?= $this->Disabled ?>/><br />
  337. Organism line if any, e.g., S288C
  338. </td>
  339. </tr>
  340. <!-- Multiple artists -->
  341. <tr id="idols_tr">
  342. <td class="label">
  343. Authors(s)
  344. <strong class="important_text">*</strong>
  345. </td>
  346. <td id="idolfields">
  347. One per field, e.g., Robert K. Mortimer [+] David Schild<br />
  348. <?php
  349. if (!empty($Torrent['Artists'])) {
  350. foreach ($Torrent['Artists'] as $Num => $Artist) {
  351. ?>
  352. <input type="text" id="idols_<?=$Num?>" name="idols[]"
  353. size="45"
  354. value="<?=display_str($Artist['name'])?>"
  355. <?=$this->Disabled?><?php Users::has_autocomplete_enabled('other'); ?>/>
  356. <?php if ($Num === 0) { ?>
  357. <a class="add_artist_button brackets">+</a>
  358. <a class="remove_artist_button brackets">&minus;</a>
  359. <?php
  360. }
  361. }
  362. } else {
  363. ?>
  364. <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?><?php Users::has_autocomplete_enabled('other'); ?>/>
  365. <a class="add_artist_button brackets">+</a>
  366. <a class="remove_artist_button brackets">&minus;</a>
  367. <?php
  368. } ?>
  369. </td>
  370. </tr>
  371. <!-- Production studio -->
  372. <tr id="studio_tr">
  373. <td class="label">
  374. Department/Lab
  375. <strong class="important_text">*</strong>
  376. </td>
  377. <td>
  378. <input type="text" id="studio" name="studio" size="60"
  379. value="<?= display_str($Torrent['Studio']) ?>"
  380. <?= $this->Disabled ?>/><br />
  381. Last author's institution, e.g., Lawrence Berkeley Laboratory
  382. </td>
  383. </tr>
  384. <!-- Location -->
  385. <tr id="series_tr">
  386. <td class="label">Location</td>
  387. <td>
  388. <input type="text" id="series" name="series" size="60"
  389. value="<?= display_str($Torrent['Series']) ?>"
  390. <?= $this->Disabled ?>/><br />
  391. Physical location, e.g., Berkeley, CA 94720
  392. </td>
  393. </tr>
  394. <!-- Year -->
  395. <tr id="year_tr">
  396. <td class="label">
  397. Year
  398. <strong class="important_text">*</strong>
  399. </td>
  400. <td>
  401. <input type="text" id="year" name="year" maxlength="4" size="5"
  402. value="<?= display_str($Torrent['Year']) ?>"
  403. <?= $this->Disabled ?>/><br />
  404. Original publication year
  405. </td>
  406. </tr>
  407. <?php } # Ends if NewTorrent line 256?>
  408. <!-- Encoding -->
  409. <tr id="codec_tr">
  410. <td class="label">
  411. License
  412. <strong class="important_text">*</strong>
  413. </td>
  414. <td>
  415. <select name="codec">
  416. <option>---</option>
  417. <?php
  418. foreach ($this->Codecs as $Codec) {
  419. echo "\t\t\t\t\t\t<option value=\"$Codec\"";
  420. if ($Codec === ($Torrent['Codec'] ?? false)) {
  421. echo " selected";
  422. }
  423. echo ">$Codec</option>\n";
  424. } ?>
  425. </select><br />
  426. Please see <a href="http://www.dcc.ac.uk/resources/how-guides/license-research-data" target="_blank">How to
  427. License Research Data</a>
  428. </td>
  429. </tr>
  430. <!-- Media type -->
  431. <tr id="media_tr">
  432. <td class="label">
  433. Platform
  434. <strong class="important_text">*</strong>
  435. </td>
  436. <td>
  437. <select name="media">
  438. <option value="">---</option>
  439. <?php
  440. foreach ($this->Media as $Media) {
  441. echo "\t\t\t\t\t\t<option value=\"$Media\"";
  442. if ($Media == ($Torrent['Media'] ?? false)) {
  443. echo " selected";
  444. }
  445. echo ">$Media</option>\n";
  446. } ?>
  447. </select><br />
  448. The class of technology used
  449. </td>
  450. </tr>
  451. <!-- Alternate media -->
  452. <tr id="media_manga_tr">
  453. <td class="label">
  454. Platform
  455. <strong class="important_text">*</strong>
  456. </td>
  457. <td>
  458. <select name="media">
  459. <option>---</option>
  460. <?php
  461. foreach ($this->MediaManga as $Media) {
  462. echo "\t\t\t\t\t\t<option value=\"$Media\"";
  463. if ($Media === ($Torrent['Media'] ?? false)) {
  464. echo " selected";
  465. }
  466. echo ">$Media</option>\n";
  467. } ?>
  468. </select><br />
  469. The class of technology used
  470. </td>
  471. </tr>
  472. <!-- Multiple container fields -->
  473. <tr id="container_tr">
  474. <td class="label">
  475. Format
  476. <strong class="important_text">*</strong>
  477. </td>
  478. <td>
  479. <select name="container">
  480. <option value="Autofill">Autofill</option>
  481. <?php
  482. foreach ($this->Containers as $Name => $Container) {
  483. echo "<option value='$Name'>$Name</option>\n";
  484. } ?>
  485. </select><br />
  486. Data file format, or detect from file list
  487. </td>
  488. </tr>
  489. <!-- 2 -->
  490. <tr id="container_games_tr">
  491. <td class="label">
  492. Format
  493. <strong class="important_text">*</strong>
  494. </td>
  495. <td>
  496. <select id="container" name="container">
  497. <option value="Autofill">Autofill</option>
  498. <?php
  499. foreach ($this->ContainersGames as $Name => $Container) {
  500. echo "<option value='$Name'>$Name</option>\n";
  501. } ?>
  502. </select><br />
  503. Data file format, or detect from file list
  504. </td>
  505. </tr>
  506. <!-- 3 -->
  507. <tr id="container_prot_tr">
  508. <td class="label">
  509. Format
  510. <strong class="important_text">*</strong>
  511. </td>
  512. <td>
  513. <select id="container" name="container">
  514. <option value="Autofill">Autofill</option>
  515. <?php
  516. foreach ($this->ContainersProt as $Name => $Container) {
  517. echo "<option value='$Name'>$Name</option>\n";
  518. } ?>
  519. </select><br />
  520. Data file format, or detect from file list
  521. </td>
  522. </tr>
  523. <!-- 4 -->
  524. <tr id="container_extra_tr">
  525. <td class="label">
  526. Format
  527. <strong class="important_text">*</strong>
  528. </td>
  529. <td>
  530. <select id="container" name="container">
  531. <option value="Autofill">Autofill</option>
  532. <?php
  533. foreach ($this->ContainersExtra as $Name => $Container) {
  534. echo "<option value='$Name'>$Name</option>\n";
  535. } ?>
  536. </select><br />
  537. Data file format, or detect from file list
  538. </td>
  539. </tr>
  540. <!-- Compression -->
  541. <tr id="archive_tr">
  542. <td class="label">
  543. Archive
  544. <strong class="important_text">*</strong>
  545. </td>
  546. <td>
  547. <select name='archive'>
  548. <option value="Autofill">Autofill</option>
  549. <?php
  550. foreach ($this->Archives as $Name => $Archive) {
  551. echo "\t\t\t\t\t\t<option value=\"$Name\"";
  552. if ($Archive === ($Torrent['Archive'] ?? false)) {
  553. echo ' selected';
  554. }
  555. echo ">$Name</option>\n";
  556. } ?>
  557. </select><br />
  558. Compression algorithm, or detect from file list
  559. </td>
  560. </tr>
  561. <!-- Resolution -->
  562. <tr id="resolution_tr">
  563. <td class="label">
  564. Assembly Level
  565. <strong class="important_text">*</strong>
  566. </td>
  567. <td>
  568. <select id="ressel" name="ressel" onchange="SetResolution()">
  569. <option value="">---</option>
  570. <?php
  571. foreach ($this->Resolutions as $Res) {
  572. echo "\t\t\t\t\t\t<option value=\"$Res\"";
  573. if ($Res === ($Torrent['Resolution'] ?? false)
  574. || (!isset($FoundRes) && ($Torrent['Resolution'] ?? false)
  575. && $Res === 'Other')) {
  576. echo " selected";
  577. $FoundRes = true;
  578. }
  579. echo ">$Res</option>\n";
  580. } ?>
  581. </select>
  582. <input type="text" id="resolution" name="resolution" size="10" class="hidden"
  583. value="<?= ($Torrent['Resolution']??'') ?>"
  584. readonly>
  585. </input>
  586. <script>
  587. if ($('#ressel').raw().value === 'Other') {
  588. $('#resolution').raw().readOnly = false
  589. $('#resolution').gshow()
  590. }
  591. </script><br />
  592. How complete the data is, specifically or conceptually
  593. </td>
  594. </tr>
  595. <!-- Tags -->
  596. <?php if ($this->NewTorrent) { ?>
  597. <tr id="tags_tr">
  598. <td class="label">
  599. Tags
  600. <strong class="important_text">*</strong>
  601. </td>
  602. <td>
  603. <?php
  604. $GenreTags = G::$Cache->get_value('genre_tags');
  605. if (!$GenreTags) {
  606. $DB->query("
  607. SELECT Name
  608. FROM tags
  609. WHERE TagType = 'genre'
  610. ORDER BY Name");
  611. $GenreTags = $DB->collect('Name');
  612. G::$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
  613. }
  614. ?>
  615. <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
  616. <option>---</option>
  617. <?php foreach (Misc::display_array($GenreTags) as $Genre) { ?>
  618. <option value="<?= $Genre ?>"><?= $Genre ?>
  619. </option>
  620. <?php } ?>
  621. </select>
  622. <input type="text" id="tags" name="tags" size="60"
  623. value="<?= display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"
  624. <?php Users::has_autocomplete_enabled('other'); ?>
  625. /><br />
  626. Comma-seperated list of at least 5 tags
  627. </td>
  628. </tr>
  629. <!-- Picture -->
  630. <tr id="cover_tr">
  631. <td class="label">Picture</td>
  632. <td>
  633. <input type="text" id="image" name="image" size="60"
  634. value="<?= display_str($Torrent['Image']) ?>"
  635. <?= $this->Disabled ?> /><br />
  636. A meaningful picture, e.g., the specimen or a thumbnail
  637. </td>
  638. </tr>
  639. <!-- FTP/HTTP mirrors -->
  640. <?php if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  641. <tr id="mirrors_tr">
  642. <td class="label">Mirrors</td>
  643. <td>
  644. <textarea rows="1" cols="60" name="mirrors"
  645. id="mirrors"><?= display_str($Torrent['Mirrors'])?></textarea>
  646. <strong class="important_text">Experimental.</strong>
  647. Up to two FTP/HTTP addresses that either point directly to a file, or for multi-file torrents, to the enclosing
  648. folder
  649. </tr>
  650. <?php } ?>
  651. <!-- Sample pictures/links -->
  652. <?php if (!$this->DisabledFlag && $this->NewTorrent) { ?>
  653. <tr id="screenshots_tr">
  654. <td class="label">Publications</td>
  655. <td>
  656. <textarea rows="8" cols="60" name="screenshots"
  657. id="screenshots"><?= display_str($Torrent['Screenshots'])?></textarea>
  658. Up to ten DOI numbers, one per line
  659. </tr>
  660. <?php } ?>
  661. <!-- Album description -->
  662. <tr id="group_desc_tr">
  663. <td class="label">
  664. Torrent Group Description
  665. <strong class="important_text">*</strong>
  666. </td>
  667. <td>
  668. <?php
  669. new TEXTAREA_PREVIEW(
  670. 'album_desc',
  671. 'album_desc',
  672. display_str($Torrent['GroupDescription']),
  673. 60,
  674. 8,
  675. !$this->DisabledFlag,
  676. !$this->DisabledFlag,
  677. false,
  678. array($this->Disabled)
  679. );
  680. ?><br />
  681. General info about the torrent subject's function or significance
  682. </td>
  683. </tr>
  684. <?php } # Ends if NewTorrent line 646?>
  685. <!-- Torrent description -->
  686. <tr id="release_desc_tr">
  687. <td class="label">Torrent Description</td>
  688. <td>
  689. <?php
  690. new TEXTAREA_PREVIEW(
  691. 'release_desc',
  692. 'release_desc',
  693. display_str($Torrent['TorrentDescription'] ?? ''),
  694. 60,
  695. ); ?><br />
  696. Specific info about the protocols and equipment used to produce the data
  697. </td>
  698. </tr>
  699. <!-- Boolean options -->
  700. <tr id="censored_tr">
  701. <td class="label">Aligned/Annotated</td>
  702. <td>
  703. <input type="checkbox" name="censored" value="1" <?= (($Torrent['Censored'] ?? 0) ? 'checked ' : '') ?>/>
  704. Whether the torrent contains alignments, annotations, or other structural metadata
  705. </td>
  706. </tr>
  707. <tr id="anon_tr">
  708. <td class="label">Upload Anonymously</td>
  709. <td>
  710. <input type="checkbox" name="anonymous" value="1" <?= (($Torrent['Anonymous'] ?? false) ? 'checked ' : '') ?>/>
  711. Hide your username from other users on the torrent details page
  712. </td>
  713. </tr>
  714. </table>
  715. <?php
  716. # Phew
  717. $this->foot();
  718. G::$DB->set_query_id($QueryID);
  719. }
  720. }