Browse Source

Fix search and add SemVer support

pjc 5 years ago
parent
commit
4d471b9499

+ 2
- 0
classes/rules.class.php View File

10
     {
10
     {
11
         ?>
11
         ?>
12
 <ul>
12
 <ul>
13
+<li><strong>No personally identifying patient data is allowed anywhere on the site.</strong></li>
14
+
13
   <li>Staff can do anything to anyone for any reason (or no reason). If you take issue with a decision, you must do so
15
   <li>Staff can do anything to anyone for any reason (or no reason). If you take issue with a decision, you must do so
14
     privately with the staff member who issued the decision or with an administrator of the site.</li>
16
     privately with the staff member who issued the decision or with an administrator of the site.</li>
15
 
17
 

+ 29
- 13
classes/torrent_form.class.php View File

16
     public $ContainersProt = [];
16
     public $ContainersProt = [];
17
     public $Codecs = [];
17
     public $Codecs = [];
18
     public $Resolutions = [];
18
     public $Resolutions = [];
19
-    #var $AudioFormats = [];
19
+    var $AudioFormats = [];
20
     #var $Subbing = [];
20
     #var $Subbing = [];
21
     #var $Languages = [];
21
     #var $Languages = [];
22
     #var $Platform = [];
22
     #var $Platform = [];
47
         $this->ContainersProt = $ContainersProt;
47
         $this->ContainersProt = $ContainersProt;
48
         $this->Codecs = $Codecs;
48
         $this->Codecs = $Codecs;
49
         $this->Resolutions = $Resolutions;
49
         $this->Resolutions = $Resolutions;
50
-        #$this->AudioFormats = $AudioFormats;
50
+        $this->AudioFormats = $AudioFormats;
51
         #$this->Subbing = $Subbing;
51
         #$this->Subbing = $Subbing;
52
         #$this->Languages = $Languages;
52
         #$this->Languages = $Languages;
53
         $this->TorrentID = $TorrentID;
53
         $this->TorrentID = $TorrentID;
155
     <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
155
     <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
156
 
156
 
157
       <tr>
157
       <tr>
158
-        <td class="label">Torrent File</td>
158
+        <td class="label">
159
+        Torrent File
160
+        <strong class="important_text">*</strong>
161
+        </td>
159
         <td><input id="file" type="file" name="file_input" size="50" /><br />
162
         <td><input id="file" type="file" name="file_input" size="50" /><br />
160
           Use the above announce URL and set the private flag in your BitTorrent client, e.g.,
163
           Use the above announce URL and set the private flag in your BitTorrent client, e.g.,
161
           <code>mktorrent -p -a &lt;announce&gt; &lt;target folder&gt;</code>
164
           <code>mktorrent -p -a &lt;announce&gt; &lt;target folder&gt;</code>
163
       </tr>
166
       </tr>
164
 
167
 
165
       <tr>
168
       <tr>
166
-        <td class="label">Type</td>
169
+        <td class="label">
170
+        Category
171
+        <strong class="important_text">*</strong>
172
+        </td>
167
         <td>
173
         <td>
168
           <select id="categories" name="type" onchange="Categories()" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
174
           <select id="categories" name="type" onchange="Categories()" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
169
             <?php
175
             <?php
311
     </td>
317
     </td>
312
   </tr>
318
   </tr>
313
 
319
 
320
+  <!-- Semantic Versioning -->
321
+    <tr id="audio_tr">
322
+    <td class="label">Version</td>
323
+    <td>
324
+      <input type="text" id="audioformat" name="audioformat" size="10"
325
+        pattern="\d+\.\d+\.\d+" value="<?= display_str($Torrent['AudioFormat']) ?>"
326
+        <?= $this->Disabled ?>/><br />
327
+      Please see <a href="https://semver.org target="_blank">Semantic Versioning</a>; start with 0.1.0
328
+    </td>
329
+  </tr>
330
+
314
   <!-- Three title fields -->
331
   <!-- Three title fields -->
315
   <tr id="title_tr">
332
   <tr id="title_tr">
316
     <td class="label">
333
     <td class="label">
458
               echo ">$Media</option>\n";
475
               echo ">$Media</option>\n";
459
           } ?>
476
           } ?>
460
       </select><br />
477
       </select><br />
461
-      Class of technology used
478
+      The class of technology used
462
     </td>
479
     </td>
463
   </tr>
480
   </tr>
464
 
481
 
480
                 echo ">$Media</option>\n";
497
                 echo ">$Media</option>\n";
481
             } ?>
498
             } ?>
482
       </select><br />
499
       </select><br />
483
-      Class of technology used
500
+      The class of technology used
484
     </td>
501
     </td>
485
   </tr>
502
   </tr>
486
 
503
 
516
           $('#resolution').gshow()
533
           $('#resolution').gshow()
517
         }
534
         }
518
       </script><br />
535
       </script><br />
519
-      How complete the data is
536
+      How complete the data is, specifically or conceptually
520
     </td>
537
     </td>
521
   </tr>
538
   </tr>
522
 
539
 
627
         value="<?= display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"
644
         value="<?= display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"
628
         <?php Users::has_autocomplete_enabled('other'); ?>
645
         <?php Users::has_autocomplete_enabled('other'); ?>
629
       /><br />
646
       /><br />
630
-      Comma-seperated list of tags, n.b., use <strong class="important_text_alt">vanity.house</strong> for data you
631
-      produced
647
+      Comma-seperated list of at least 5 tags
632
     </td>
648
     </td>
633
   </tr>
649
   </tr>
634
 
650
 
674
           array($this->Disabled)
690
           array($this->Disabled)
675
       );
691
       );
676
       ?><br />
692
       ?><br />
677
-      General info about the object of study's function or significance
693
+      General info about the torrent subject's function or significance
678
     </td>
694
     </td>
679
   </tr>
695
   </tr>
680
   <?php } # Ends if NewTorrent line 499?>
696
   <?php } # Ends if NewTorrent line 499?>
690
           display_str($Torrent['TorrentDescription'] ?? ''),
706
           display_str($Torrent['TorrentDescription'] ?? ''),
691
           60,
707
           60,
692
       ); ?><br />
708
       ); ?><br />
693
-      Specific info about the protocols and equipment relevant to <em>this</em> data
709
+      Specific info about the protocols and equipment used to produce the data
694
     </td>
710
     </td>
695
   </tr>
711
   </tr>
696
 
712
 
697
   <!-- Boolean options -->
713
   <!-- Boolean options -->
698
   <tr id="censored_tr">
714
   <tr id="censored_tr">
699
-    <td class="label">Aligned Sequence</td>
715
+    <td class="label">Aligned/Annotated</td>
700
     <td>
716
     <td>
701
       <input type="checkbox" name="censored" value="1" <?= (($Torrent['Censored'] ?? 0) ? 'checked ' : '') ?>/>
717
       <input type="checkbox" name="censored" value="1" <?= (($Torrent['Censored'] ?? 0) ? 'checked ' : '') ?>/>
702
-      Whether the torrent contains raw reads or alignment data
718
+      Whether the torrent contains alignments, annotations, or other structural metadata
703
     </td>
719
     </td>
704
   </tr>
720
   </tr>
705
 
721
 

+ 1
- 1
classes/torrentsearch.class.php View File

51
     // List of fields that can be used for fulltext searches
51
     // List of fields that can be used for fulltext searches
52
     private static $Fields = [
52
     private static $Fields = [
53
     'artistname' => 1,
53
     'artistname' => 1,
54
-    #'audioformat' => 1,
54
+    'audioformat' => 1,
55
     'cataloguenumber' => 1,
55
     'cataloguenumber' => 1,
56
     'codec' => 1,
56
     'codec' => 1,
57
     'container' => 1,
57
     'container' => 1,

+ 1
- 1
sections/torrents/user.php View File

54
 }
54
 }
55
 
55
 
56
 # Get release specifics
56
 # Get release specifics
57
-if (isset($_GET['container']) && in_array($_GET['container'], array_unique(array_merge($Containers, $ContainersGames)))) {
57
+if (isset($_GET['container']) && in_array($_GET['container'], array_unique(array_merge($Containers, $ContainersGames, $ContainersProt)))) {
58
     $SearchWhere[] = "t.Container = '".db_string($_GET['container'])."'";
58
     $SearchWhere[] = "t.Container = '".db_string($_GET['container'])."'";
59
 }
59
 }
60
 
60
 

+ 25
- 14
sections/upload/upload_handle.php View File

57
 }
57
 }
58
 
58
 
59
 $Properties['Resolution'] = $_POST['resolution'] ?? '';
59
 $Properties['Resolution'] = $_POST['resolution'] ?? '';
60
-$Properties['AudioFormat'] = 'nil';
60
+$Properties['AudioFormat'] = $_POST['audioformat'] ?? '';
61
 $Properties['Subbing'] = 'nil';
61
 $Properties['Subbing'] = 'nil';
62
 $Properties['Language'] = 'nil';
62
 $Properties['Language'] = 'nil';
63
 $Properties['Subber'] = isset($_POST['subber']) ? $_POST['subber'] : '';
63
 $Properties['Subber'] = isset($_POST['subber']) ? $_POST['subber'] : '';
102
     $Properties['Artists'] = Artists::get_artist($Properties['GroupID']);
102
     $Properties['Artists'] = Artists::get_artist($Properties['GroupID']);
103
 }
103
 }
104
 
104
 
105
+# todo: Make this more generalized
105
 if ($Type === 'Movies' || $Type === 'Manga' || $Type === 'Anime' || $Type === 'Games') {
106
 if ($Type === 'Movies' || $Type === 'Manga' || $Type === 'Anime' || $Type === 'Games') {
106
     if (empty($_POST['idols'])) {
107
     if (empty($_POST['idols'])) {
107
         $Err = "You didn't enter any artists/idols";
108
         $Err = "You didn't enter any artists/idols";
168
             array('maxlength' => 50, 'minlength' => 0)
169
             array('maxlength' => 50, 'minlength' => 0)
169
         );
170
         );
170
 
171
 
172
+        # torrents.AudioFormat
173
+        $Validate->SetFields(
174
+            'audioformat',
175
+            '0',
176
+            'string',
177
+            'Version must be between 0 and 10 characters.',
178
+            array('maxlength' => 10, 'minlength' => 0)
179
+        );
180
+        
171
         # torrents_group.Name
181
         # torrents_group.Name
172
         $Validate->SetFields(
182
         $Validate->SetFields(
173
             'title',
183
             'title',
174
             '1',
184
             '1',
175
             'string',
185
             'string',
176
-            'Torrent Title must be between 5 and 255 characters.',
177
-            array('maxlength' => 255, 'minlength' => 5)
186
+            'Torrent Title must be between 10 and 255 characters.',
187
+            array('maxlength' => 255, 'minlength' => 10)
178
         );
188
         );
179
 
189
 
180
         # torrents_group.NameRJ
190
         # torrents_group.NameRJ
268
         'album_desc',
278
         'album_desc',
269
         '1',
279
         '1',
270
         'string',
280
         'string',
271
-        'The description must be between 10 and 65535 characters.',
272
-        array('maxlength' => 65535, 'minlength' => 10)
281
+        'The description must be between 100 and 65535 characters.',
282
+        array('maxlength' => 65535, 'minlength' => 100)
273
     );
283
     );
274
 
284
 
275
     /* todo: Fix the Group ID validation
285
     /* todo: Fix the Group ID validation
285
 
295
 
286
 $Err = $Validate->ValidateForm($_POST); // Validate the form
296
 $Err = $Validate->ValidateForm($_POST); // Validate the form
287
 
297
 
298
+# todo: Move all this validation code to the Validate class
288
 if (count(explode(',', $Properties['TagList'])) < 5) {
299
 if (count(explode(',', $Properties['TagList'])) < 5) {
289
     $Err = 'You must enter at least 5 tags.';
300
     $Err = 'You must enter at least 5 tags.';
290
 }
301
 }
393
 //--------------- Autofill format and archive ----------------------------------//
404
 //--------------- Autofill format and archive ----------------------------------//
394
 
405
 
395
 if ($T['Container'] === 'Autofill' || $T['Archive'] === 'Autofill') {
406
 if ($T['Container'] === 'Autofill' || $T['Archive'] === 'Autofill') {
396
-# torrents.Container
397
-$Validate->ParseExtensions(
398
-    $Tor->file_list(),
399
-    array_merge($Containers, $ContainersGames, $ContainersProt)
400
-);
401
-/*
402
-# torrents.Archive
403
-$Validate->ParseExtensions(
407
+    # torrents.Container
408
+    $Validate->ParseExtensions(
404
     $Tor->file_list(),
409
     $Tor->file_list(),
405
     array_merge($Containers, $ContainersGames, $ContainersProt)
410
     array_merge($Containers, $ContainersGames, $ContainersProt)
406
 );
411
 );
407
-*/
412
+    /*
413
+    # torrents.Archive
414
+    $Validate->ParseExtensions(
415
+        $Tor->file_list(),
416
+        array_merge($Containers, $ContainersGames, $ContainersProt)
417
+    );
418
+    */
408
 }
419
 }
409
 
420
 
410
 //******************************************************************************//
421
 //******************************************************************************//

+ 6
- 1
static/functions/upload.js View File

13
   let cats = [
13
   let cats = [
14
     { // DNA
14
     { // DNA
15
       'javdb': {},
15
       'javdb': {},
16
+      'audio': {},
16
       'idols': {},
17
       'idols': {},
17
       'studio': {},
18
       'studio': {},
18
       'series': {},
19
       'series': {},
26
       'release_desc': {}
27
       'release_desc': {}
27
     }, { // RNA
28
     }, { // RNA
28
       'javdb': {},
29
       'javdb': {},
30
+      'audio': {},
29
       'idols': {},
31
       'idols': {},
30
       'studio': {},
32
       'studio': {},
31
       'series': {},
33
       'series': {},
39
       'release_desc': {}
41
       'release_desc': {}
40
     }, { // Protein
42
     }, { // Protein
41
       'javdb': {},
43
       'javdb': {},
44
+      'audio': {},
42
       'idols': {},
45
       'idols': {},
43
       'studio': {},
46
       'studio': {},
44
       'series': {},
47
       'series': {},
52
       'release_desc': {}
55
       'release_desc': {}
53
     }, { // Imaging
56
     }, { // Imaging
54
       'javdb': {},
57
       'javdb': {},
58
+      'audio': {},
55
       'idols': {},
59
       'idols': {},
56
       'studio': {},
60
       'studio': {},
57
       'series': {},
61
       'series': {},
63
       'screenshots': {},
67
       'screenshots': {},
64
       'group_desc': {},
68
       'group_desc': {},
65
       'release_desc': {}
69
       'release_desc': {}
66
-    }, { // Other
70
+    }, { // Extras
67
       'javdb': {},
71
       'javdb': {},
72
+      'audio': {},
68
       'idols': {},
73
       'idols': {},
69
       'studio': {},
74
       'studio': {},
70
       'series': {},
75
       'series': {},

Loading…
Cancel
Save