Browse Source

Update torrent group edit form

pjc 5 years ago
parent
commit
59a8eb2e59
1 changed files with 118 additions and 119 deletions
  1. 118
    119
      sections/torrents/editgroup.php

+ 118
- 119
sections/torrents/editgroup.php View File

@@ -1,4 +1,5 @@
1
-<?
1
+<?php
2
+
2 3
 /************************************************************************
3 4
 ||------------|| Edit torrent group wiki page ||-----------------------||
4 5
 
@@ -15,7 +16,7 @@ the cache for the torrent group page.
15 16
 
16 17
 $GroupID = $_GET['groupid'];
17 18
 if (!is_number($GroupID) || !$GroupID) {
18
-  error(0);
19
+    error(0);
19 20
 }
20 21
 
21 22
 // Get the torrent group name and the body of the last revision
@@ -40,7 +41,7 @@ $DB->query("
40 41
     LEFT JOIN wiki_torrents AS wt ON wt.RevisionID = tg.RevisionID
41 42
   WHERE tg.ID = '".db_string($GroupID)."'");
42 43
 if (!$DB->has_results()) {
43
-  error(404);
44
+    error(404);
44 45
 }
45 46
 list($Name, $NameRJ, $NameJP, $Image, $Body, $WikiImage, $WikiBody, $Year, $Studio, $Series, $DLsiteID, $CatalogueNumber, $Pages, $CategoryID, $DLsiteID) = $DB->next_record();
46 47
 
@@ -51,17 +52,17 @@ $DB->query("
51 52
   WHERE GroupID = '".db_string($GroupID)."'");
52 53
 
53 54
 if ($DB->has_results()) {
54
-  $Screenshots = [];
55
-  while ($S = $DB->next_record(MYSQLI_ASSOC, true)) {
56
-    $Screenshots[] = $S;
57
-  }
55
+    $Screenshots = [];
56
+    while ($S = $DB->next_record(MYSQLI_ASSOC, true)) {
57
+        $Screenshots[] = $S;
58
+    }
58 59
 }
59 60
 
60 61
 $Artists = Artists::get_artists(array($GroupID))[$GroupID];
61 62
 
62 63
 if (!$Body) {
63
-  $Body = $WikiBody;
64
-  $Image = $WikiImage;
64
+    $Body = $WikiBody;
65
+    $Image = $WikiImage;
65 66
 }
66 67
 
67 68
 View::show_header('Edit torrent group', 'upload,bbcode');
@@ -76,13 +77,16 @@ View::show_header('Edit torrent group', 'upload,bbcode');
76 77
     <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
77 78
       <div>
78 79
         <input type="hidden" name="action" value="takegroupedit" />
79
-        <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
80
+        <input type="hidden" name="auth"
81
+          value="<?=$LoggedUser['AuthKey']?>" />
80 82
         <input type="hidden" name="groupid" value="<?=$GroupID?>" />
81
-        <h3>Image:</h3>
82
-        <input type="text" name="image" size="92" value="<?=$Image?>" /><br />
83
-        <h3>Torrent group description:</h3>
84
-        <textarea class="bbcode_editor" name="body" cols="91" rows="20"><?=$Body?></textarea><br />
85
-<?
83
+        <h3>Picture</h3>
84
+        <input type="text" name="image" size="92"
85
+          value="<?=$Image?>" /><br /><br />
86
+        <h3>Torrent Group Descriptions</h3>
87
+        <textarea class="bbcode_editor" name="body" cols="91"
88
+          rows="20"><?=$Body?></textarea><br /><br />
89
+        <?php
86 90
   $DB->query("
87 91
     SELECT UserID
88 92
     FROM torrents
@@ -90,7 +94,7 @@ View::show_header('Edit torrent group', 'upload,bbcode');
90 94
 
91 95
   $Contributed = in_array($LoggedUser['ID'], $DB->collect('UserID'));
92 96
 ?>
93
-        <h3>Edit summary:</h3>
97
+        <h3>Edit Summary</h3>
94 98
         <input type="text" name="summary" size="92" /><br />
95 99
         <div style="text-align: center;">
96 100
           <input type="submit" value="Submit" />
@@ -98,46 +102,61 @@ View::show_header('Edit torrent group', 'upload,bbcode');
98 102
       </div>
99 103
     </form>
100 104
   </div>
101
-<?
105
+  <?php
102 106
   if ($Contributed || check_perms('torrents_edit') || check_perms('screenshots_delete') || check_perms('screenshots_add')) {
103
-?>
104
-  <h3 id="screenshots_section"><?=($CategoryID == 3)?'Samples':'Screenshots'?></h3>
107
+      ?>
108
+  <h3 id="screenshots_section">Publications</h3>
105 109
   <div class="box pad">
106
-    <p><strong class="important_text">Thumbs, promotional material, and preview images consisting of multiple images are not allowed as screenshots.</strong></p>
110
+    <!-- <p><strong class="important_text">Thumbs, promotional material, and preview images consisting of multiple images are not allowed as screenshots.</strong></p> -->
107 111
     <form class="edit_form" name="screenshots_form" action="torrents.php" method="post">
108 112
       <input type="hidden" name="action" value="screenshotedit" />
109
-      <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
113
+      <input type="hidden" name="auth"
114
+        value="<?=$LoggedUser['AuthKey']?>" />
110 115
       <input type="hidden" name="groupid" value="<?=$GroupID?>" />
111 116
       <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
112 117
         <tr>
113
-          <td class="label"><?=($CategoryID == 3)?'Samples':'Screenshots'?>:</td>
118
+          <td class="label">Publications</td>
114 119
           <td id="screenshots">
115
-<?
120
+            <?php
116 121
   if ($Contributed || check_perms('screenshots_add') || check_perms('torrents_edit')) {
117
-?>
118
-          <a class="float_right brackets" onclick="AddScreenshotField()">+</a>
119
-<?
122
+      ?>
123
+            <a class="float_right brackets" onclick="AddScreenshotField()">+</a>
124
+            <?php
120 125
   }
121 126
 
122
-  foreach($Screenshots as $i => $Screenshot) {
123
-    $SSURL = ImageTools::process($Screenshot['Image'], 'thumb');
124
-?>
127
+      foreach ($Screenshots as $i => $Screenshot) {
128
+          /* Image host integration
129
+          $SSURL = ImageTools::process($Screenshot['Image'], 'thumb');
130
+          */ ?>
125 131
             <div>
126
-              <input type="text" size="45" id="ss_<?=$i?>" name="screenshots[]" value="<?=$Screenshot['Image']?>"/>
127
-<?
132
+              <input type="text" size="45" id="ss_<?=$i?>"
133
+                name="screenshots[]"
134
+                value="<?=$Screenshot['Image']?>" />
135
+              <?php
128 136
   if ($Screenshot['UserID'] == $LoggedUser['ID'] || check_perms('torrents_edit') || check_perms('screenshots_delete')) {
129
-?>
137
+      ?>
130 138
               <a onclick="RemoveScreenshotField(this)" class="brackets">&minus;</a>
131
-<? } ?>
139
+              <?php
140
+  } ?>
132 141
               <br />
133
-<?            if (check_perms('users_mod')) { ?>
134
-                <img class="tooltip lightbox-init" title='<?=Users::format_username($Screenshot['UserID'], false, false, false)?> - <?=time_diff($Screenshot['Time'])?>' src="<?=$SSURL?>" />
135
-<?            } else { ?>
136
-                <img class="tooltip lightbox-init" title='Added <?=time_diff($Screenshot['Time'])?>' src="<?=$SSURL?>" />
137
-<?            } ?>
142
+              <?php if (check_perms('users_mod')) { ?>
143
+              <!--
144
+              <img class="tooltip lightbox-init"
145
+                title='<?=Users::format_username($Screenshot['UserID'], false, false, false)?>
146
+              - <?=time_diff($Screenshot['Time'])?>'
147
+              src="<?=$SSURL?>" />
148
+              -->
149
+              <?php } else { ?>
150
+              <!--
151
+              <img class="tooltip lightbox-init"
152
+                title='Added <?=time_diff($Screenshot['Time'])?>'
153
+              src="<?=$SSURL?>" />
154
+              -->
155
+              <?php } ?>
138 156
             </div>
139 157
             <br />
140
-<? } ?>
158
+            <?php
159
+      } ?>
141 160
           </td>
142 161
         </tr>
143 162
       </table>
@@ -146,19 +165,22 @@ View::show_header('Edit torrent group', 'upload,bbcode');
146 165
       </div>
147 166
     </form>
148 167
   </div>
149
-<? }
168
+  <?php
169
+  }
150 170
   //Users can edit the group info if they've uploaded a torrent to the group or have torrents_edit
151 171
   if ($Contributed || check_perms('torrents_edit')) { ?>
152 172
   <h3>Non-wiki torrent group editing</h3>
153 173
   <div class="box pad">
154 174
     <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
155 175
       <input type="hidden" name="action" value="nonwikiedit" />
156
-      <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
176
+      <input type="hidden" name="auth"
177
+        value="<?=$LoggedUser['AuthKey']?>" />
157 178
       <input type="hidden" name="groupid" value="<?=$GroupID?>" />
158 179
       <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
159
-      <tr>
160
-        <td class="label">
161
-<?
180
+        <tr>
181
+          <td class="label">Author(s)
182
+            <?php
183
+/*
162 184
 if ($CategoryID == 1) {
163 185
   echo "Idol(s):";
164 186
 } elseif ($CategoryID == 2) {
@@ -170,124 +192,99 @@ if ($CategoryID == 1) {
170 192
 } elseif ($CategoryID == 5) {
171 193
   echo "Creator/Author:";
172 194
 }
195
+*/
173 196
 ?>
174
-        </td>
175
-        <td id="idolfields">
176
-          <input type="text" id="idol_0" name="idols[]" size="45" value="<?=$Artists[0]['name']?>"/>
177
-          <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
178
-<?
197
+          </td>
198
+          <td id="idolfields">
199
+            <input type="text" id="idol_0" name="idols[]" size="45"
200
+              value="<?=$Artists[0]['name']?>" />
201
+            <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
202
+            <?php
179 203
   for ($i = 1; $i < count($Artists); $i++) {
180
-    print '<br><input type="text" id="idol_'.$i.'" name="idols[]" size="45" value="'.$Artists[$i]['name'].'"/>';
204
+      print '<br><input type="text" id="idol_'.$i.'" name="idols[]" size="45" value="'.$Artists[$i]['name'].'"/>';
181 205
   }
182
-?>
183
-        </td>
184
-      </tr>
185
-<? if ($CategoryID != 2) { ?>
186
-        <tr>
187
-          <td class="label">
188
-<? if ($CategoryID == 1) {
189
-     echo "Studio:";
190
-   } else {
191
-     echo "Publisher:";
192
-   }
193 206
 ?>
194 207
           </td>
195
-          <td><input type="text" id="studio" name="studio" size="60" value="<?=$Studio?>" /></td>
196 208
         </tr>
197
-<? }
198
-if ($CategoryID != 5) { ?>
199 209
         <tr>
200
-          <td class="label">
201
-<?
202
-  if ($CategoryID == 1) {
203
-    echo "Series:";
204
-  } else {
205
-    echo "Circle:";
206
-  }
207
-?>
208
-          </td>
209
-          <td><input type="text" id="series" name="series" size="60" value="<?=$Series?>"/></td>
210
-<? } ?>
211
-<? if ($CategoryID != 5) { ?>
212
-        <tr>
213
-          <td class="label">Year:</td>
214
-          <td>
215
-            <input type="text" name="year" size="10" value="<?=$Year?>" />
216
-          </td>
210
+          <td class="label">Department/Lab</td>
211
+          <td><input type="text" id="studio" name="studio" size="60"
212
+              value="<?=$Studio?>" /></td>
217 213
         </tr>
218
-<? } ?>
219
-<? if ($CategoryID == 3) { ?>
220 214
         <tr>
221
-          <td class="label">Pages:</td>
215
+          <td class="label">Location</td>
216
+          <td><input type="text" id="series" name="series" size="60"
217
+              value="<?=$Series?>" /></td>
218
+        <tr>
219
+          <td class="label">Year</td>
222 220
           <td>
223
-            <input type="text" name="pages" size="10" value="<?=$Pages?>" />
221
+            <input type="text" name="year" size="10"
222
+              value="<?=$Year?>" />
224 223
           </td>
225 224
         </tr>
226
-<? } ?>
227
-<? if ($CategoryID == 4 || $CategoryID == 5) { ?>
228
-        <tr>
229
-          <td class="label">DLsite ID:</td>
230
-          <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=$DLsiteID?>"/></td>
231
-        </tr>
232
-<? } ?>
233
-<?
234
-  if ($CategoryID == 1) { ?>
235 225
         <tr>
236
-          <td class="label">Catalogue Number:</td>
226
+          <td class="label">Accession Number</td>
237 227
           <td>
238
-            <input type="text" name="catalogue" size="40" value="<?=$CatalogueNumber?>" />
228
+            <input type="text" name="catalogue" size="40"
229
+              value="<?=$CatalogueNumber?>" />
239 230
           </td>
240 231
         </tr>
241
-<? } ?>
242
-<?  if (check_perms('torrents_freeleech')) { ?>
232
+        <?php  if (check_perms('torrents_freeleech')) { ?>
243 233
         <tr>
244 234
           <td class="label">Torrent <strong>group</strong> leech status</td>
245 235
           <td>
246 236
             <input type="checkbox" id="unfreeleech" name="unfreeleech" /><label for="unfreeleech"> Reset</label>
247 237
             <input type="checkbox" id="freeleech" name="freeleech" /><label for="freeleech"> Freeleech</label>
248
-            <input type="checkbox" id="neutralleech" name="neutralleech" /><label for="neutralleech"> Neutral Leech</label>
249
-             because
238
+            <input type="checkbox" id="neutralleech" name="neutralleech" /><label for="neutralleech"> Neutral
239
+              Leech</label>
240
+            because
250 241
             <select name="freeleechtype">
251
-<?    $FL = array('N/A', 'Staff Pick', 'Perma-FL', 'Freeleechizer', 'Site-Wide FL');
242
+              <?php    $FL = array('N/A', 'Staff Pick', 'Perma-FL', 'Freeleechizer', 'Site-Wide FL');
252 243
     foreach ($FL as $Key => $FLType) { ?>
253
-              <option value="<?=$Key?>"<?=($Key == $Torrent['FreeLeechType'] ? ' selected="selected"' : '')?>><?=$FLType?></option>
254
-<?    } ?>
244
+              <option value="<?=$Key?>" <?=($Key == $Torrent['FreeLeechType'] ? ' selected="selected"' : '')?>><?=$FLType?>
245
+              </option>
246
+              <?php    } ?>
255 247
             </select>
256 248
           </td>
257 249
         </tr>
258
-<?  } ?>
250
+        <?php  } ?>
259 251
       </table>
260 252
       <input type="submit" value="Edit" />
261 253
     </form>
262 254
   </div>
263
-<?
255
+  <?php
264 256
   }
265 257
   if ($Contributed || check_perms('torrents_edit')) {
266
-?>
258
+      ?>
267 259
   <h3>Rename (will not merge)</h3>
268 260
   <div class="box pad">
269 261
     <form class="rename_form" name="torrent_group" action="torrents.php" method="post">
270 262
       <div>
271 263
         <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
272 264
           <input type="hidden" name="action" value="rename" />
273
-          <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
274
-          <input type="hidden" name="groupid" value="<?=$GroupID?>" />
265
+          <input type="hidden" name="auth"
266
+            value="<?=$LoggedUser['AuthKey']?>" />
267
+          <input type="hidden" name="groupid"
268
+            value="<?=$GroupID?>" />
275 269
           <tr>
276
-            <td class="label">English Title: </td>
270
+            <td class="label">Torrent Title</td>
277 271
             <td>
278
-              <input type="text" name="name" size="70" value="<?=$Name?>" />
272
+              <input type="text" name="name" size="70"
273
+                value="<?=$Name?>" />
279 274
             </td>
280 275
           </tr>
281 276
           <tr>
282
-            <td class="label">Romaji Title: </td>
277
+            <td class="label">Organism</td>
283 278
             <td>
284
-              <input type="text" name="namerj" size="70" value="<?=$NameRJ?>" />
279
+              <input type="text" name="namerj" size="70"
280
+                value="<?=$NameRJ?>" />
285 281
             </td>
286 282
           </tr>
287 283
           <tr>
288
-            <td class="label">Japanese Title: </td>
284
+            <td class="label">Strain/Variety</td>
289 285
             <td>
290
-              <input type="text" name="namejp" size="70" value="<?=$NameJP?>" />
286
+              <input type="text" name="namejp" size="70"
287
+                value="<?=$NameJP?>" />
291 288
             </td>
292 289
           </tr>
293 290
         </table>
@@ -297,16 +294,18 @@ if ($CategoryID != 5) { ?>
297 294
       </div>
298 295
     </form>
299 296
   </div>
300
-<? }
297
+  <?php
298
+  }
301 299
   if (check_perms('torrents_edit')) { ?>
302 300
   <h3>Merge with another group</h3>
303 301
   <div class="box pad">
304 302
     <form class="merge_form" name="torrent_group" action="torrents.php" method="post">
305 303
       <div>
306 304
         <input type="hidden" name="action" value="merge" />
307
-        <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
305
+        <input type="hidden" name="auth"
306
+          value="<?=$LoggedUser['AuthKey']?>" />
308 307
         <input type="hidden" name="groupid" value="<?=$GroupID?>" />
309
-        <h3>Target torrent group ID:
308
+        <h3>Target torrent group ID
310 309
           <input type="text" name="targetgroupid" size="10" />
311 310
         </h3>
312 311
         <div style="text-align: center;">
@@ -315,6 +314,6 @@ if ($CategoryID != 5) { ?>
315 314
       </div>
316 315
     </form>
317 316
   </div>
318
-<?  } ?>
317
+  <?php  } ?>
319 318
 </div>
320
-<? View::show_footer(); ?>
319
+<?php View::show_footer();

Loading…
Cancel
Save