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.

new.php 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. #declare(strict_types = 1);
  3. View::show_header(
  4. 'Create a collection',
  5. 'vendor/easymde.min',
  6. 'vendor/easymde.min'
  7. );
  8. if (!check_perms('site_collages_renamepersonal')) {
  9. $ChangeJS = " onchange=\"if ( this.options[this.selectedIndex].value == '0') { $('#namebox').ghide(); $('#personal').gshow(); } else { $('#namebox').gshow(); $('#personal').ghide(); }\"";
  10. }
  11. if (!check_perms('site_collages_renamepersonal') && $Category === '0') {
  12. $NoName = true;
  13. }
  14. ?>
  15. <div>
  16. <?php
  17. if (isset($Err)) { ?>
  18. <div class="save_message error"><?=$Err?>
  19. </div>
  20. <br />
  21. <?php
  22. } ?>
  23. <div class="box pad">
  24. <form class="create_form" name="collage" action="collages.php" method="post">
  25. <input type="hidden" name="action" value="new_handle" />
  26. <input type="hidden" name="auth"
  27. value="<?=$LoggedUser['AuthKey']?>" />
  28. <table class="layout">
  29. <tr id="collagename">
  30. <td class="label"></td>
  31. <td>
  32. <input type="text" <?=$NoName ? ' class="hidden"' : ''; ?>
  33. name="name" size="60" id="namebox"
  34. placeholder="Collection title"
  35. value="<?=display_str($Name)?>" />
  36. <span id="personal" <?=$NoName ? '' : ' class="hidden"'; ?>
  37. style="font-style: oblique;">
  38. <strong>
  39. <?=$LoggedUser['Username']?>'s
  40. personal collection
  41. </strong>
  42. </span>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="label">
  47. <strong>Category</strong>
  48. </td>
  49. <td>
  50. <select name="category" <?=$ChangeJS?>>
  51. <?php
  52. array_shift($CollageCats);
  53. foreach ($CollageCats as $CatID => $CatName) { ?>
  54. <option value="<?=$CatID + 1 ?>" <?=(($CatID + 1 === $Category) ? ' selected="selected"' : '')?>><?=$CatName?>
  55. </option>
  56. <?php
  57. }
  58. $DB->query("
  59. SELECT COUNT(ID)
  60. FROM collages
  61. WHERE UserID = '$LoggedUser[ID]'
  62. AND CategoryID = '0'
  63. AND Deleted = '0'");
  64. list($CollageCount) = $DB->next_record();
  65. if (($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
  66. <option value="0" <?=(($Category === '0') ? ' selected="selected"' : '')?>>Personal
  67. </option>
  68. <?php
  69. } ?>
  70. </select>
  71. <br />
  72. <ul>
  73. <li>
  74. <strong>Theme</strong>
  75. &ndash;
  76. A collection containing releases that all relate to a certain theme.
  77. </li>
  78. <li>
  79. <strong>Staff Picks</strong>
  80. &ndash;
  81. A listing of recommendations picked by the staff on special occasions.
  82. </li>
  83. <?php
  84. if (($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
  85. <li>
  86. <strong>Personal</strong>
  87. &ndash;
  88. You can put whatever you want here.
  89. It is your own personal collection.
  90. </li>
  91. <?php } ?>
  92. </ul>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td class="label"></td>
  97. <td>
  98. <?php
  99. new TEXTAREA_PREVIEW(
  100. $Name = 'description',
  101. $ID = 'description',
  102. $Value = display_str($Description) ?? '',
  103. $Placeholder = "Detailed description of the collection's purpose"
  104. ); ?>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td class="label"></td>
  109. <td>
  110. <input type="text" id="tags" name="tags" size="60" placeholder="Tags (comma-separated)"
  111. value="<?=display_str($Tags)?>" />
  112. </td>
  113. </tr>
  114. <tr>
  115. <td colspan="2" class="center">
  116. <strong>
  117. Please ensure your collection will be allowed under the
  118. <a href="rules.php?p=collages">Collection Rules</a>.
  119. </strong>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td colspan="2" class="center">
  124. <input type="submit" class="button-primary" value="Create" />
  125. </td>
  126. </tr>
  127. </table>
  128. </form>
  129. </div>
  130. </div>
  131. <?php View::show_footer();