Browse Source

Update individual torrent edit form

pjc 5 years ago
parent
commit
9208c6c3d9
1 changed files with 155 additions and 124 deletions
  1. 155
    124
      sections/torrents/edit.php

+ 155
- 124
sections/torrents/edit.php View File

1
-<?
1
+<?php
2
+
2
 //**********************************************************************//
3
 //**********************************************************************//
3
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
4
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
4
 // This page relies on the TorrentForm class. All it does is call      //
5
 // This page relies on the TorrentForm class. All it does is call      //
11
 require_once(SERVER_ROOT.'/classes/torrent_form.class.php');
12
 require_once(SERVER_ROOT.'/classes/torrent_form.class.php');
12
 
13
 
13
 if (!is_number($_GET['id']) || !$_GET['id']) {
14
 if (!is_number($_GET['id']) || !$_GET['id']) {
14
-  error(0);
15
+    error(0);
15
 }
16
 }
16
 
17
 
17
 $TorrentID = $_GET['id'];
18
 $TorrentID = $_GET['id'];
56
 
57
 
57
 list($Properties) = $DB->to_array(false, MYSQLI_BOTH);
58
 list($Properties) = $DB->to_array(false, MYSQLI_BOTH);
58
 if (!$Properties) {
59
 if (!$Properties) {
59
-  error(404);
60
+    error(404);
60
 }
61
 }
61
 
62
 
62
 $UploadForm = $Categories[$Properties['CategoryID'] - 1];
63
 $UploadForm = $Categories[$Properties['CategoryID'] - 1];
63
 
64
 
64
 if (($LoggedUser['ID'] != $Properties['UserID'] && !check_perms('torrents_edit')) || $LoggedUser['DisableWiki']) {
65
 if (($LoggedUser['ID'] != $Properties['UserID'] && !check_perms('torrents_edit')) || $LoggedUser['DisableWiki']) {
65
-  error(403);
66
+    error(403);
66
 }
67
 }
67
 
68
 
68
 View::show_header('Edit torrent', 'upload,torrent,bbcode');
69
 View::show_header('Edit torrent', 'upload,torrent,bbcode');
72
 $TorrentForm->upload_form();
73
 $TorrentForm->upload_form();
73
 
74
 
74
 if (check_perms('torrents_edit') || check_perms('users_mod')) {
75
 if (check_perms('torrents_edit') || check_perms('users_mod')) {
75
-?>
76
+    ?>
76
 <div class="thin">
77
 <div class="thin">
77
-<?
78
+  <?php
78
   if ($Properties['CategoryID'] != 5) {
79
   if ($Properties['CategoryID'] != 5) {
79
-?>
80
+      ?>
80
   <div class="header">
81
   <div class="header">
81
-    <h2>Change group</h2>
82
+    <h2>Change Group</h2>
82
   </div>
83
   </div>
83
   <div class="box pad">
84
   <div class="box pad">
84
-  <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
85
-    <input type="hidden" name="action" value="editgroupid" />
86
-    <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
87
-    <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
88
-    <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
89
-    <table class="layout">
90
-      <tr>
91
-        <td class="label">Group ID</td>
92
-        <td>
93
-          <input type="text" name="groupid" value="<?=$Properties['GroupID']?>" size="10" />
94
-        </td>
95
-      </tr>
96
-      <tr>
97
-        <td colspan="2" class="center">
98
-          <input type="submit" value="Change group ID" />
99
-        </td>
100
-      </tr>
101
-    </table>
102
-  </form>
85
+    <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
86
+      <input type="hidden" name="action" value="editgroupid" />
87
+      <input type="hidden" name="auth"
88
+        value="<?=$LoggedUser['AuthKey']?>" />
89
+      <input type="hidden" name="torrentid"
90
+        value="<?=$TorrentID?>" />
91
+      <input type="hidden" name="oldgroupid"
92
+        value="<?=$Properties['GroupID']?>" />
93
+      <table class="layout">
94
+        <tr>
95
+          <td class="label">Group ID</td>
96
+          <td>
97
+            <input type="text" name="groupid"
98
+              value="<?=$Properties['GroupID']?>"
99
+              size="10" />
100
+          </td>
101
+        </tr>
102
+        <tr>
103
+          <td colspan="2" class="center">
104
+            <input type="submit" value="Change Group ID" />
105
+          </td>
106
+        </tr>
107
+      </table>
108
+    </form>
103
   </div>
109
   </div>
104
   <h2>Split off into new group</h2>
110
   <h2>Split off into new group</h2>
105
   <div class="box pad">
111
   <div class="box pad">
106
-  <form class="split_form" name="torrent_group" action="torrents.php" method="post">
107
-    <input type="hidden" name="action" value="newgroup" />
108
-    <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
109
-    <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
110
-    <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
111
-    <table class="layout">
112
-      <tr>
113
-        <td class="label">Artist</td>
114
-        <td>
115
-          <input type="text" name="artist" value="<?=$Properties['ArtistName']?>" size="50" />
116
-        </td>
117
-      </tr>
118
-      <tr>
119
-        <td class="label">Title</td>
120
-        <td>
121
-          <input type="text" name="title" value="<?=$Properties['Title']?>" size="50" />
122
-        </td>
123
-      </tr>
124
-      <tr>
125
-        <td class="label">Japanese Title</td>
126
-        <td>
127
-          <input type="test" name="title_jp" value="<?=$Properties['TitleJP']?>" size=50" />
128
-        </td>
129
-      <tr>
130
-        <td class="label">Year</td>
131
-        <td>
132
-          <input type="text" name="year" value="<?=$Properties['Year']?>" size="10" />
133
-        </td>
134
-      </tr>
135
-      <tr>
136
-        <td colspan="2" class="center">
137
-          <input type="submit" value="Split into new group" />
138
-        </td>
139
-      </tr>
140
-    </table>
141
-  </form>
112
+    <form class="split_form" name="torrent_group" action="torrents.php" method="post">
113
+      <input type="hidden" name="action" value="newgroup" />
114
+      <input type="hidden" name="auth"
115
+        value="<?=$LoggedUser['AuthKey']?>" />
116
+      <input type="hidden" name="torrentid"
117
+        value="<?=$TorrentID?>" />
118
+      <input type="hidden" name="oldgroupid"
119
+        value="<?=$Properties['GroupID']?>" />
120
+      <table class="layout">
121
+        <tr>
122
+          <td class="label">Author</td>
123
+          <td>
124
+            <input type="text" name="artist"
125
+              value="<?=$Properties['ArtistName']?>"
126
+              size="50" />
127
+          </td>
128
+        </tr>
129
+        <tr>
130
+          <td class="label">Torrent Title</td>
131
+          <td>
132
+            <input type="text" name="title"
133
+              value="<?=$Properties['Title']?>"
134
+              size="50" />
135
+          </td>
136
+        </tr>
137
+        <tr>
138
+          <td class="label">Strain/Variety</td>
139
+          <td>
140
+            <input type="test" name="title_jp"
141
+              value="<?=$Properties['TitleJP']?>"
142
+              size=50" />
143
+          </td>
144
+        <tr>
145
+          <td class="label">Year</td>
146
+          <td>
147
+            <input type="text" name="year"
148
+              value="<?=$Properties['Year']?>"
149
+              size="10" />
150
+          </td>
151
+        </tr>
152
+        <tr>
153
+          <td colspan="2" class="center">
154
+            <input type="submit" value="Split into new group" />
155
+          </td>
156
+        </tr>
157
+      </table>
158
+    </form>
142
   </div>
159
   </div>
143
   <br />
160
   <br />
144
-<?
161
+  <?php
145
   }
162
   }
146
-  if (check_perms('users_mod')) { ?>
147
-  <h2>Change category</h2>
163
+    if (check_perms('users_mod')) { ?>
164
+  <h2>Change Category</h2>
148
   <div class="box pad">
165
   <div class="box pad">
149
-  <form action="torrents.php" method="post">
150
-    <input type="hidden" name="action" value="changecategory" />
151
-    <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
152
-    <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
153
-    <input type="hidden" name="oldgroupid" value="<?=$Properties['GroupID']?>" />
154
-    <input type="hidden" name="oldartistid" value="<?=$Properties['ArtistID']?>" />
155
-    <input type="hidden" name="oldcategoryid" value="<?=$Properties['CategoryID']?>" />
156
-    <table>
157
-      <tr>
158
-        <td class="label">Change category</td>
159
-        <td>
160
-          <select id="newcategoryid" name="newcategoryid">
161
-<?    foreach ($Categories as $CatID => $CatName) { ?>
162
-            <option value="<?=($CatID + 1)?>"<?Format::selected('CategoryID', $CatID + 1, 'selected', $Properties)?>><?=($CatName)?></option>
163
-<?    } ?>
164
-          </select>
165
-        </td>
166
-      <tr id="split_releasetype">
167
-        <td class="label">Release type</td>
168
-        <td>
169
-          <select name="releasetype">
170
-<?    foreach ($ReleaseTypes as $RTID => $ReleaseType) { ?>
171
-            <option value="<?=($RTID)?>"><?=($ReleaseType)?></option>
172
-<?    } ?>
173
-          </select>
174
-        </td>
175
-      </tr>
176
-      <tr id="split_artist">
177
-        <td class="label">Artist</td>
178
-        <td>
179
-          <input type="text" name="artist" value="<?=$Properties['ArtistName']?>" size="50" />
180
-        </td>
181
-      </tr>
182
-      <tr id="split_title">
183
-        <td class="label">Title</td>
184
-        <td>
185
-          <input type="text" name="title" value="<?=$Properties['Title']?>" size="50" />
186
-        </td>
187
-      </tr>
188
-      <tr id="split_year">
189
-        <td class="label">Year</td>
190
-        <td>
191
-          <input type="text" name="year" value="<?=$Properties['Year']?>" size="10" />
192
-        </td>
193
-      </tr>
194
-      <tr>
195
-        <td colspan="2" class="center">
196
-          <input type="submit" value="Change category" />
197
-        </td>
198
-      </tr>
199
-    </table>
200
-    <script type="text/javascript">ChangeCategory($('#newcategoryid').raw().value);</script>
201
-  </form>
166
+    <form action="torrents.php" method="post">
167
+      <input type="hidden" name="action" value="changecategory" />
168
+      <input type="hidden" name="auth"
169
+        value="<?=$LoggedUser['AuthKey']?>" />
170
+      <input type="hidden" name="torrentid"
171
+        value="<?=$TorrentID?>" />
172
+      <input type="hidden" name="oldgroupid"
173
+        value="<?=$Properties['GroupID']?>" />
174
+      <input type="hidden" name="oldartistid"
175
+        value="<?=$Properties['ArtistID']?>" />
176
+      <input type="hidden" name="oldcategoryid"
177
+        value="<?=$Properties['CategoryID']?>" />
178
+      <table>
179
+        <tr>
180
+          <td class="label">Category</td>
181
+          <td>
182
+            <select id="newcategoryid" name="newcategoryid">
183
+              <?php    foreach ($Categories as $CatID => $CatName) { ?>
184
+              <option value="<?=($CatID + 1)?>" <?Format::selected('CategoryID', $CatID + 1, 'selected', $Properties)?>><?=($CatName)?>
185
+              </option>
186
+              <?php    } ?>
187
+            </select>
188
+          </td>
189
+        <tr id="split_releasetype">
190
+          <td class="label">Release type</td>
191
+          <td>
192
+            <select name="releasetype">
193
+              <?php    foreach ($ReleaseTypes as $RTID => $ReleaseType) { ?>
194
+              <option value="<?=($RTID)?>"><?=($ReleaseType)?>
195
+              </option>
196
+              <?php    } ?>
197
+            </select>
198
+          </td>
199
+        </tr>
200
+        <tr id="split_artist">
201
+          <td class="label">Artist</td>
202
+          <td>
203
+            <input type="text" name="artist"
204
+              value="<?=$Properties['ArtistName']?>"
205
+              size="50" />
206
+          </td>
207
+        </tr>
208
+        <tr id="split_title">
209
+          <td class="label">Torrent Title</td>
210
+          <td>
211
+            <input type="text" name="title"
212
+              value="<?=$Properties['Title']?>"
213
+              size="50" />
214
+          </td>
215
+        </tr>
216
+        <tr id="split_year">
217
+          <td class="label">Year</td>
218
+          <td>
219
+            <input type="text" name="year"
220
+              value="<?=$Properties['Year']?>"
221
+              size="10" />
222
+          </td>
223
+        </tr>
224
+        <tr>
225
+          <td colspan="2" class="center">
226
+            <input type="submit" value="Change Category" />
227
+          </td>
228
+        </tr>
229
+      </table>
230
+      <script type="text/javascript">
231
+        ChangeCategory($('#newcategoryid').raw().value);
232
+      </script>
233
+    </form>
202
   </div>
234
   </div>
203
-<?
204
-  }
205
-?>
235
+  <?php
236
+  } ?>
206
 </div>
237
 </div>
207
-<?
238
+<?php
208
 } // if check_perms('torrents_edit')
239
 } // if check_perms('torrents_edit')
209
 
240
 
210
-View::show_footer(); ?>
241
+View::show_footer();

Loading…
Cancel
Save