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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?
  2. if (!empty($_GET['collageid']) && is_number($_GET['collageid'])) {
  3. $CollageID = $_GET['collageid'];
  4. }
  5. if (!is_number($CollageID)) {
  6. error(0);
  7. }
  8. $DB->query("
  9. SELECT Name, Description, TagList, UserID, CategoryID, Locked, MaxGroups, MaxGroupsPerUser, Featured
  10. FROM collages
  11. WHERE ID = '$CollageID'");
  12. list($Name, $Description, $TagList, $UserID, $CategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Featured) = $DB->next_record();
  13. $TagList = implode(', ', explode(' ', $TagList));
  14. if ($CategoryID == 0 && $UserID != $LoggedUser['ID'] && !check_perms('site_collages_delete')) {
  15. error(403);
  16. }
  17. View::show_header('Edit collection');
  18. if (!empty($Err)) {
  19. if (isset($ErrNoEscape)) {
  20. echo '<div class="save_message error">'.$Err.'</div>';
  21. } else {
  22. echo '<div class="save_message error">'.display_str($Err).'</div>';
  23. }
  24. }
  25. ?>
  26. <div class="thin">
  27. <div class="header">
  28. <h2>Edit collection <a href="collages.php?id=<?=$CollageID?>"><?=$Name?></a></h2>
  29. </div>
  30. <div class="box pad">
  31. <form class="edit_form" name="collage" action="collages.php" method="post">
  32. <input type="hidden" name="action" value="edit_handle" />
  33. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  34. <input type="hidden" name="collageid" value="<?=$CollageID?>" />
  35. <table id="edit_collage" class="layout">
  36. <? if (check_perms('site_collages_delete') || ($CategoryID == 0 && $UserID == $LoggedUser['ID'] && check_perms('site_collages_renamepersonal'))) { ?>
  37. <tr>
  38. <td class="label">Name</td>
  39. <td><input type="text" name="name" size="60" value="<?=$Name?>" /></td>
  40. </tr>
  41. <?
  42. }
  43. if ($CategoryID > 0 || check_perms('site_collages_delete')) { ?>
  44. <tr>
  45. <td class="label"><strong>Category</strong></td>
  46. <td>
  47. <select name="category">
  48. <?
  49. foreach ($CollageCats as $CatID => $CatName) {
  50. if (!check_perms('site_collages_delete') && $CatID == 0) {
  51. // Only mod-type get to make things personal
  52. continue;
  53. }
  54. ?>
  55. <option value="<?=$CatID?>"<?=$CatID == $CategoryID ? ' selected="selected"' : ''?>><?=$CatName?></option>
  56. <? } ?>
  57. </select>
  58. </td>
  59. </tr>
  60. <? } ?>
  61. <tr>
  62. <td class="label">Description</td>
  63. <td>
  64. <textarea name="description" id="description" cols="60" rows="10"><?=$Description?></textarea>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td class="label">Tags</td>
  69. <td><input type="text" name="tags" size="60" value="<?=$TagList?>" /></td>
  70. </tr>
  71. <? if ($CategoryID == 0) { // CategoryID == 0 is for "personal" collages ?>
  72. <tr>
  73. <td class="label"><span class="tooltip" title="A &quot;featured&quot; personal collage will be listed first on your profile, along with a preview of the included torrents.">Featured</span></td>
  74. <td><input type="checkbox" name="featured"<?=($Featured ? ' checked="checked"' : '')?> /></td>
  75. </tr>
  76. <?
  77. }
  78. if (check_perms('site_collages_delete')) { ?>
  79. <tr>
  80. <td class="label">Locked</td>
  81. <td><input type="checkbox" name="locked" <?=$Locked ? 'checked="checked" ' : ''?>/></td>
  82. </tr>
  83. <tr>
  84. <td class="label">Max groups</td>
  85. <td><input type="text" name="maxgroups" size="5" value="<?=$MaxGroups?>" /></td>
  86. </tr>
  87. <tr>
  88. <td class="label">Max groups per user</td>
  89. <td><input type="text" name="maxgroupsperuser" size="5" value="<?=$MaxGroupsPerUser?>" /></td>
  90. </tr>
  91. <? } ?>
  92. <tr>
  93. <td colspan="2" class="center"><input type="submit" value="Edit collection" /></td>
  94. </tr>
  95. </table>
  96. </form>
  97. </div>
  98. </div>
  99. <? View::show_footer(); ?>