Browse Source

Partial implementation of extra resolution metadata

biotorrents 4 years ago
parent
commit
6f8e8f00dc

+ 87
- 39
classes/config.template View File

@@ -133,7 +133,6 @@ ENV::setPub('SRI', 'sha384');
133 133
  */
134 134
 
135 135
 # Pre-shared key for generating hmacs for the image proxy
136
-define('IMAGE_PSK', '00000000000000000000000000000000');
137 136
 ENV::setPriv('IMAGE_PSK', '00000000000000000000000000000000');
138 137
 
139 138
  # Production
@@ -470,22 +469,22 @@ ENV::setPub(
470 469
  * Found in the `permissions` table.
471 470
  */
472 471
 
473
-#      Name of class     Class ID (not level)
474
-define('ADMIN', '1');
475
-define('USER', '2');
476
-define('MEMBER', '3');
477
-define('POWER', '4');
478
-define('ELITE', '5');
479
-define('LEGEND', '8');
480
-define('MOD', '11');
481
-define('SYSOP', '15');
482
-define('ARTIST', '19');
483
-define('DONOR', '20');
484
-define('VIP', '21');
472
+#       Name of class     Class ID (not level)
473
+define('ADMIN',          '1');
474
+define('USER',           '2');
475
+define('MEMBER',         '3');
476
+define('POWER',          '4');
477
+define('ELITE',          '5');
478
+define('LEGEND',         '8');
479
+define('MOD',            '11');
480
+define('SYSOP',          '15');
481
+define('ARTIST',         '19');
482
+define('DONOR',          '20');
483
+define('VIP',            '21');
485 484
 define('TORRENT_MASTER', '23');
486
-define('POWER_TM', '24');
487
-define('FLS_TEAM', '33');
488
-define('FORUM_MOD', '9001');
485
+define('POWER_TM',       '24');
486
+define('FLS_TEAM',       '33');
487
+define('FORUM_MOD',      '9001');
489 488
 
490 489
 
491 490
 /**
@@ -525,16 +524,16 @@ ENV::setPub('DONOR_FORUM_RANK', 6);
525 524
 
526 525
 # Ratio requirements, in descending order
527 526
 define('RATIO_REQUIREMENTS', [
528
- # Downloaded     Req (0% seeded) Req (100% seeded)
529
-  [200 * 1024**3, 0.60,           0.60],
530
-  [160 * 1024**3, 0.60,           0.50],
531
-  [120 * 1024**3, 0.50,           0.40],
532
-  [100 * 1024**3, 0.40,           0.30],
533
-  [80  * 1024**3, 0.30,           0.20],
534
-  [60  * 1024**3, 0.20,           0.10],
535
-  [40  * 1024**3, 0.15,           0.00],
536
-  [20  * 1024**3, 0.10,           0.00],
537
-  [10  * 1024**3, 0.05,           0.00],
527
+ # Downloaded     Req (0% seed) Req (100% seed)
528
+  [200 * 1024**3, 0.60,         0.60],
529
+  [160 * 1024**3, 0.60,         0.50],
530
+  [120 * 1024**3, 0.50,         0.40],
531
+  [100 * 1024**3, 0.40,         0.30],
532
+  [80  * 1024**3, 0.30,         0.20],
533
+  [60  * 1024**3, 0.20,         0.10],
534
+  [40  * 1024**3, 0.15,         0.00],
535
+  [20  * 1024**3, 0.10,         0.00],
536
+  [10  * 1024**3, 0.05,         0.00],
538 537
 ]);
539 538
 
540 539
 # God I wish I didn't have to do this but I just don't care anymore
@@ -548,7 +547,7 @@ $AutomatedBadgeIDs = [
548 547
     '256'  => 15,
549 548
     '512'  => 16,
550 549
     '1024' => 17,
551
-    '2048' => 18
550
+    '2048' => 18,
552 551
   ],
553 552
 
554 553
   'UL' => [
@@ -560,7 +559,7 @@ $AutomatedBadgeIDs = [
560 559
     '512'  => 25,
561 560
     '1024' => 26,
562 561
     '2048' => 27,
563
-    '4096' => 28
562
+    '4096' => 28,
564 563
   ],
565 564
 
566 565
   'Posts' => [
@@ -572,7 +571,7 @@ $AutomatedBadgeIDs = [
572 571
     '250'  => 65,
573 572
     '500'  => 66,
574 573
     '1000' => 67,
575
-    '2500' => 68
574
+    '2500' => 68,
576 575
   ]
577 576
 ];
578 577
 ENV::setPub(
@@ -667,9 +666,7 @@ $Categories = [
667 666
   'Documents',
668 667
   'Machine Data',
669 668
 ];
670
-
671 669
 $GroupedCategories = $Categories;
672
-#$CategoryIcons = ['music.png', 'apps.png', 'ebook.png', 'audiobook.png', 'elearning.png', 'comedy.png', 'comics.png'];
673 670
 
674 671
 # Plain Formats
675 672
 $PlainFormats = [
@@ -687,7 +684,6 @@ $PlainFormats = [
687 684
 
688 685
 # Platforms
689 686
 $SeqPlatforms = [
690
-#$Media = [
691 687
   # DNA
692 688
   'Complete Genomics',
693 689
   'cPAS-BGI/MGI',
@@ -712,7 +708,6 @@ $SeqPlatforms = [
712 708
 # Sequence Formats
713 709
 # https://www.ncbi.nlm.nih.gov/sra/docs/submitformats/
714 710
 $SeqFormats = [
715
-#$Containers = [
716 711
   'BAM'        => ['bam'],
717 712
   'CRAM'       => ['cram'],
718 713
   'EMBL'       => ['embl'],
@@ -738,7 +733,6 @@ $SeqFormats = [
738 733
 # DON'T PARSE RAW FILES. TOO MANY COMPETING VENDORS
739 734
 # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3518119/
740 735
 $ProtFormats = [
741
-#$ContainersProt = [
742 736
   'ABI/Sciex'      => ['t2d', 'wiff'],
743 737
   'APML'           => ['apml'],
744 738
   'ASF'            => ['asf'],
@@ -829,7 +823,6 @@ $GraphTxtFormats = [
829 823
 
830 824
 # Image Platforms
831 825
 $ImgPlatforms = [
832
-#$MediaManga = [
833 826
   'CT/CAT',
834 827
   'ECG',
835 828
   'Elastography',
@@ -848,7 +841,6 @@ $ImgPlatforms = [
848 841
 # Image Formats
849 842
 # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3948928/
850 843
 $ImgFormats = [
851
-#$ContainersGames = [
852 844
   'Analyze'   => ['hdr', 'img'],
853 845
   'Interfile' => ['h33'],
854 846
   'DICOM'     => ['dcm', 'dicom'],
@@ -968,6 +960,7 @@ $Archives = [
968 960
   'gzip'     => ['gz', 'gzip', 'tgz', 'tpz'],
969 961
   'Pickle'   => ['pickle', 'pkl'],
970 962
   'RAR'      => ['rar', 'rev'],
963
+  'tar'      => ['tar'],
971 964
   'ZIP'      => ['zip', 'zipx'],
972 965
   'None'     => [''],
973 966
 ];
@@ -995,13 +988,68 @@ $Codecs = [
995 988
   'Other',
996 989
 ];
997 990
 
998
-# Scopes
991
+# Resolutions
999 992
 $Resolutions = [
993
+  'Nano',
994
+  'Micro',
995
+  'Milli',
996
+  'Centi',
997
+  'Kilo',
998
+  'Mega',
999
+  'Giga',
1000
+  'Tera',
1001
+];
1002
+
1003
+$SeqResolutions = [
1000 1004
   'Contig',
1001 1005
   'Scaffold',
1002 1006
   'Chromosome',
1003
-  'Whole Genome',
1004
-  'Other',
1007
+  'Genome',
1008
+  'Proteome',
1009
+  'Transcriptome',
1010
+];
1011
+
1012
+$LocResolutions = [
1013
+  'Organization',
1014
+  'Locality',
1015
+  'State',
1016
+  'Province',
1017
+  'Country',
1018
+  'Continent',
1019
+  'World',
1020
+];
1021
+
1022
+$XmlResolutions = [
1023
+  'Value',
1024
+  'Attribute',
1025
+  'Group',
1026
+  'Element',
1027
+  'Schema',
1028
+];
1029
+
1030
+$ScalarResolutions = [
1031
+  'Area',
1032
+  'Density',
1033
+  'Distance',
1034
+  'Energy',
1035
+  'Mass',
1036
+  'Speed',
1037
+  'Temperature',
1038
+  'Time',
1039
+  'Volume',
1040
+  'Work',
1041
+];
1042
+
1043
+$VectorResolutions = [
1044
+  'Acceleration',
1045
+  'Displacement',
1046
+  'Force',
1047
+  'Polarization',
1048
+  'Momentum',
1049
+  'Position',
1050
+  'Thrust',
1051
+  'Velocity',
1052
+  'Weight',
1005 1053
 ];
1006 1054
 
1007 1055
 # Collage categories

+ 3
- 2
classes/imagetools.class.php View File

@@ -16,12 +16,13 @@ class ImageTools
16 16
     public static function process($Url = '', $Thumb = false)
17 17
     {
18 18
         $ENV = ENV::go();
19
+        $Psk = $ENV->getPriv('IMAGE_PSK');
19 20
 
20 21
         if (!$Url) {
21 22
             return '';
22 23
         }
23 24
         
24
-        if (preg_match('/^https:\/\/('.SITE_DOMAIN.'|'.$ENV->IMAGE_DOMAIN.')\//', $Url) || $Url[0] === '/') {
25
+        if (preg_match('/^https:\/\/('.$ENV->SITE_DOMAIN.'|'.$ENV->IMAGE_DOMAIN.')\//', $Url) || $Url[0] === '/') {
25 26
             if (strpos($Url, '?') === false) {
26 27
                 $Url .= '?';
27 28
             }
@@ -31,7 +32,7 @@ class ImageTools
31 32
             . $ENV->IMAGE_DOMAIN
32 33
             . ($Thumb?"/$Thumb/":'/')
33 34
             . '?h='
34
-            . rawurlencode(base64_encode(hash_hmac('sha256', $Url, IMAGE_PSK, true)))
35
+            . rawurlencode(base64_encode(hash_hmac('sha256', $Url, $Psk, true)))
35 36
             . '&i='
36 37
             . urlencode($Url);
37 38
         }

+ 0
- 1492
classes/torrent_form.class.NEW.2020-12-10.php
File diff suppressed because it is too large
View File


+ 9
- 24
classes/torrent_form.class.php View File

@@ -82,8 +82,6 @@ class TorrentForm
82 82
         $this->ImgPlatforms = $ImgPlatforms;
83 83
         $this->DocPlatforms = $DocPlatforms;
84 84
         $this->RawPlatforms = $RawPlatforms;
85
-        #$this->Media = $Media;
86
-        #$this->MediaManga = $MediaManga;
87 85
        
88 86
         # Formats
89 87
         # See classes/config.php
@@ -97,22 +95,12 @@ class TorrentForm
97 95
         $this->BinDocFormats = $BinDocFormats;
98 96
         $this->CpuGenFormats = $CpuGenFormats;
99 97
         $this->PlainFormats = $PlainFormats;
100
-        #$this->Containers = $Containers;
101
-        #$this->ContainersGames = $ContainersGames;
102
-        #$this->ContainersProt = $ContainersProt;
103
-        #$this->ContainersExtra = $ContainersExtra;
104 98
         
105 99
         # Misc
106 100
         $this->Codecs = $Codecs;
107 101
         $this->Archives = $Archives;
108 102
         $this->Resolutions = $Resolutions;
109 103
 
110
-        # Deprecated
111
-        #$this->ArchivesManga = $ArchivesManga;
112
-        #$this->Formats = $Formats;
113
-        #$this->Bitrates = $Bitrates;
114
-        #$this->Platform = $Platform;
115
-
116 104
         # Quick constructor test
117 105
         if ($this->Torrent && $this->Torrent['GroupID']) {
118 106
             $this->Disabled = ' readonly="readonly"';
@@ -263,8 +251,7 @@ HTML;
263 251
         <input type="hidden" name="submit" value="true" />
264 252
         <input type="hidden" name="auth" value="$AuthKey" />
265 253
 HTML;
266
-        
267
-        
254
+
268 255
         if (!$this->NewTorrent) {
269 256
             # Edit form hidden fields
270 257
             $TorrentID = display_str($this->TorrentID);
@@ -296,7 +283,6 @@ HTML;
296 283
 HTML;
297 284
             }
298 285
         } # else
299
-    
300 286
 
301 287
         /**
302 288
          * Start printing the torrent form
@@ -305,6 +291,7 @@ HTML;
305 291
         return $HTML;
306 292
     }
307 293
 
294
+
308 295
     /**
309 296
      * New torrent options: file
310 297
      */
@@ -393,7 +380,6 @@ HTML;
393 380
         $Torrent = $this->Torrent;
394 381
         echo '<table class="torrent_form>';
395 382
 
396
-
397 383
         /**
398 384
          * Freeleech type
399 385
          */
@@ -428,7 +414,6 @@ HTML;
428 414
                 <select name="freeleechtype">
429 415
 HTML;
430 416
 
431
-
432 417
                 /**
433 418
                  * Freeleech reasons
434 419
                  */
@@ -450,7 +435,6 @@ HTML;
450 435
             }
451 436
         } # fi !NewTorrent
452 437
 
453
-
454 438
         /**
455 439
          * Rules notice
456 440
          */
@@ -481,7 +465,6 @@ HTML;
481 465
         
482 466
         echo '</aside></td></tr>';
483 467
 
484
-
485 468
         /**
486 469
          * Submit button
487 470
          */
@@ -515,15 +498,17 @@ HTML;
515 498
         $ENV = ENV::go();
516 499
 
517 500
         $QueryID = G::$DB->get_query_id();
518
-        #$this->head();
519
-        #echo $this->basicInfo();
520 501
         $Torrent = $this->Torrent;
521
-        
502
+
503
+        # Moved to their own functions
504
+        #echo $this->head();
505
+        #echo $this->basicInfo();
506
+
522 507
         # Start printing the form
523 508
         echo '<h2 class="header">Torrent Form</h2>';
524 509
         echo '<table class="torrent_form">';
525 510
 
526
-
511
+        
527 512
         /**
528 513
          * Accession Number
529 514
          *
@@ -911,7 +896,7 @@ HTML;
911 896
          * Takes an ID, label, torrent, and media list.
912 897
          * Returns a media select option as on upload.php.
913 898
          */
914
-        function mediaSelect($trID = '', $Label = '', $Torrent = [], $Media = [])
899
+        function mediaSelect($trID = '', $Label = '', $Torrent = [], $Media = [], $Desc = '')
915 900
         {
916 901
             echo <<<HTML
917 902
                 <tr id="$trID">

+ 2
- 3
sections/ajax/torrentgroupalbumart.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+declare(strict_types=1);
2 3
 
3 4
 require SERVER_ROOT.'/sections/torrents/functions.php';
4 5
 
@@ -11,12 +12,10 @@ $TorrentDetails = get_group_info($GroupID, true, 0, false);
11 12
 $TorrentDetails = $TorrentDetails[0];
12 13
 $Image = $TorrentDetails['WikiImage'];
13 14
 
14
-/*
15 15
 // Handle no artwork
16 16
 if (!$Image) {
17
-    $Image = STATIC_SERVER.'common/noartwork/'.$CategoryIcons[$TorrentDetails['CategoryID'] - 1];
17
+    $Image = STATIC_SERVER.'common/noartwork/music.png';
18 18
 }
19
-*/
20 19
 
21 20
 json_die('success', array(
22 21
   'picture' => $Image

+ 2
- 2
sections/bookmarks/torrents.php View File

@@ -255,7 +255,7 @@ foreach ($GroupIDs as $GroupID) {
255 255
     <?php if (!$WikiImage) {
256 256
         $WikiImage = STATIC_SERVER.'common/noartwork/music.png';
257 257
     } ?>
258
-    
258
+
259 259
     <img class="tooltip"
260 260
       src="<?=ImageTools::process($WikiImage, 'thumb')?>"
261 261
       alt="<?=$DisplayName?>"
@@ -316,8 +316,8 @@ View::show_header($Title, 'browse,collage,wall');
316 316
 <!--content-->
317 317
 <?php
318 318
   View::show_footer();
319
-  error();
320 319
 } ?>
320
+
321 321
 <div class="sidebar">
322 322
   <div class="box box_info box_statistics_bookmarked_torrents">
323 323
     <div class="head"><strong>Stats</strong></div>

+ 1
- 1
sections/index/private.php View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 $ENV = ENV::go();
5 5
 Text::$TOC = true;
6
-$NewsCount = 3;
6
+$NewsCount = 1;
7 7
 
8 8
 if (!$News = $Cache->get_value('news')) {
9 9
     $DB->query("

+ 58
- 48
sections/tools/managers/bans.php View File

@@ -1,36 +1,40 @@
1 1
 <?php
2
+#declare(strict_types=1);
3
+
4
+$ENV = ENV::go();
5
+
2 6
 if (!check_perms('admin_manage_ipbans')) {
3
-  error(403);
7
+    error(403);
4 8
 }
5 9
 
6 10
 if (isset($_POST['submit'])) {
7
-  authorize();
11
+    authorize();
8 12
 
9
-  $IPA = substr($_POST['start'], 0, strcspn($_POST['start'], '.'));
10
-  if ($_POST['submit'] == 'Delete') { //Delete
11
-    if (!is_number($_POST['id']) || $_POST['id'] == '') {
12
-      error(0);
13
-    }
14
-    $DB->query('DELETE FROM ip_bans WHERE ID='.$_POST['id']);
15
-    $Cache->delete_value('ip_bans_'.$IPA);
16
-  } else { //Edit & Create, Shared Validation
17
-    $Val->SetFields('start', '1','regex','You must include the starting IP address.',array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
18
-    $Val->SetFields('end', '1','regex','You must include the ending IP address.',array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
19
-    $Val->SetFields('notes', '1','string','You must include the reason for the ban.');
20
-    $Err=$Val->ValidateForm($_POST); // Validate the form
21
-    if ($Err) {
22
-      error($Err);
23
-    }
13
+    $IPA = substr($_POST['start'], 0, strcspn($_POST['start'], '.'));
14
+    if ($_POST['submit'] == 'Delete') { //Delete
15
+        if (!is_number($_POST['id']) || $_POST['id'] == '') {
16
+            error(0);
17
+        }
18
+        $DB->query('DELETE FROM ip_bans WHERE ID='.$_POST['id']);
19
+        $Cache->delete_value('ip_bans_'.$IPA);
20
+    } else { //Edit & Create, Shared Validation
21
+        $Val->SetFields('start', '1', 'regex', 'You must include the starting IP address.', array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
22
+        $Val->SetFields('end', '1', 'regex', 'You must include the ending IP address.', array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
23
+        $Val->SetFields('notes', '1', 'string', 'You must include the reason for the ban.');
24
+        $Err=$Val->ValidateForm($_POST); // Validate the form
25
+        if ($Err) {
26
+            error($Err);
27
+        }
24 28
 
25
-    $Notes = db_string($_POST['notes']);
26
-    $Start = Tools::ip_to_unsigned($_POST['start']); //Sanitized by Validation regex
29
+        $Notes = db_string($_POST['notes']);
30
+        $Start = Tools::ip_to_unsigned($_POST['start']); //Sanitized by Validation regex
27 31
     $End = Tools::ip_to_unsigned($_POST['end']); //See above
28 32
 
29 33
     if ($_POST['submit'] == 'Edit') { //Edit
30
-      if (empty($_POST['id']) || !is_number($_POST['id'])) {
31
-        error(404);
32
-      }
33
-      $DB->query("
34
+        if (empty($_POST['id']) || !is_number($_POST['id'])) {
35
+            error(404);
36
+        }
37
+        $DB->query("
34 38
         UPDATE ip_bans
35 39
         SET
36 40
           FromIP=$Start,
@@ -38,14 +42,14 @@ if (isset($_POST['submit'])) {
38 42
           Reason='$Notes'
39 43
         WHERE ID='".$_POST['id']."'");
40 44
     } else { //Create
41
-      $DB->query("
45
+        $DB->query("
42 46
         INSERT INTO ip_bans
43 47
           (FromIP, ToIP, Reason)
44 48
         VALUES
45 49
           ('$Start','$End', '$Notes')");
46 50
     }
47
-    $Cache->delete_value('ip_bans_'.$IPA);
48
-  }
51
+        $Cache->delete_value('ip_bans_'.$IPA);
52
+    }
49 53
 }
50 54
 
51 55
 define('BANS_PER_PAGE', '20');
@@ -61,15 +65,15 @@ $sql = "
61 65
   FROM ip_bans ";
62 66
 
63 67
 if (!empty($_REQUEST['notes'])) {
64
-  $sql .= "WHERE Reason LIKE '%".db_string($_REQUEST['notes'])."%' ";
68
+    $sql .= "WHERE Reason LIKE '%".db_string($_REQUEST['notes'])."%' ";
65 69
 }
66 70
 
67
-if (!empty($_REQUEST['ip']) && preg_match('/'.IP_REGEX.'/', $_REQUEST['ip'])) {
68
-  if (!empty($_REQUEST['notes'])) {
69
-    $sql .= "AND '".Tools::ip_to_unsigned($_REQUEST['ip'])."' BETWEEN FromIP AND ToIP ";
70
-  } else {
71
-    $sql .= "WHERE '".Tools::ip_to_unsigned($_REQUEST['ip'])."' BETWEEN FromIP AND ToIP ";
72
-  }
71
+if (!empty($_REQUEST['ip']) && preg_match('/'.$ENV->IP_REGEX.'/', $_REQUEST['ip'])) {
72
+    if (!empty($_REQUEST['notes'])) {
73
+        $sql .= "AND '".Tools::ip_to_unsigned($_REQUEST['ip'])."' BETWEEN FromIP AND ToIP ";
74
+    } else {
75
+        $sql .= "WHERE '".Tools::ip_to_unsigned($_REQUEST['ip'])."' BETWEEN FromIP AND ToIP ";
76
+    }
73 77
 }
74 78
 
75 79
 $sql .= "ORDER BY FromIP ASC";
@@ -95,12 +99,14 @@ $DB->set_query_id($Bans);
95 99
         <td class="label"><label for="ip">IP address:</label></td>
96 100
         <td>
97 101
           <input type="hidden" name="action" value="ip_ban" />
98
-          <input type="search" id="ip" name="ip" size="20" value="<?=(!empty($_GET['ip']) ? display_str($_GET['ip']) : '')?>" />
102
+          <input type="search" id="ip" name="ip" size="20"
103
+            value="<?=(!empty($_GET['ip']) ? display_str($_GET['ip']) : '')?>" />
99 104
         </td>
100 105
         <td class="label"><label for="notes">Notes:</label></td>
101 106
         <td>
102 107
           <input type="hidden" name="action" value="ip_ban" />
103
-          <input type="search" id="notes" name="notes" size="60" value="<?=(!empty($_GET['notes']) ? display_str($_GET['notes']) : '')?>" />
108
+          <input type="search" id="notes" name="notes" size="60"
109
+            value="<?=(!empty($_GET['notes']) ? display_str($_GET['notes']) : '')?>" />
104 110
         </td>
105 111
         <td>
106 112
           <input type="submit" value="Search" />
@@ -113,12 +119,13 @@ $DB->set_query_id($Bans);
113 119
 
114 120
 <h3>Manage</h3>
115 121
 <div class="linkbox">
116
-<?=$PageLinks?>
122
+  <?=$PageLinks?>
117 123
 </div>
118 124
 <table width="100%">
119 125
   <tr class="colhead">
120 126
     <td colspan="2">
121
-      <span class="tooltip" title="The IP addresses specified are &#42;inclusive&#42;. The left box is the beginning of the IP address range, and the right box is the end of the IP address range.">Range</span>
127
+      <span class="tooltip"
128
+        title="The IP addresses specified are &#42;inclusive&#42;. The left box is the beginning of the IP address range, and the right box is the end of the IP address range.">Range</span>
122 129
     </td>
123 130
     <td>Notes</td>
124 131
     <td>Submit</td>
@@ -126,7 +133,8 @@ $DB->set_query_id($Bans);
126 133
   <tr class="row">
127 134
     <form class="create_form" name="ban" action="" method="post">
128 135
       <input type="hidden" name="action" value="ip_ban" />
129
-      <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
136
+      <input type="hidden" name="auth"
137
+        value="<?=$LoggedUser['AuthKey']?>" />
130 138
       <td colspan="2">
131 139
         <input type="text" size="12" name="start" />
132 140
         <input type="text" size="12" name="end" />
@@ -139,22 +147,24 @@ $DB->set_query_id($Bans);
139 147
       </td>
140 148
     </form>
141 149
   </tr>
142
-<?
150
+  <?php
143 151
 while (list($ID, $Start, $End, $Reason) = $DB->next_record()) {
144
-  $Start = long2ip($Start);
145
-  $End = long2ip($End);
146
-?>
152
+    $Start = long2ip($Start);
153
+    $End = long2ip($End); ?>
147 154
   <tr class="row">
148 155
     <form class="manage_form" name="ban" action="" method="post">
149 156
       <input type="hidden" name="id" value="<?=$ID?>" />
150 157
       <input type="hidden" name="action" value="ip_ban" />
151
-      <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
158
+      <input type="hidden" name="auth"
159
+        value="<?=$LoggedUser['AuthKey']?>" />
152 160
       <td colspan="2">
153
-        <input type="text" size="12" name="start" value="<?=$Start?>" />
161
+        <input type="text" size="12" name="start"
162
+          value="<?=$Start?>" />
154 163
         <input type="text" size="12" name="end" value="<?=$End?>" />
155 164
       </td>
156 165
       <td>
157
-        <input type="text" size="72" name="notes" value="<?=$Reason?>" />
166
+        <input type="text" size="72" name="notes"
167
+          value="<?=$Reason?>" />
158 168
       </td>
159 169
       <td>
160 170
         <input type="submit" name="submit" value="Edit" />
@@ -162,11 +172,11 @@ while (list($ID, $Start, $End, $Reason) = $DB->next_record()) {
162 172
       </td>
163 173
     </form>
164 174
   </tr>
165
-<?
175
+  <?php
166 176
 }
167 177
 ?>
168 178
 </table>
169 179
 <div class="linkbox">
170
-<?=$PageLinks?>
180
+  <?=$PageLinks?>
171 181
 </div>
172
-<? View::show_footer(); ?>
182
+<?php View::show_footer();

+ 0
- 4
sections/upload/upload_handle.php View File

@@ -8,10 +8,6 @@
8 8
 // the data to the database and the torrent to the disk.                      //
9 9
 //****************************************************************************//
10 10
 
11
-// https://php.net/upload-max-filesize
12
-ini_set('upload_max_filesize', 2097152); // 2 MiB
13
-ini_set('max_file_uploads', 10000);
14
-
15 11
 include SERVER_ROOT.'/classes/validate.class.php';
16 12
 include SERVER_ROOT.'/classes/feed.class.php';
17 13
 include SERVER_ROOT.'/sections/torrents/functions.php';

+ 3
- 1
sections/user/advancedsearch.php View File

@@ -1,8 +1,10 @@
1 1
 <?php
2 2
 #declare(strict_types = 1);
3 3
 
4
+$ENV = ENV::go();
5
+
4 6
 if (!empty($_GET['search'])) {
5
-    if (preg_match('/^'.IP_REGEX.'$/', $_GET['search'])) {
7
+    if (preg_match('/^'.$ENV->IP_REGEX.'$/', $_GET['search'])) {
6 8
         $_GET['ip'] = $_GET['search'];
7 9
     } elseif (preg_match('/^'.EMAIL_REGEX.'$/i', $_GET['search'])) {
8 10
         $_GET['email'] = $_GET['search'];

+ 3
- 107
static/functions/upload.js View File

@@ -17,9 +17,9 @@ function Categories() {
17 17
     'series', // Location
18 18
     'year', // Year
19 19
     'codec', // License
20
-    // Platform changes below
21
-    'resolution', // Scope
22
-    // Format changes below
20
+    // Platform *changes below*
21
+    'resolution', // Scope *changes below*
22
+    // Format *changes below*
23 23
     'archive', // Archive
24 24
     'tags', // Tags
25 25
     'cover', // Picture
@@ -118,36 +118,6 @@ function Categories() {
118 118
 }
119 119
 
120 120
 
121
-/**
122
- * Bitrate
123
- */
124
-function Bitrate() {
125
-  /*
126
-  $('#other_bitrate').raw().value = '';
127
-  if ($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') {
128
-    $('#other_bitrate_span').gshow();
129
-  } else {
130
-    $('#other_bitrate_span').ghide();
131
-  }
132
-  */
133
-}
134
-
135
-
136
-/**
137
- * AltBitrate
138
- */
139
-function AltBitrate() {
140
-  /*
141
-  if ($('#other_bitrate').raw().value >= 320) {
142
-    $('#vbr').raw().disabled = true;
143
-    $('#vbr').raw().checked = false;
144
-  } else {
145
-    $('#vbr').raw().disabled = false;
146
-  }
147
-  */
148
-}
149
-
150
-
151 121
 /**
152 122
  * add_tag
153 123
  */
@@ -419,80 +389,6 @@ function RemoveScreenshotField(el) {
419 389
 }
420 390
 
421 391
 
422
-/**
423
- * CheckVA
424
- */
425
-function CheckVA() {
426
-  /*
427
-  if ($('#artist').raw().value.toLowerCase().trim().match(/^(va|various(\sa|a)rtis(t|ts)|various)$/)) {
428
-    $('#vawarning').gshow();
429
-  } else {
430
-    $('#vawarning').ghide();
431
-  }
432
-  */
433
-}
434
-
435
-
436
-/**
437
- * CheckYear
438
- */
439
-function CheckYear() {
440
-  /*
441
-  var media = $('#media').raw().options[$('#media').raw().selectedIndex].text;
442
-  if (media == "---" || media == "Vinyl" || media == "Soundboard" || media == "Cassette") {
443
-    media = "old";
444
-  }
445
-  var year = $('#year').val();
446
-  var unknown = $('#unknown').prop('checked');
447
-  if (year < 1982 && year != '' && media != "old" && !unknown) {
448
-    $('#yearwarning').gshow();
449
-    $('#remaster').raw().checked = true;
450
-    $('#remaster_true').gshow();
451
-  } else if (unknown) {
452
-    $('#remaster').raw().checked = true;
453
-    $('#yearwarning').ghide();
454
-    $('#remaster_true').gshow();
455
-  } else {
456
-    $('#yearwarning').ghide();
457
-  }
458
-  */
459
-}
460
-
461
-
462
-/**
463
- * ToggleUnknown
464
- */
465
-function ToggleUnknown() {
466
-  /*
467
-  if ($('#unknown').raw().checked) {
468
-    $('#remaster_year').raw().value = "";
469
-    $('#remaster_title').raw().value = "";
470
-    $('#remaster_record_label').raw().value = "";
471
-    $('#remaster_catalogue_number').raw().value = "";
472
-
473
-    if ($('#groupremasters').raw()) {
474
-      $('#groupremasters').raw().selectedIndex = 0;
475
-      $('#groupremasters').raw().disabled = true;
476
-    }
477
-
478
-    $('#remaster_year').raw().disabled = true;
479
-    $('#remaster_title').raw().disabled = true;
480
-    $('#remaster_record_label').raw().disabled = true;
481
-    $('#remaster_catalogue_number').raw().disabled = true;
482
-  } else {
483
-    $('#remaster_year').raw().disabled = false;
484
-    $('#remaster_title').raw().disabled = false;
485
-    $('#remaster_record_label').raw().disabled = false;
486
-    $('#remaster_catalogue_number').raw().disabled = false;
487
-
488
-    if ($('#groupremasters').raw()) {
489
-      $('#groupremasters').raw().disabled = false;
490
-    }
491
-  }
492
-  */
493
-}
494
-
495
-
496 392
 /**
497 393
  * AnimeAutofill
498 394
  */

Loading…
Cancel
Save