Browse Source

Fix search and add SemVer support

pjc 5 years ago
parent
commit
4d471b9499

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

@@ -10,6 +10,8 @@ class Rules
10 10
     {
11 11
         ?>
12 12
 <ul>
13
+<li><strong>No personally identifying patient data is allowed anywhere on the site.</strong></li>
14
+
13 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 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,7 +16,7 @@ class TorrentForm
16 16
     public $ContainersProt = [];
17 17
     public $Codecs = [];
18 18
     public $Resolutions = [];
19
-    #var $AudioFormats = [];
19
+    var $AudioFormats = [];
20 20
     #var $Subbing = [];
21 21
     #var $Languages = [];
22 22
     #var $Platform = [];
@@ -47,7 +47,7 @@ class TorrentForm
47 47
         $this->ContainersProt = $ContainersProt;
48 48
         $this->Codecs = $Codecs;
49 49
         $this->Resolutions = $Resolutions;
50
-        #$this->AudioFormats = $AudioFormats;
50
+        $this->AudioFormats = $AudioFormats;
51 51
         #$this->Subbing = $Subbing;
52 52
         #$this->Languages = $Languages;
53 53
         $this->TorrentID = $TorrentID;
@@ -155,7 +155,10 @@ class TorrentForm
155 155
     <table cellpadding="3" cellspacing="1" border="0" class="layout" width="100%">
156 156
 
157 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 162
         <td><input id="file" type="file" name="file_input" size="50" /><br />
160 163
           Use the above announce URL and set the private flag in your BitTorrent client, e.g.,
161 164
           <code>mktorrent -p -a &lt;announce&gt; &lt;target folder&gt;</code>
@@ -163,7 +166,10 @@ class TorrentForm
163 166
       </tr>
164 167
 
165 168
       <tr>
166
-        <td class="label">Type</td>
169
+        <td class="label">
170
+        Category
171
+        <strong class="important_text">*</strong>
172
+        </td>
167 173
         <td>
168 174
           <select id="categories" name="type" onchange="Categories()" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
169 175
             <?php
@@ -311,6 +317,17 @@ class TorrentForm
311 317
     </td>
312 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 331
   <!-- Three title fields -->
315 332
   <tr id="title_tr">
316 333
     <td class="label">
@@ -458,7 +475,7 @@ class TorrentForm
458 475
               echo ">$Media</option>\n";
459 476
           } ?>
460 477
       </select><br />
461
-      Class of technology used
478
+      The class of technology used
462 479
     </td>
463 480
   </tr>
464 481
 
@@ -480,7 +497,7 @@ class TorrentForm
480 497
                 echo ">$Media</option>\n";
481 498
             } ?>
482 499
       </select><br />
483
-      Class of technology used
500
+      The class of technology used
484 501
     </td>
485 502
   </tr>
486 503
 
@@ -516,7 +533,7 @@ class TorrentForm
516 533
           $('#resolution').gshow()
517 534
         }
518 535
       </script><br />
519
-      How complete the data is
536
+      How complete the data is, specifically or conceptually
520 537
     </td>
521 538
   </tr>
522 539
 
@@ -627,8 +644,7 @@ class TorrentForm
627 644
         value="<?= display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"
628 645
         <?php Users::has_autocomplete_enabled('other'); ?>
629 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 648
     </td>
633 649
   </tr>
634 650
 
@@ -674,7 +690,7 @@ class TorrentForm
674 690
           array($this->Disabled)
675 691
       );
676 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 694
     </td>
679 695
   </tr>
680 696
   <?php } # Ends if NewTorrent line 499?>
@@ -690,16 +706,16 @@ class TorrentForm
690 706
           display_str($Torrent['TorrentDescription'] ?? ''),
691 707
           60,
692 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 710
     </td>
695 711
   </tr>
696 712
 
697 713
   <!-- Boolean options -->
698 714
   <tr id="censored_tr">
699
-    <td class="label">Aligned Sequence</td>
715
+    <td class="label">Aligned/Annotated</td>
700 716
     <td>
701 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 719
     </td>
704 720
   </tr>
705 721
 

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

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

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

@@ -54,7 +54,7 @@ if (!empty($_GET['format'])) {
54 54
 }
55 55
 
56 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 58
     $SearchWhere[] = "t.Container = '".db_string($_GET['container'])."'";
59 59
 }
60 60
 

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

@@ -57,7 +57,7 @@ if (!($_POST['resolution'] ?? false)) {
57 57
 }
58 58
 
59 59
 $Properties['Resolution'] = $_POST['resolution'] ?? '';
60
-$Properties['AudioFormat'] = 'nil';
60
+$Properties['AudioFormat'] = $_POST['audioformat'] ?? '';
61 61
 $Properties['Subbing'] = 'nil';
62 62
 $Properties['Language'] = 'nil';
63 63
 $Properties['Subber'] = isset($_POST['subber']) ? $_POST['subber'] : '';
@@ -102,6 +102,7 @@ if (isset($Properties['GroupID'])) {
102 102
     $Properties['Artists'] = Artists::get_artist($Properties['GroupID']);
103 103
 }
104 104
 
105
+# todo: Make this more generalized
105 106
 if ($Type === 'Movies' || $Type === 'Manga' || $Type === 'Anime' || $Type === 'Games') {
106 107
     if (empty($_POST['idols'])) {
107 108
         $Err = "You didn't enter any artists/idols";
@@ -168,13 +169,22 @@ default:
168 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 181
         # torrents_group.Name
172 182
         $Validate->SetFields(
173 183
             'title',
174 184
             '1',
175 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 190
         # torrents_group.NameRJ
@@ -268,8 +278,8 @@ default:
268 278
         'album_desc',
269 279
         '1',
270 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 285
     /* todo: Fix the Group ID validation
@@ -285,6 +295,7 @@ default:
285 295
 
286 296
 $Err = $Validate->ValidateForm($_POST); // Validate the form
287 297
 
298
+# todo: Move all this validation code to the Validate class
288 299
 if (count(explode(',', $Properties['TagList'])) < 5) {
289 300
     $Err = 'You must enter at least 5 tags.';
290 301
 }
@@ -393,18 +404,18 @@ if (!empty($Err)) { // Show the upload form, with the data the user entered
393 404
 //--------------- Autofill format and archive ----------------------------------//
394 405
 
395 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 409
     $Tor->file_list(),
405 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,6 +13,7 @@ function Categories() {
13 13
   let cats = [
14 14
     { // DNA
15 15
       'javdb': {},
16
+      'audio': {},
16 17
       'idols': {},
17 18
       'studio': {},
18 19
       'series': {},
@@ -26,6 +27,7 @@ function Categories() {
26 27
       'release_desc': {}
27 28
     }, { // RNA
28 29
       'javdb': {},
30
+      'audio': {},
29 31
       'idols': {},
30 32
       'studio': {},
31 33
       'series': {},
@@ -39,6 +41,7 @@ function Categories() {
39 41
       'release_desc': {}
40 42
     }, { // Protein
41 43
       'javdb': {},
44
+      'audio': {},
42 45
       'idols': {},
43 46
       'studio': {},
44 47
       'series': {},
@@ -52,6 +55,7 @@ function Categories() {
52 55
       'release_desc': {}
53 56
     }, { // Imaging
54 57
       'javdb': {},
58
+      'audio': {},
55 59
       'idols': {},
56 60
       'studio': {},
57 61
       'series': {},
@@ -63,8 +67,9 @@ function Categories() {
63 67
       'screenshots': {},
64 68
       'group_desc': {},
65 69
       'release_desc': {}
66
-    }, { // Other
70
+    }, { // Extras
67 71
       'javdb': {},
72
+      'audio': {},
68 73
       'idols': {},
69 74
       'studio': {},
70 75
       'series': {},

Loading…
Cancel
Save