2 Commits

Author SHA1 Message Date
  biotorrents 34a2337a54 Many small pre-update fixes 4 years ago
  biotorrents 48e3ea4aac Add basic bioinformatics support 4 years ago

+ 69
- 50
classes/config.template.php View File

@@ -1,4 +1,3 @@
1
-
2 1
 <?php
3 2
 declare(strict_types=1);
4 3
 
@@ -56,15 +55,15 @@ ENV::setPub('DEV', true);
56 55
 ENV::setPub(
57 56
     'SITE_NAME',
58 57
     (!$ENV->DEV
59
-        ? 'BioTorrents.de' # Production
60
-        : '[Dev] BioTorrents.de') # Development
58
+        ? 'torrents.bio' # Production
59
+        : 'dev.torrents.bio') # Development
61 60
 );
62 61
 
63 62
 # Meta description
64 63
 ENV::setPub('DESCRIPTION', 'A platform to share biological sequence and medical imaging data');
65 64
 
66 65
 # Navigation glyphs
67
-ENV::setPub('SEP', ''); # e.g., News ⸬ BioTorrents.de
66
+ENV::setPub('SEP', '-'); # e.g., News ⸬ BioTorrents.de
68 67
 ENV::setPub('CRUMB', '›'); # e.g., Forums › Board › Thread
69 68
 
70 69
 # The FQDN of your site, e.g., dev.biotorrents.de
@@ -81,6 +80,15 @@ ENV::setPub(
81 80
         : 'dev.biotorrents.de') # Development
82 81
 );
83 82
 
83
+# Old domain, to handle the biotorrents.de => torrents.bio migration
84
+# If not needed, simply set to the same values as $ENV->SITE_DOMAIN
85
+ENV::setPub(
86
+    'OLD_SITE_DOMAIN',
87
+    (!$ENV->DEV
88
+        ? 'biotorrents.de' # Production
89
+        : 'dev.biotorrents.de') # Development
90
+);
91
+
84 92
 # The FQDN of your image host, e.g., pics.biotorrents.de
85 93
 ENV::setPub('IMAGE_DOMAIN', 'pics.biotorrents.de');
86 94
 
@@ -127,6 +135,7 @@ ENV::setPub('SRI', 'sha384');
127 135
  * Tech support
128 136
  */
129 137
 
138
+ /*
130 139
 $TechSupport = [
131 140
   'Email' => 'help@biotorrents.de',
132 141
   'Subject' => '[TxID '.strtoupper(bin2hex(random_bytes(2))).'] Specific subject line with TxID intact',
@@ -136,6 +145,7 @@ ENV::setPub(
136 145
     'HELP',
137 146
     $ENV->convert($TechSupport)
138 147
 );
148
+*/
139 149
 
140 150
 
141 151
 /**
@@ -380,7 +390,8 @@ ENV::setPub('FEATURE_SEND_EMAIL', true);
380 390
 # (should only be used for initial setup)
381 391
 ENV::setPub('FEATURE_SET_ENC_KEY_PUBLIC', false);
382 392
 
383
-# Attempt to support the Seqhash algorithm
393
+# Attempt to support the BioPHP library
394
+# https://packagist.org/packages/biotorrents/biophp
384 395
 # https://blog.libredna.org/post/seqhash/
385 396
 ENV::setPub('FEATURE_BIOPHP', true);
386 397
 
@@ -831,6 +842,9 @@ $DB = [
831 842
     'version' => ['name' => 'Version', 'desc' => 'Start with 0.1.0', 'note' => 'Please see <a href="https://semver.org" target="_blank">Semantic Versioning</a>'],
832 843
     'license' => ['name' => 'License', 'desc' => '', 'note' => 'Please see <a href="http://www.dcc.ac.uk/resources/how-guides/license-research-data" target="_blank">How to License Research Data</a>'],
833 844
     'mirrors' => ['name' => 'Mirrors', 'desc' => 'Up to two FTP/HTTP addresses that either point directly to a file, or for multi-file torrents, to the enclosing folder'],
845
+
846
+    # Original fields
847
+    'seqhash' => ['name' => 'Seqhash', 'desc' => 'Sample genome sequence in FASTA format (GenBank pending)', 'note' => 'Please see <a href="https://blog.libredna.org/post/seqhash/" target="_blank">The Seqhash Algorithm</a>'],
834 848
 ];
835 849
 ENV::setPub(
836 850
     'DB',
@@ -971,10 +985,23 @@ $META = [
971 985
         'Plain' => [
972 986
             'CSV'   => ['csv'], # 3
973 987
             'JSON'  => ['json'], # 3
974
-            'Text'  => ['txt'], # 3
988
+            'Text'  => ['txt', 'asc'], # 3
975 989
             'XML'   => ['xml'], # etc.
976 990
         ],
977 991
 
992
+        /**
993
+         * 2.
994
+         * Databases
995
+         */
996
+        'Databases' => [
997
+            'MS SQL'   => ['mdf', 'ndf', 'ldf'],
998
+            'MySQL'   => ['sql', 'mysql'],
999
+            'Oracle' => ['dbf', 'ora', 'oraenv'],
1000
+            'IBM Db2' => ['ixf', 'del', 'cursor'],
1001
+            'Postgres' => ['sql']
1002
+        ],
1003
+
1004
+
978 1005
         /**
979 1006
          * 2.
980 1007
          * Archives
@@ -1330,16 +1357,11 @@ $CATS = [
1330 1357
         'Icon' => "$CatIcons/sequences.png",
1331 1358
         'Description' => "For data that's ACGT, ACGU, amino acid letters on disk.",
1332 1359
         'Platforms' => $ENV->META->Platforms->Sequences,
1333
-        'Formats' => array_merge([
1334
-            /*
1335
-            'Sequences' => $ENV->META->Formats->Sequences,
1336
-            'Proteins' => $ENV->META->Formats->Proteins,
1337
-            'Plain' => $ENV->META->Formats->Plain,
1338
-            */
1360
+        'Formats' => [
1339 1361
             $ENV->META->Formats->Sequences,
1340 1362
             $ENV->META->Formats->Proteins,
1341 1363
             $ENV->META->Formats->Plain,
1342
-        ]),
1364
+        ],
1343 1365
     ],
1344 1366
 
1345 1367
     2 => [
@@ -1349,9 +1371,9 @@ $CATS = [
1349 1371
         'Description' => 'For pathway and regulatory network data, structured taxonomies, etc.',
1350 1372
         'Platforms' => $ENV->META->Platforms->Graphs,
1351 1373
         'Formats' => [
1352
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1353
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1354
-            'Plain' => $ENV->META->Formats->Plain,
1374
+            $ENV->META->Formats->GraphXml,
1375
+            $ENV->META->Formats->GraphTxt,
1376
+            $ENV->META->Formats->Plain,
1355 1377
         ],
1356 1378
     ],
1357 1379
 
@@ -1362,9 +1384,9 @@ $CATS = [
1362 1384
         'Description' => 'For data that examines one facet broadly, not one subject deeply.',
1363 1385
         'Platforms' => $ENV->META->Platforms->Graphs,
1364 1386
         'Formats' => [
1365
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1366
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1367
-            'Plain' => $ENV->META->Formats->Plain,
1387
+            $ENV->META->Formats->GraphXml,
1388
+            $ENV->META->Formats->GraphTxt,
1389
+            $ENV->META->Formats->Plain,
1368 1390
         ],
1369 1391
     ],
1370 1392
 
@@ -1375,9 +1397,9 @@ $CATS = [
1375 1397
         'Description' => "For structured data (XML, etc.) that describes the subject's orientation in space.",
1376 1398
         'Platforms' => $ENV->META->Platforms->Graphs,
1377 1399
         'Formats' => [
1378
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1379
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1380
-            'Plain' => $ENV->META->Formats->Plain,
1400
+            $ENV->META->Formats->GraphXml,
1401
+            $ENV->META->Formats->GraphTxt,
1402
+            $ENV->META->Formats->Plain,
1381 1403
         ],
1382 1404
     ],
1383 1405
 
@@ -1388,9 +1410,9 @@ $CATS = [
1388 1410
         'Description' => 'For data that describes observations over time and/or space.',
1389 1411
         'Platforms' => $ENV->META->Platforms->Graphs,
1390 1412
         'Formats' => [
1391
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1392
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1393
-            'Plain' => $ENV->META->Formats->Plain,
1413
+            $ENV->META->Formats->GraphXml,
1414
+            $ENV->META->Formats->GraphTxt,
1415
+            $ENV->META->Formats->Plain,
1394 1416
         ],
1395 1417
     ],
1396 1418
 
@@ -1401,9 +1423,9 @@ $CATS = [
1401 1423
         'Description' => 'For data that describes recurring structures in nature such as common pathways or motifs in the proteome or metabolome.',
1402 1424
         'Platforms' => $ENV->META->Platforms->Graphs,
1403 1425
         'Formats' => [
1404
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1405
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1406
-            'Plain' => $ENV->META->Formats->Plain,
1426
+            $ENV->META->Formats->GraphXml,
1427
+            $ENV->META->Formats->GraphTxt,
1428
+            $ENV->META->Formats->Plain,
1407 1429
         ],
1408 1430
     ],
1409 1431
 
@@ -1414,9 +1436,9 @@ $CATS = [
1414 1436
         'Description' => 'For data that records experimental control behavior, checks readings against known physical constants, tracks the thermodynamic limits of reactions, etc.',
1415 1437
         'Platforms' => $ENV->META->Platforms->Graphs,
1416 1438
         'Formats' => [
1417
-            'GraphXml' => $ENV->META->Formats->GraphXml,
1418
-            'GraphTxt' => $ENV->META->Formats->GraphTxt,
1419
-            'Plain' => $ENV->META->Formats->Plain,
1439
+            $ENV->META->Formats->GraphXml,
1440
+            $ENV->META->Formats->GraphTxt,
1441
+            $ENV->META->Formats->Plain,
1420 1442
         ],
1421 1443
     ],
1422 1444
 
@@ -1427,9 +1449,8 @@ $CATS = [
1427 1449
         'Description' => 'For data you can look at!',
1428 1450
         'Platforms' => $ENV->META->Platforms->Images,
1429 1451
         'Formats' => [
1430
-            'ImgRaster' => $ENV->META->Formats->ImgRaster,
1431
-            'ImgVector' => $ENV->META->Formats->ImgVector,
1432
-            'Plain' => $ENV->META->Formats->Plain,
1452
+            $ENV->META->Formats->ImgRaster,
1453
+            $ENV->META->Formats->ImgVector,
1433 1454
         ],
1434 1455
     ],
1435 1456
 
@@ -1440,11 +1461,10 @@ $CATS = [
1440 1461
         'Description' => "For data that's limited to specific locations or otherwise describes macroscopic space.",
1441 1462
         'Platforms' => $ENV->META->Platforms->Graphs,
1442 1463
         'Formats' => [
1443
-            'MapRaster' => $ENV->META->Formats->MapRaster,
1444
-            'MapVector' => $ENV->META->Formats->MapVector,
1445
-            'ImgRaster' => $ENV->META->Formats->ImgRaster,
1446
-            'ImgVector' => $ENV->META->Formats->ImgVector,
1447
-            'Plain' => $ENV->META->Formats->Plain,
1464
+            $ENV->META->Formats->MapRaster,
1465
+            $ENV->META->Formats->MapVector,
1466
+            $ENV->META->Formats->ImgRaster,
1467
+            $ENV->META->Formats->ImgVector,
1448 1468
         ],
1449 1469
     ],
1450 1470
 
@@ -1455,11 +1475,10 @@ $CATS = [
1455 1475
         'Description' => 'For projections, simulations, and other hypothetical or computer-generated data.',
1456 1476
         'Platforms' => $ENV->META->Platforms->Graphs,
1457 1477
         'Formats' => [
1458
-            'MapRaster' => $ENV->META->Formats->MapRaster,
1459
-            'MapVector' => $ENV->META->Formats->MapVector,
1460
-            'ImgRaster' => $ENV->META->Formats->ImgRaster,
1461
-            'ImgVector' => $ENV->META->Formats->ImgVector,
1462
-            'Plain' => $ENV->META->Formats->Plain,
1478
+            $ENV->META->Formats->MapRaster,
1479
+            $ENV->META->Formats->MapVector,
1480
+            $ENV->META->Formats->ImgRaster,
1481
+            $ENV->META->Formats->ImgVector,
1463 1482
         ],
1464 1483
     ],
1465 1484
 
@@ -1470,9 +1489,9 @@ $CATS = [
1470 1489
         'Description' => 'For documentation, software, disk images, and literature datasets.',
1471 1490
         'Platforms' => $ENV->META->Platforms->Documents,
1472 1491
         'Formats' => [
1473
-            'BinDoc' => $ENV->META->Formats->BinDoc,
1474
-            'CpuGen' => $ENV->META->Formats->CpuGen,
1475
-            'Plain' => $ENV->META->Formats->Plain,
1492
+            $ENV->META->Formats->BinDoc,
1493
+            $ENV->META->Formats->CpuGen,
1494
+            $ENV->META->Formats->Plain,
1476 1495
         ],
1477 1496
     ],
1478 1497
 
@@ -1483,7 +1502,7 @@ $CATS = [
1483 1502
         'Description' => 'For raw reads and machine data of any category.',
1484 1503
         'Platforms' => $ENV->META->Platforms->Raw,
1485 1504
         'Formats' => [
1486
-            'Plain' => $ENV->META->Formats->Plain,
1505
+            $ENV->META->Formats->Plain,
1487 1506
         ],
1488 1507
     ],
1489 1508
 ];
@@ -1501,10 +1520,10 @@ ENV::setPub(
1501 1520
  */
1502 1521
 
1503 1522
 // resource_type://username:password@domain:port/path?query_string#anchor
1504
-define('RESOURCE_REGEX', '(https?|ftps?):\/\/');
1523
+define('RESOURCE_REGEX', '(https?|ftps?|dat|ipfs):\/\/');
1505 1524
 ENV::setPub(
1506 1525
     'RESOURCE_REGEX',
1507
-    '(https?|ftps?):\/\/'
1526
+    '(https?|ftps?|dat|ipfs):\/\/'
1508 1527
 );
1509 1528
 
1510 1529
 define('IP_REGEX', '(\d{1,3}\.){3}\d{1,3}');

+ 2
- 1
classes/security.class.php View File

@@ -21,7 +21,8 @@ class Security
21 21
     {
22 22
         foreach ($IDs as $ID) {
23 23
             if (!ID || !is_int($ID) || $ID < 1) {
24
-                error("Expected an integer > 1, got $ID in Security::checkInt.");
24
+                return "Expected an integer > 1, got $ID in Security::checkInt.";
25
+                #error("Expected an integer > 1, got $ID in Security::checkInt.");
25 26
             }
26 27
         }
27 28
 

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

@@ -137,7 +137,7 @@ class Text
137 137
     public function fix_links($Parsed) {
138 138
             # Replace links to $ENV->SITE_DOMAIN
139 139
             $Parsed = preg_replace(
140
-                "/<a href=\"$ENV->RESOURCE_REGEX$ENV->SITE_DOMAIN\//",
140
+                "/<a href=\"$ENV->RESOURCE_REGEX($ENV->SITE_DOMAIN|$ENV->OLD_SITE_DOMAIN)\//",
141 141
                 '<a href="/',
142 142
                 $Parsed
143 143
             );

+ 6
- 1
classes/util.php View File

@@ -508,7 +508,12 @@ function json_print($Status, $Message)
508 508
         $response = ['status' => $Status, 'response' => []];
509 509
     }
510 510
 
511
-    print(json_encode(add_json_info($response)));
511
+    print(
512
+        json_encode(
513
+            add_json_info($response),
514
+            JSON_UNESCAPED_SLASHES
515
+        )
516
+    );
512 517
 }
513 518
 
514 519
 /**

+ 28
- 52
classes/validate.class.php View File

@@ -46,6 +46,34 @@
46 46
 
47 47
 class Validate
48 48
 {
49
+    /**
50
+     * mirrors
51
+     *
52
+     * @param string $String The raw textarea, e.g., from torrent_form.class.php
53
+     * @param string $Regex  The regex to test against, e.g., from $ENV
54
+     * @return array An array of unique values that match the regex
55
+     */
56
+    public function textarea2array(string $String, string $Regex)
57
+    {
58
+        $ENV = ENV::go();
59
+
60
+        $String = array_map(
61
+            'trim',
62
+            explode(
63
+                "\n",
64
+                $String
65
+            )
66
+        );
67
+        
68
+        return array_unique(
69
+            preg_grep(
70
+                "/^$Regex$/i",
71
+                $String
72
+            )
73
+        );
74
+    }
75
+
76
+    
49 77
     /**
50 78
      * title
51 79
      *
@@ -245,58 +273,6 @@ class Validate
245 273
     }
246 274
 
247 275
 
248
-    /**
249
-     * Make input
250
-     * https://www.w3schools.com/html/html_form_input_types.asp
251
-     *
252
-     * Generate a secure HTML input element.
253
-     * Takes $Type, $Name (also used for id), and $Classes.
254
-     * Outputs a hardened input with the requested attributes.
255
-     *
256
-     * todo: See if this could work, one ugly switch for all forms in sections/
257
-     */
258
-
259
-    public function MakeInput($Type = 'text', $Name = '', $Classes = [])
260
-    {
261
-        if (!is_str($Type) || !is_str($Name)) {
262
-            error('$Type and $Name must be strings');
263
-        }
264
-
265
-        # Intentionally double quoted PHP constructing $HTML
266
-        # <input type='text' id='title_jp' name='title_jp' class='one two'
267
-        $HTML  = "";
268
-        $HTML .= "<input type='$Type' id='$Name' name='$Name'";
269
-        $HTML .= (!empty($Classes)) ? " class='" . implode(' ', $Classes) . "'" : "";
270
-
271
-        /*
272
-        'button'
273
-        'checkbox'
274
-        'color'
275
-        'date'
276
-        'datetime-local'
277
-        'email'
278
-        'file'
279
-        'hidden'
280
-        'image'
281
-        'month'
282
-        'number'
283
-        'password'
284
-        'radio'
285
-        'range'
286
-        'reset'
287
-        'search'
288
-        'submit'
289
-        'tel'
290
-        'text'
291
-        'time'
292
-        'url'
293
-        'week'
294
-        */
295
-                
296
-        return;
297
-    }
298
-    
299
-
300 276
     /**
301 277
      * Legacy class
302 278
      */

+ 31
- 29
composer.lock View File

@@ -776,16 +776,16 @@
776 776
         },
777 777
         {
778 778
             "name": "symfony/config",
779
-            "version": "v5.3.3",
779
+            "version": "v5.3.4",
780 780
             "source": {
781 781
                 "type": "git",
782 782
                 "url": "https://github.com/symfony/config.git",
783
-                "reference": "a69e0c55528b47df88d3c4067ddedf32d485d662"
783
+                "reference": "4268f3059c904c61636275182707f81645517a37"
784 784
             },
785 785
             "dist": {
786 786
                 "type": "zip",
787
-                "url": "https://api.github.com/repos/symfony/config/zipball/a69e0c55528b47df88d3c4067ddedf32d485d662",
788
-                "reference": "a69e0c55528b47df88d3c4067ddedf32d485d662",
787
+                "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37",
788
+                "reference": "4268f3059c904c61636275182707f81645517a37",
789 789
                 "shasum": ""
790 790
             },
791 791
             "require": {
@@ -793,7 +793,7 @@
793 793
                 "symfony/deprecation-contracts": "^2.1",
794 794
                 "symfony/filesystem": "^4.4|^5.0",
795 795
                 "symfony/polyfill-ctype": "~1.8",
796
-                "symfony/polyfill-php80": "^1.15",
796
+                "symfony/polyfill-php80": "^1.16",
797 797
                 "symfony/polyfill-php81": "^1.22"
798 798
             },
799 799
             "conflict": {
@@ -835,7 +835,7 @@
835 835
             "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
836 836
             "homepage": "https://symfony.com",
837 837
             "support": {
838
-                "source": "https://github.com/symfony/config/tree/v5.3.3"
838
+                "source": "https://github.com/symfony/config/tree/v5.3.4"
839 839
             },
840 840
             "funding": [
841 841
                 {
@@ -851,20 +851,20 @@
851 851
                     "type": "tidelift"
852 852
                 }
853 853
             ],
854
-            "time": "2021-06-24T08:13:00+00:00"
854
+            "time": "2021-07-21T12:40:44+00:00"
855 855
         },
856 856
         {
857 857
             "name": "symfony/console",
858
-            "version": "v5.3.2",
858
+            "version": "v5.3.4",
859 859
             "source": {
860 860
                 "type": "git",
861 861
                 "url": "https://github.com/symfony/console.git",
862
-                "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
862
+                "reference": "ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1"
863 863
             },
864 864
             "dist": {
865 865
                 "type": "zip",
866
-                "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
867
-                "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
866
+                "url": "https://api.github.com/repos/symfony/console/zipball/ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1",
867
+                "reference": "ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1",
868 868
                 "shasum": ""
869 869
             },
870 870
             "require": {
@@ -872,11 +872,12 @@
872 872
                 "symfony/deprecation-contracts": "^2.1",
873 873
                 "symfony/polyfill-mbstring": "~1.0",
874 874
                 "symfony/polyfill-php73": "^1.8",
875
-                "symfony/polyfill-php80": "^1.15",
875
+                "symfony/polyfill-php80": "^1.16",
876 876
                 "symfony/service-contracts": "^1.1|^2",
877 877
                 "symfony/string": "^5.1"
878 878
             },
879 879
             "conflict": {
880
+                "psr/log": ">=3",
880 881
                 "symfony/dependency-injection": "<4.4",
881 882
                 "symfony/dotenv": "<5.1",
882 883
                 "symfony/event-dispatcher": "<4.4",
@@ -884,10 +885,10 @@
884 885
                 "symfony/process": "<4.4"
885 886
             },
886 887
             "provide": {
887
-                "psr/log-implementation": "1.0"
888
+                "psr/log-implementation": "1.0|2.0"
888 889
             },
889 890
             "require-dev": {
890
-                "psr/log": "~1.0",
891
+                "psr/log": "^1|^2",
891 892
                 "symfony/config": "^4.4|^5.0",
892 893
                 "symfony/dependency-injection": "^4.4|^5.0",
893 894
                 "symfony/event-dispatcher": "^4.4|^5.0",
@@ -933,7 +934,7 @@
933 934
                 "terminal"
934 935
             ],
935 936
             "support": {
936
-                "source": "https://github.com/symfony/console/tree/v5.3.2"
937
+                "source": "https://github.com/symfony/console/tree/v5.3.4"
937 938
             },
938 939
             "funding": [
939 940
                 {
@@ -949,7 +950,7 @@
949 950
                     "type": "tidelift"
950 951
                 }
951 952
             ],
952
-            "time": "2021-06-12T09:42:48+00:00"
953
+            "time": "2021-07-26T16:33:26+00:00"
953 954
         },
954 955
         {
955 956
             "name": "symfony/deprecation-contracts",
@@ -1020,21 +1021,22 @@
1020 1021
         },
1021 1022
         {
1022 1023
             "name": "symfony/filesystem",
1023
-            "version": "v5.3.3",
1024
+            "version": "v5.3.4",
1024 1025
             "source": {
1025 1026
                 "type": "git",
1026 1027
                 "url": "https://github.com/symfony/filesystem.git",
1027
-                "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9"
1028
+                "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32"
1028 1029
             },
1029 1030
             "dist": {
1030 1031
                 "type": "zip",
1031
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/19b71c8f313b411172dd5f470fd61f24466d79a9",
1032
-                "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9",
1032
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32",
1033
+                "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32",
1033 1034
                 "shasum": ""
1034 1035
             },
1035 1036
             "require": {
1036 1037
                 "php": ">=7.2.5",
1037
-                "symfony/polyfill-ctype": "~1.8"
1038
+                "symfony/polyfill-ctype": "~1.8",
1039
+                "symfony/polyfill-php80": "^1.16"
1038 1040
             },
1039 1041
             "type": "library",
1040 1042
             "autoload": {
@@ -1062,7 +1064,7 @@
1062 1064
             "description": "Provides basic utilities for the filesystem",
1063 1065
             "homepage": "https://symfony.com",
1064 1066
             "support": {
1065
-                "source": "https://github.com/symfony/filesystem/tree/v5.3.3"
1067
+                "source": "https://github.com/symfony/filesystem/tree/v5.3.4"
1066 1068
             },
1067 1069
             "funding": [
1068 1070
                 {
@@ -1078,7 +1080,7 @@
1078 1080
                     "type": "tidelift"
1079 1081
                 }
1080 1082
             ],
1081
-            "time": "2021-06-30T07:27:52+00:00"
1083
+            "time": "2021-07-21T12:40:44+00:00"
1082 1084
         },
1083 1085
         {
1084 1086
             "name": "symfony/polyfill-ctype",
@@ -3934,16 +3936,16 @@
3934 3936
         },
3935 3937
         {
3936 3938
             "name": "theseer/tokenizer",
3937
-            "version": "1.2.0",
3939
+            "version": "1.2.1",
3938 3940
             "source": {
3939 3941
                 "type": "git",
3940 3942
                 "url": "https://github.com/theseer/tokenizer.git",
3941
-                "reference": "75a63c33a8577608444246075ea0af0d052e452a"
3943
+                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
3942 3944
             },
3943 3945
             "dist": {
3944 3946
                 "type": "zip",
3945
-                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
3946
-                "reference": "75a63c33a8577608444246075ea0af0d052e452a",
3947
+                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
3948
+                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
3947 3949
                 "shasum": ""
3948 3950
             },
3949 3951
             "require": {
@@ -3972,7 +3974,7 @@
3972 3974
             "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
3973 3975
             "support": {
3974 3976
                 "issues": "https://github.com/theseer/tokenizer/issues",
3975
-                "source": "https://github.com/theseer/tokenizer/tree/master"
3977
+                "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
3976 3978
             },
3977 3979
             "funding": [
3978 3980
                 {
@@ -3980,7 +3982,7 @@
3980 3982
                     "type": "github"
3981 3983
                 }
3982 3984
             ],
3983
-            "time": "2020-07-12T23:59:07+00:00"
3985
+            "time": "2021-07-28T10:34:58+00:00"
3984 3986
         },
3985 3987
         {
3986 3988
             "name": "webmozart/assert",

+ 3
- 1
design/privateheader.php View File

@@ -333,11 +333,13 @@ if (isset(G::$LoggedUser['SearchType']) && G::$LoggedUser['SearchType']) { // Ad
333 333
             size="17">
334 334
         </form>
335 335
 
336
+        <!--
336 337
         <form class="search_form" name="artists" action="artist.php" method="get">
337
-          <input id="artistsearch" <?=Users::has_autocomplete_enabled('search')?>
338
+          <input id="artistsearch" <?=null#Users::has_autocomplete_enabled('search')?>
338 339
           aria-label="Search authors" accesskey="a" spellcheck="false" autocomplete="off" placeholder="Authors"
339 340
           type="text" name="artistname" size="17">
340 341
         </form>
342
+          -->
341 343
 
342 344
         <form class="search_form" name="requests" action="requests.php" method="get">
343 345
           <input id="requestssearch" aria-label="Search requests" spellcheck="false" autocomplete="off"

+ 21
- 16
gazelle.sql View File

@@ -143,6 +143,20 @@ CREATE TABLE `badges` (
143 143
 ) ENGINE=InnoDB CHARSET=utf8mb4;
144 144
 
145 145
 
146
+-- 2021-07-28
147
+CREATE TABLE `bioinformatics` (
148
+  `id` int NOT NULL AUTO_INCREMENT,
149
+  `torrent_id` int NOT NULL,
150
+  `user_id` int NOT NULL,
151
+  `timestamp` datetime NOT NULL,
152
+  `name` varchar(255) DEFAULT NULL,
153
+  `seqhash` varchar(100) DEFAULT NULL,
154
+  `gc_content` tinyint DEFAULT NULL,
155
+  `monoisotopic_mass` double DEFAULT NULL,
156
+  PRIMARY KEY (`id`,`torrent_id`,`user_id`) 
157
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
158
+
159
+
146 160
 -- 2020-03-09
147 161
 CREATE TABLE `blog` (
148 162
   `ID` int unsigned NOT NULL AUTO_INCREMENT,
@@ -1241,23 +1255,14 @@ CREATE TABLE `torrents_recommended` (
1241 1255
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1242 1256
 
1243 1257
 
1244
-CREATE TABLE `torrents_doi` (
1245
-  `ID` int NOT NULL AUTO_INCREMENT,
1246
-  `TorrentID` int NOT NULL,
1247
-  `UserID` int NOT NULL,
1248
-  `Time` datetime,
1249
-  `URI` varchar(255) NOT NULL,
1250
-  PRIMARY KEY (`ID`,`GroupID`,`URI`)
1251
-) ENGINE=InnoDB CHARSET=utf8mb4;
1252
-
1253
-
1258
+-- 2021-07-28
1254 1259
 CREATE TABLE `torrents_mirrors` (
1255
-  `ID` int NOT NULL AUTO_INCREMENT,
1256
-  `GroupID` int NOT NULL,
1257
-  `UserID` int NOT NULL,
1258
-  `Time` datetime,
1259
-  `URI` varchar(255) NOT NULL,
1260
-  PRIMARY KEY (`ID`,`GroupID`,`URI`)
1260
+  `id` int NOT NULL AUTO_INCREMENT,
1261
+  `torrent_id` int NOT NULL,
1262
+  `user_id` int NOT NULL,
1263
+  `timestamp` datetime,
1264
+  `uri` varchar(255) NOT NULL,
1265
+  PRIMARY KEY (`id`,`torrent_id`,`uri`)
1261 1266
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1262 1267
 
1263 1268
 

+ 1
- 1
readme.md View File

@@ -25,7 +25,7 @@ BioTorrents.de supports an array of
25 25
 with the appropriate bold/italic glyphs and monospace.
26 26
 These options are available to every theme.
27 27
 Font Awesome 5 is also universally available.
28
-[Download the fonts](https://docs.biotorrents.de/dl/fonts.tgz).
28
+[Download the fonts](https://torrents.bio/fonts.tgz).
29 29
 
30 30
 ## Markdown support
31 31
 

+ 10
- 10
sections/api/torrents/group.php View File

@@ -81,15 +81,15 @@ $JsonTorrentDetails = [
81 81
     'id'            => (int) $TorrentDetails['id'],
82 82
     'identifier'    => $TorrentDetails['identifier'],
83 83
 
84
-    'category_id'   => (int) $TorrentDetails['category_id'],
85
-    'category_name' => $CategoryName,
84
+    'categoryId'   => (int) $TorrentDetails['category_id'],
85
+    'categoryName' => $CategoryName,
86 86
 
87 87
     'title'         => $TorrentDetails['title'],
88 88
     'subject'       => $TorrentDetails['subject'],
89 89
     'object'        => $TorrentDetails['object'],
90 90
 
91 91
     'authors'       => $Artists,
92
-    'published'     => (int) $TorrentDetails['published'],
92
+    'year'          => (int) $TorrentDetails['year'],
93 93
     'workgroup'     => $TorrentDetails['workgroup'],
94 94
     'location'      => $TorrentDetails['location'],
95 95
 
@@ -99,7 +99,7 @@ $JsonTorrentDetails = [
99 99
     'description'   => $TorrentDetails['description'],
100 100
    #'description'   => Text::full_format($TorrentDetails['description']),
101 101
     'picture'       => $TorrentDetails['picture'],
102
-    'tag_list'      => $TagList,
102
+    'tagList'      => $TagList,
103 103
 
104 104
     'bookmarked'    => Bookmarks::has_bookmarked('torrent', $GroupID),
105 105
     'timestamp'     => $TorrentDetails['timestamp'],
@@ -128,7 +128,7 @@ foreach ($TorrentList as $Torrent) {
128 128
     # todo: Update DB schema
129 129
     $JsonTorrentList[] = [
130 130
         'id'           => (int) $Torrent['ID'],
131
-        'info_hash'    => $Torrent['InfoHash'],
131
+        'infoHash'    => $Torrent['InfoHash'],
132 132
         'description'  => $Torrent['Description'],
133 133
 
134 134
         'platform'     => $Torrent['Media'],
@@ -139,19 +139,19 @@ foreach ($TorrentList as $Torrent) {
139 139
 
140 140
         'size'         => (int) $Torrent['Size'],
141 141
         'archive'      => $Torrent['Archive'],
142
-        'file_count'   => (int) $Torrent['FileCount'],
143
-        'file_path'    => $Torrent['FilePath'],
144
-        'file_list'    => $FileList,
142
+        'fileCount'   => (int) $Torrent['FileCount'],
143
+        'filePath'    => $Torrent['FilePath'],
144
+        'fileList'    => $FileList,
145 145
 
146 146
         'seeders'      => (int) $Torrent['Seeders'],
147 147
         'leechers'     => (int) $Torrent['Leechers'],
148 148
         'snatched'     => (int) $Torrent['Snatched'],
149
-        'free_torrent' => ($Torrent['FreeTorrent'] === 1),
149
+        'freeTorrent' => ($Torrent['FreeTorrent'] === 1),
150 150
 
151 151
         'reported'     => (bool) $Torrent['Reported'],
152 152
         'time'         => $Torrent['Time'],
153 153
 
154
-        'user_id'      => (int) ($Torrent['Anonymous'] ? 0 : $Torrent['UserID']),
154
+        'userId'      => (int) ($Torrent['Anonymous'] ? 0 : $Torrent['UserID']),
155 155
         'username'     => ($Torrent['Anonymous'] ? 'Anonymous' : $Userinfo['Username']),
156 156
     ];
157 157
 }

+ 5
- 5
sections/api/torrents/torrent.php View File

@@ -1,5 +1,5 @@
1 1
 <?php
2
-declare(strict_types=1);
2
+#declare(strict_types=1);
3 3
 
4 4
 require_once SERVER_ROOT.'/sections/torrents/functions.php';
5 5
 
@@ -54,13 +54,13 @@ $JsonTorrentDetails = [
54 54
   'subject'     => $TorrentDetails['subject'],
55 55
   'object'       => $TorrentDetails['object'],
56 56
   'authors'      => $Artists,
57
-  'published'         => (int) $TorrentDetails['published'],
57
+  'year'         => (int) $TorrentDetails['published'],
58 58
   'identifier'    => $TorrentDetails['identifier'],
59
-  'category_id'   => (int) $TorrentDetails['category_id'],
60
-  'icategory_name' => $CategoryName,
59
+  'categoryId'   => (int) $TorrentDetails['category_id'],
60
+  'icategoryName' => $CategoryName,
61 61
   'timestamp'         => $TorrentDetails['timestamp'],
62 62
   'bookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
63
-  'tag_list'         => $TagList
63
+  'tagList'         => $TagList
64 64
 ];
65 65
 
66 66
 $Torrent = $TorrentList[$TorrentID];

+ 1
- 1
sections/forums/search.php View File

@@ -229,7 +229,7 @@ if (empty($ThreadID)) {
229 229
     </tr>
230 230
     <tr>
231 231
       <td colspan="2" class="center">
232
-        <input type="submit" value="Search" />
232
+        <input type="submit" class="button-primary" value="Search" />
233 233
       </td>
234 234
     </tr>
235 235
     </table>

+ 6
- 6
sections/torrents/editgroup.php View File

@@ -43,14 +43,14 @@ list($title, $subject, $object, $Image, $Body, $picture, $description, $publishe
43 43
 
44 44
 $DB->prepare_query("
45 45
 SELECT
46
-  `ID`,
47
-  `UserID`,
48
-  `Time`,
49
-  `URI`
46
+  `id`,
47
+  `user_id`,
48
+  `timestamp`,
49
+  `doi`
50 50
 FROM
51
-  `torrents_doi`
51
+  `literature`
52 52
 WHERE
53
-  `TorrentID` = '$group_id'
53
+  `group_id` = '$group_id'
54 54
 ");
55 55
 $DB->exec_prepared_query();
56 56
 

+ 12
- 11
sections/torrents/functions.php View File

@@ -58,14 +58,14 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0, $PersonalProp
58 58
         # Screenshots (Publications)
59 59
         $DB->query("
60 60
         SELECT
61
-          `ID`,
62
-          `UserID`,
63
-          `Time`,
64
-          `URI`
61
+          `id`,
62
+          `user_id`,
63
+          `timestamp`,
64
+          `doi`
65 65
         FROM
66
-          `torrents_doi`
66
+          `literature`
67 67
         WHERE
68
-          `TorrentID` = '$GroupID'
68
+          `group_id` = '$GroupID'
69 69
         ");
70 70
 
71 71
         if ($DB->has_results()) {
@@ -75,16 +75,17 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0, $PersonalProp
75 75
         }
76 76
 
77 77
         # Mirrors
78
+        # todo: Fix $GroupID
78 79
         $DB->query("
79 80
         SELECT
80
-          `ID`,
81
-          `UserID`,
82
-          `Time`,
83
-          `URI`
81
+          `id`,
82
+          `user_id`,
83
+          `timestamp`,
84
+          `uri`
84 85
         FROM
85 86
           `torrents_mirrors`
86 87
         WHERE
87
-          `GroupID` = '$GroupID'
88
+          `torrent_id` = '$GroupID'
88 89
         ");
89 90
   
90 91
         if ($DB->has_results()) {

+ 8
- 8
sections/torrents/screenshotedit.php View File

@@ -36,12 +36,12 @@ if (count($Screenshots) > 10) {
36 36
 
37 37
 $DB->query("
38 38
 SELECT
39
-  `UserID`,
40
-  `URI`
39
+  `user_id`,
40
+  `doi`
41 41
 FROM
42
-  `torrents_doi`
42
+  `literature`
43 43
 WHERE
44
-  `TorrentID` = '$GroupID'
44
+  `group_id` = '$GroupID'
45 45
 ");
46 46
 
47 47
 // $Old is an array of the form URL => UserID where UserID is the ID of the User who originally uploaded that image.
@@ -81,9 +81,9 @@ if (!empty($Deleted)) {
81 81
         $DB->prepare_query("
82 82
         DELETE
83 83
         FROM
84
-          `torrents_doi`
84
+          `literature`
85 85
         WHERE
86
-          `URI` = '$ScreenDel'
86
+          `doi` = '$ScreenDel'
87 87
         ");
88 88
 
89 89
         foreach ($DeleteList as $ScreenDel) {
@@ -100,8 +100,8 @@ if (!empty($New)) {
100 100
     $Screenshot = '';
101 101
     $DB->prepare_query(
102 102
         "
103
-    INSERT INTO `torrents_doi`
104
-      (`TorrentID`, `UserID`, `Time`, `URI`)
103
+    INSERT INTO `literature`
104
+      (`group_id`, `user_id`, `timestamp`, `doi`)
105 105
     VALUES
106 106
       (?, ?, NOW(), ?)",
107 107
         $GroupID,

+ 97
- 60
sections/upload/upload_handle.php View File

@@ -79,6 +79,7 @@ $Properties['GroupDescription'] = trim($_POST['album_desc']);
79 79
 $Properties['TorrentDescription'] = $_POST['release_desc'];
80 80
 $Properties['Screenshots'] = isset($_POST['screenshots']) ? $_POST['screenshots'] : '';
81 81
 $Properties['Mirrors'] = isset($_POST['mirrors']) ? $_POST['mirrors'] : '';
82
+$Properties['Seqhash'] = isset($_POST['seqhash']) ? $_POST['seqhash'] : '';
82 83
 
83 84
 if ($_POST['album_desc']) {
84 85
     $Properties['GroupDescription'] = trim($_POST['album_desc']);
@@ -209,7 +210,7 @@ if (!$_POST['groupid']) {
209 210
         '1',
210 211
         'inarray',
211 212
         'Please select a valid platform.',
212
-        array('inarray' => $ENV->flatten($ENV->META->Platforms))
213
+        array('inarray' => $ENV->META->Platforms)
213 214
     );
214 215
 
215 216
     /*
@@ -438,8 +439,8 @@ if ($T['GroupID']) {
438 439
     FROM
439 440
       `torrents_group`
440 441
     WHERE
441
-      `id` = $T[GroupID]
442
-    ");
442
+      `id` = ?
443
+    ", $T['GroupID']);
443 444
     $DB->exec_prepared_query();
444 445
 
445 446
     if ($DB->has_results()) {
@@ -516,7 +517,7 @@ if ((!isset($GroupID) || !$GroupID)) {
516 517
 
517 518
 if (!isset($GroupID) || !$GroupID) {
518 519
     // Create torrent group
519
-    $DB->prepare_query(
520
+    $DB->query(
520 521
         "
521 522
       INSERT INTO torrents_group
522 523
         (`category_id`, `title`, `subject`, `object`, `year`,
@@ -526,7 +527,7 @@ if (!isset($GroupID) || !$GroupID) {
526 527
         ( ?, ?, ?, ?, ?,
527 528
           ?, ?, ?, NOW(),
528 529
           ?, ? )",
529
-        $TypeID,
530
+        $T['CategoryID'],
530 531
         $T['Title'],
531 532
         $T['Title2'],
532 533
         $T['TitleJP'],
@@ -537,7 +538,6 @@ if (!isset($GroupID) || !$GroupID) {
537 538
         $Body,
538 539
         $T['Image']
539 540
     );
540
-    $DB->exec_prepared_query();
541 541
 
542 542
     $GroupID = $DB->inserted_id();
543 543
     foreach ($ArtistForm as $Num => $Artist) {
@@ -550,67 +550,33 @@ if (!isset($GroupID) || !$GroupID) {
550 550
     }
551 551
     $Cache->increment('stats_group_count');
552 552
 
553
-    // Add screenshots
554
-    // todo: Clear DB_MYSQL::exec_prepared_query() errors
555
-    $Screenshots = explode("\n", $T['Screenshots']);
556
-    $Screenshots = array_map('trim', $Screenshots);
557
-
558
-    $Screenshots = array_filter($Screenshots, function ($s) {
559
-        return preg_match('/^'.$ENV->DOI_REGEX.'$/i', $s);
560
-    });
561
-
562
-    $Screenshots = array_unique($Screenshots);
563
-    $Screenshots = array_slice($Screenshots, 0, 10);
564
-
565
-    # Add optional web seeds similar to screenshots
566
-    # Support an arbitrary and limited number of sources
567
-    $Mirrors = explode("\n", $T['Mirrors']);
568
-    $Mirrors = array_map('trim', $Mirrors);
569
-
570
-    $Mirrors = array_filter($Mirrors, function ($s) {
571
-        return preg_match('/^'.URL_REGEX.'$/i', $s);
572
-    });
573
-
574
-    $Mirrors = array_unique($Mirrors);
575
-    $Mirrors = array_slice($Mirrors, 0, 2);
576
-
577
-    # Downgrade TLS on resource URIs
578
-    # Required for BEP 19 compatibility
579
-    $Mirrors = str_ireplace('tps://', 'tp://', $Mirrors);
580
-
581
-    # Perform the DB inserts here
582
-    # Screenshots (Publications)
583
-    if (!empty($Screenshots)) {
584
-        $Screenshot = '';
585
-        $DB->prepare_query("
586
-          INSERT INTO torrents_doi
587
-            (TorrentID, UserID, Time, URI)
588
-          VALUES (?, ?, NOW(), ?)", $GroupID, $LoggedUser['ID'], $Screenshot);
589
-
590
-        foreach ($Screenshots as $Screenshot) {
591
-            $DB->exec_prepared_query();
592
-        }
593
-    }
594 553
 
595
-    # Mirrors
596
-    if (!empty($Mirrors)) {
597
-        $Mirror = '';
598
-        $DB->prepare_query("
599
-          INSERT INTO torrents_mirrors
600
-            (GroupID, UserID, Time, URI)
601
-          VALUES (?, ?, NOW(), ?)", $GroupID, $LoggedUser['ID'], $Mirror);
554
+    /**
555
+     * DOI numbers
556
+     *
557
+     * Add optional citation info.
558
+     * todo: Query Semantic Scholar in the scheduler.
559
+     * THESE ARE ASSOCIATED WITH TORRENT GROUPS.s
560
+     */
561
+    if (!empty($T['Screenshots'])) {
562
+        $Screenshots = $Validate->textarea2array($T['Screenshots'], $ENV->DOI_REGEX);
563
+        $Screenshots = array_slice($Screenshots, 0, 10);
602 564
 
603
-        foreach ($Mirrors as $Mirror) {
604
-            $DB->exec_prepared_query();
565
+        foreach ($Screenshots as $Screenshot) {
566
+            $DB->query("
567
+            INSERT INTO `literature`
568
+            (`group_id`, `user_id`, `timestamp`, `doi`)
569
+          VALUES (?, ?, NOW(), ?)", $GroupID, $LoggedUser['ID'], $Screenshot);
605 570
         }
606 571
     }
572
+}
607 573
 
608
-    # Main if/else
609
-} else {
574
+# Main if/else
575
+else {
610 576
     $DB->query("
611 577
       UPDATE torrents_group
612
-      SET Time = NOW()
613
-        WHERE ID = ?", $GroupID);
578
+      SET `timestamp` = NOW()
579
+        WHERE `id` = ?", $GroupID);
614 580
 
615 581
     $Cache->delete_value("torrent_group_$GroupID");
616 582
     $Cache->delete_value("torrents_details_$GroupID");
@@ -728,6 +694,77 @@ $TorrentID = $DB->inserted_id();
728 694
 $Cache->increment('stats_torrent_count');
729 695
 $Tor->Dec['comment'] = 'https://'.SITE_DOMAIN.'/torrents.php?torrentid='.$TorrentID;
730 696
 
697
+
698
+/**
699
+ * Mirrors
700
+ *
701
+ * Add optional web seeds and IPFS/Dat mirrors.
702
+ * Support an arbitrary and limited number of sources.
703
+ * THESE ARE ASSOCIATED WITH INDIVIDUAL TORRENTS.
704
+ */
705
+
706
+if (!empty($T['Mirrors'])) {
707
+    $Mirrors = $Validate->textarea2array($T['Mirrors'], $ENV->URL_REGEX);
708
+    $Screenshots = array_slice($Screenshots, 0, 5);
709
+
710
+    foreach ($Mirrors as $Mirror) {
711
+        $DB->query(
712
+            "
713
+        INSERT INTO `torrents_mirrors`
714
+          (`torrent_id`, `user_id`, `timestamp`, `uri`)
715
+        VALUES (?, ?, NOW(), ?)",
716
+            $TorrentID,
717
+            $LoggedUser['ID'],
718
+            $Mirror
719
+        );
720
+    }
721
+}
722
+
723
+
724
+/**
725
+ * Seqhash
726
+ *
727
+ * Elementary Seqhash support
728
+ */
729
+if ($ENV->FEATURE_BIOPHP && !empty($T['Seqhash'])) {
730
+    $BioIO = new \BioPHP\IO();
731
+    $BioSeqhash = new \BioPHP\Seqhash();
732
+
733
+    $Parsed = $BioIO->readFasta($T['Seqhash']);
734
+    foreach ($Parsed as $Parsed) {
735
+        try {
736
+            # todo: Trim sequences in \BioPHP\Transform->normalize()
737
+            $Trimmed = preg_replace('/\s+/', '', $Parsed['sequence']);
738
+            $Seqhash = $BioSeqhash->hash(
739
+                $Trimmed,
740
+                $_POST['seqhash_meta1'],
741
+                $_POST['seqhash_meta2'],
742
+                $_POST['seqhash_meta3']
743
+            );
744
+
745
+            $DB->query(
746
+                "
747
+            INSERT INTO `bioinformatics`
748
+              (`torrent_id`, `user_id`, `timestamp`,
749
+               `name`, `seqhash`)
750
+            VALUES (?, ?, NOW(), ?, ?)",
751
+                $TorrentID,
752
+                $LoggedUser['ID'],
753
+                $Parsed['name'],
754
+                $Seqhash
755
+            );
756
+        } catch (Exception $Err) {
757
+            $UploadForm = $Type;
758
+            require_once SERVER_ROOT.'/sections/upload/upload.php' ;
759
+            error($Err->getMessage(), $NoHTML = true);
760
+        }
761
+    }
762
+}
763
+
764
+
765
+/**
766
+ * Update tracker
767
+ */
731 768
 Tracker::update_tracker('add_torrent', [
732 769
   'id'          => $TorrentID,
733 770
   'info_hash'   => rawurlencode($InfoHash),

+ 2
- 2
sections/user/community_stats.php View File

@@ -162,8 +162,8 @@ list($UniqueGroups) = $DB->next_record();
162 162
   if ($Override = check_paranoia_here('screenshotcount')) {
163 163
       $DB->query("
164 164
     SELECT COUNT(*)
165
-    FROM torrents_doi
166
-    WHERE UserID = '$UserID'");
165
+    FROM `literature`
166
+    WHERE user_id = '$UserID'");
167 167
       list($Screenshots) = $DB->next_record(); ?>
168 168
                 <li id="comm_screenshots">Screenshots added: <?=number_format($Screenshots)?>
169 169
                 </li>

+ 2
- 2
sections/user/edit.php View File

@@ -156,7 +156,7 @@ $ProfileRewards = Donations::get_profile_rewards($UserID);
156 156
           </li>
157 157
 
158 158
           <li>
159
-            <input type="submit" id="submit" value="Save profile" />
159
+            <input type="submit" id="submit" class="button-primary" value="Save profile" />
160 160
           </li>
161 161
 
162 162
         </ul>
@@ -313,7 +313,7 @@ HTML;
313 313
           <td>
314 314
             <label>
315 315
               <input type="checkbox" name="autoload_comm_stats" <?Format::selected(
316
-              'AutoloadCommStats' ,
316
+              'AutoloadCommStats',
317 317
               1,
318 318
               'checked',
319 319
               $SiteOptions

+ 69
- 108
static/styles/beluga/scss/beluga.scss View File

@@ -3,107 +3,6 @@
3 3
     padding: 0;
4 4
 }
5 5
 
6
-.cats_sequences,
7
-.cats_graphs,
8
-.cats_systems,
9
-.cats_geometric,
10
-.cats_scalars\/vectors,
11
-.cats_patterns,
12
-.cats_constraints,
13
-.cats_images,
14
-.cats_spatial,
15
-.cats_models,
16
-.cats_documents,
17
-.cats_machinedata {
18
-    width: 38px !important;
19
-    height: 38px !important;
20
-    line-height: 38px;
21
-}
22
-
23
-.cats_sequences:after {
24
-    content: "SEQ";
25
-    color: #3eaca7;
26
-    font-size: 18px;
27
-    letter-spacing: -2px;
28
-}
29
-
30
-.cats_graphs:after {
31
-    content: "GRF";
32
-    color: #1d818e;
33
-    font-size: 18px;
34
-    letter-spacing: -2px;
35
-}
36
-
37
-.cats_systems:after {
38
-    content: "SYS";
39
-    color: #88c796;
40
-    font-size: 18px;
41
-    letter-spacing: -2px;
42
-}
43
-
44
-.cats_geometric:after {
45
-    content: "GEO";
46
-    color: #4dc593;
47
-    font-size: 18px;
48
-    letter-spacing: -2px;
49
-}
50
-
51
-.cats_scalars\/vectors:after {
52
-    content: "MC2";
53
-    color: #77c5d4;
54
-    font-size: 18px;
55
-    letter-spacing: -2px;
56
-}
57
-
58
-.cats_patterns:after {
59
-    content: "PAT";
60
-    color: #0d5968;
61
-    font-size: 18px;
62
-    letter-spacing: -2px;
63
-}
64
-
65
-.cats_constraints:after {
66
-    content: "CNST";
67
-    color: #3eaca7;
68
-    font-size: 18px;
69
-    letter-spacing: -2px;
70
-}
71
-
72
-.cats_images:after {
73
-    content: "IMG";
74
-    color: #1d818e;
75
-    font-size: 18px;
76
-    letter-spacing: -2px;
77
-}
78
-
79
-.cats_spatial:after {
80
-    content: "SPTL";
81
-    color: #88c796;
82
-    font-size: 18px;
83
-    letter-spacing: -2px;
84
-}
85
-
86
-.cats_models:after {
87
-    content: "MOD";
88
-    color: #4dc593;
89
-    font-size: 18px;
90
-    letter-spacing: -2px;
91
-}
92
-
93
-.cats_documents:after {
94
-    content: "DOC";
95
-    color: #77c5d4;
96
-    font-size: 18px;
97
-    letter-spacing: -2px;
98
-}
99
-
100
-.cats_machinedata:after {
101
-    content: "RAW";
102
-    color: #0d5968;
103
-    font-size: 18px;
104
-    letter-spacing: -2px;
105
-}
106
-
107 6
 body {
108 7
     width: 100%;
109 8
     font-family: "Open Sans", Helvetica, Arial, Tahoma, sans-serif;
@@ -197,6 +96,33 @@ input {
197 96
     color: #fff;
198 97
 }
199 98
 
99
+/* Buttons */
100
+button:not(.editor-toolbar button),
101
+input[type="button"],
102
+input[type="submit"] {
103
+    background: change-color(whitesmoke, $alpha: 0.75);
104
+    color: black;
105
+    border: 1px solid #bbb;
106
+
107
+    &.button-primary {
108
+        background: #50aca7;
109
+        border: 1px solid #bbb;
110
+        color: black;
111
+    }
112
+
113
+    &:hover {
114
+        background: #317f8e;
115
+        /* Primary hover default blue */
116
+        border: 1px solid #bbb !important;
117
+        color: black !important;
118
+    }
119
+
120
+    &:focus {
121
+        background: #2f707c;
122
+    }
123
+}
124
+
125
+/*
200 126
 button,
201 127
 input[type="button"],
202 128
 input[type="submit"] {
@@ -216,6 +142,7 @@ input[type="button"]:focus,
216 142
 input[type="submit"]:focus {
217 143
     background-color: #2f707c;
218 144
 }
145
+*/
219 146
 
220 147
 .spoilerButton {
221 148
     max-width: 604px;
@@ -351,11 +278,13 @@ ul.thin li {
351 278
     padding-top: 0;
352 279
 }
353 280
 
281
+/*
354 282
 .sidebar {
355 283
     float: right;
356 284
     width: 244px;
357 285
     height: 100%;
358 286
 }
287
+*/
359 288
 
360 289
 .sidebar .box .pad form {
361 290
     padding-bottom: 20px;
@@ -366,10 +295,12 @@ ul.thin li {
366 295
     padding: 5px 10px 10px 10px;
367 296
 }
368 297
 
298
+/*
369 299
 .main_column {
370 300
     width: 646px;
371 301
     float: left;
372 302
 }
303
+*/
373 304
 
374 305
 #logo {
375 306
     width: 900px;
@@ -386,7 +317,7 @@ ul.thin li {
386 317
 }
387 318
 
388 319
 #logo a::before {
389
-    content: "BioTorrents.de";
320
+    content: "torrents.bio";
390 321
     font-size: 40px;
391 322
     line-height: 56px;
392 323
     font-weight: 100;
@@ -1433,11 +1364,6 @@ blockquote {
1433 1364
     padding: 10px;
1434 1365
 }
1435 1366
 
1436
-blockquote,
1437
-pre {
1438
-    background-color: #23252a !important;
1439
-}
1440
-
1441 1367
 .signature {
1442 1368
     border-top: 1px dotted #666;
1443 1369
     margin: 2em 0 0;
@@ -1534,11 +1460,17 @@ ul .invitetree {
1534 1460
 
1535 1461
 pre {
1536 1462
     color: #fff;
1537
-    border: 1px dashed #55585f;
1463
+    background: black;
1464
+    border: 1px dashed #55585f !important;
1538 1465
     margin: 10px;
1539 1466
     padding: 10px;
1540 1467
 }
1541 1468
 
1469
+code {
1470
+    background: black;
1471
+    border: none;
1472
+}
1473
+
1542 1474
 #donation {
1543 1475
     position: absolute;
1544 1476
     display: inline;
@@ -1901,6 +1833,7 @@ div#gift {
1901 1833
     z-index: 999;
1902 1834
 }
1903 1835
 
1836
+/*
1904 1837
 .button {
1905 1838
     border: 0 solid #131313;
1906 1839
     color: #eee;
@@ -1911,6 +1844,7 @@ div#gift {
1911 1844
     text-transform: uppercase;
1912 1845
     padding: 5px 12px;
1913 1846
 }
1847
+*/
1914 1848
 
1915 1849
 #store #content {
1916 1850
     position: relative;
@@ -2312,6 +2246,32 @@ body.style_pink ::-moz-selection {
2312 2246
     background: #8b518e;
2313 2247
 }
2314 2248
 
2249
+/* Buttons */
2250
+body.style_pink button:not(.editor-toolbar button),
2251
+body.style_pink input[type="button"],
2252
+body.style_pink input[type="submit"] {
2253
+    color: black;
2254
+    border: 1px solid #bbb;
2255
+
2256
+    &.button-primary {
2257
+        background: #8b518e;
2258
+        border: 1px solid #bbb;
2259
+        color: black;
2260
+    }
2261
+
2262
+    &:hover {
2263
+        background: #643c72;
2264
+        /* Primary hover default blue */
2265
+        border: 1px solid #bbb !important;
2266
+        color: black !important;
2267
+    }
2268
+
2269
+    &:focus {
2270
+        background: #78467f;
2271
+    }
2272
+}
2273
+
2274
+/*
2315 2275
 body.style_pink button,
2316 2276
 body.style_pink input[type="button"],
2317 2277
 body.style_pink input[type="submit"] {
@@ -2329,6 +2289,7 @@ body.style_pink input[type="button"]:focus,
2329 2289
 body.style_pink input[type="submit"]:focus {
2330 2290
     background-color: #78467f;
2331 2291
 }
2292
+*/
2332 2293
 
2333 2294
 body.style_pink #userinfo_stats {
2334 2295
     color: #db7bc7;

+ 25
- 61
static/styles/bookish/matcha/matcha.scss View File

@@ -45,7 +45,6 @@ body.style_matcha {
45 45
         width: 100%;
46 46
         z-index: 99999;
47 47
         margin-top: 2.4em;
48
-        /* margin-top: 32px; */
49 48
         left: 0;
50 49
     }
51 50
 
@@ -172,59 +171,26 @@ body.style_matcha {
172 171
         z-index: 100;
173 172
     }
174 173
 
175
-    /* Alerts, Toolbox, etc. */
176
-    .alertbar {
177
-        background-color: #fff9c7;
178
-        text-align: center;
179
-        color: black;
180
-        font-weight: bold;
181
-        width: 320px;
182
-        margin: 2em auto;
183
-        padding: 1em;
184
-
185
-        a {
186
-            color: black;
187
-            text-decoration: none;
188
-
189
-            &:hover {
190
-                color: black;
191
-                text-decoration: underline;
192
-            }
193
-        }
194
-
195
-        .warning {
196
-            background-color: #ffe68a;
197
-        }
198
-
199
-        .error {
200
-            background-color: #ff8a8a;
201
-        }
202
-    }
203
-
204 174
     /* Column heads */
205
-    .head {
206
-        background: #9fedd7;
207
-        color: black;
208
-        padding: 0.5em 1em;
209
-    }
210
-
211
-    .colhead {
212
-        background: #9fedd7;
213
-        font-weight: bold;
214
-        color: black;
215
-    }
216
-
175
+    .head,
176
+    .colhead,
217 177
     .colhead_dark {
218 178
         background: #9fedd7;
179
+        border-bottom: 2px solid change-color(black, $alpha: 0.25);
219 180
         color: black;
181
+        padding: 0.5em 1em;
220 182
     }
221 183
 
222 184
     /* Box */
223 185
     .box,
224
-    section {
186
+    .pad,
187
+    section,
188
+    /* Exceptions, fixes, etc. */
189
+    table.user_options {
225 190
         background-color: white;
226 191
         border: none;
227 192
         margin-bottom: 1em;
193
+        padding: 0.5rem;
228 194
     }
229 195
 
230 196
     /* Shadows */
@@ -236,7 +202,7 @@ body.style_matcha {
236 202
     .forum_index,
237 203
     #userinfo_minor > li > ul,
238 204
     .permissions table {
239
-        box-shadow: 2px 2px 10px -2px slategray;
205
+        box-shadow: 0 5px 4px -4px slategray;
240 206
     }
241 207
 
242 208
     /* Links */
@@ -282,21 +248,24 @@ body.style_matcha {
282 248
     button:not(.editor-toolbar button),
283 249
     input[type="button"],
284 250
     input[type="submit"] {
285
-        background: #fbe180;
286
-        border-radius: 0.25rem;
251
+        color: black;
252
+        border: 1px solid #bbb;
287 253
         box-shadow: 2px 2px 10px -5px slategray;
288
-    }
289 254
 
290
-    button:hover,
291
-    input[type="button"]:hover,
292
-    input[type="submit"]:hover {
293
-        background: #fff9c7;
294
-    }
255
+        &.button-primary {
256
+            background: #fbe180;
257
+        }
295 258
 
296
-    button:focus,
297
-    input[type="button"]:focus,
298
-    input[type="submit"]:focus {
299
-        background: #fff9c7;
259
+        &:hover {
260
+            background: #fff9c7;
261
+            /* Primary hover default blue */
262
+            border: 1px solid #bbb;
263
+            color: black;
264
+        }
265
+
266
+        &:focus {
267
+            background: #fff9c7;
268
+        }
300 269
     }
301 270
 
302 271
     /* Text input */
@@ -363,9 +332,4 @@ body.style_matcha {
363 332
     .forum_post.sticky_post {
364 333
         border: 2px solid #fbe180;
365 334
     }
366
-
367
-    /* Inbox */
368
-    tr.unreadpm {
369
-        background-color: #fff9c7;
370
-    }
371 335
 } /* end body.style_matcha */

+ 0
- 29
static/styles/bookish/scss/layout.scss View File

@@ -12,7 +12,6 @@
12 12
 #content {
13 13
     margin: auto;
14 14
     margin-top: 2rem;
15
-    /* min-width: 720px; */
16 15
     overflow: hidden;
17 16
     width: 90%;
18 17
 }
@@ -44,34 +43,6 @@
44 43
     }
45 44
 }
46 45
 
47
-/* Main column and sidebar */
48
-@mixin column-flex($width) {
49
-    display: flex;
50
-    flex-direction: column;
51
-    align-items: stretch;
52
-    max-width: $width;
53
-    min-height: 0;
54
-    padding: 0 0.25rem;
55
-}
56
-
57
-.main_column {
58
-    @include column-flex(64%);
59
-
60
-    table {
61
-        margin-bottom: 1rem;
62
-    }
63
-}
64
-
65
-.sidebar {
66
-    @include column-flex(34%);
67
-    float: right;
68
-}
69
-
70
-/* Box: soon to be <section> */
71
-.box {
72
-    margin-bottom: 1rem;
73
-}
74
-
75 46
 /* Links */
76 47
 div.linkbox {
77 48
     text-align: center;

+ 44
- 0
static/styles/global/scss/layout.scss View File

@@ -7,6 +7,50 @@
7 7
     padding: 0;
8 8
 }
9 9
 
10
+/**
11
+ * Main column and sidebar
12
+ */
13
+
14
+/* Main column and sidebar */
15
+@mixin column-flex($width) {
16
+    display: flex;
17
+    flex-direction: column;
18
+    align-items: stretch;
19
+    max-width: $width;
20
+    min-height: 0;
21
+    padding: 0 0.25rem;
22
+}
23
+
24
+.main_column {
25
+    @include column-flex(64%);
26
+
27
+    table {
28
+        margin-bottom: 1rem;
29
+    }
30
+}
31
+
32
+.sidebar {
33
+    @include column-flex(34%);
34
+    width: 34%;
35
+    float: right;
36
+
37
+    &.fixed {
38
+        width: 34%;
39
+    }
40
+}
41
+
42
+.sidebar {
43
+    float: right;
44
+    width: 30%;
45
+    min-width: 20%;
46
+    margin-right: 1rem;
47
+}
48
+
49
+/* Box: soon to be <section> */
50
+.box {
51
+    margin-bottom: 1rem;
52
+}
53
+
10 54
 /*
11 55
  * Flex elements
12 56
  */

+ 2
- 1
static/styles/global/scss/skeleton-fixes.scss View File

@@ -91,6 +91,7 @@ legend {
91 91
 /* forum lists */ table.forum_index,
92 92
 /* notif filters */ form[name="notification"],
93 93
 /* service stats */ div.permission_container,
94
+/* user settings */ table.user_options,
94 95
 /* GENERIC */ table.skeleton-fix {
95 96
     td {
96 97
         border-bottom: 0 !important;
@@ -130,7 +131,7 @@ code {
130 131
 }
131 132
 
132 133
 /* Unordered lists */
133
-ul {
134
+ul:not(.nobullet) {
134 135
     list-style: circle outside !important;
135 136
 }
136 137
 

+ 30
- 7
static/styles/oppai/scss/oppai.scss View File

@@ -35,6 +35,33 @@ a:hover {
35 35
     color: #555;
36 36
 }
37 37
 
38
+/* Buttons */
39
+button:not(.editor-toolbar button),
40
+input[type="button"],
41
+input[type="submit"] {
42
+    color: black;
43
+    border: 1px solid #bbb;
44
+    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
45
+
46
+    &.button-primary {
47
+        background: #eaabed;
48
+        border: 1px solid #bbb;
49
+        color: black;
50
+    }
51
+
52
+    &:hover {
53
+        background: #e197e5 !important;
54
+        /* Primary hover default blue */
55
+        border: 1px solid #bbb !important;
56
+        color: black !important;
57
+    }
58
+
59
+    &:focus {
60
+        background: #d48dd8;
61
+    }
62
+}
63
+
64
+/*
38 65
 button,
39 66
 input[type="button"],
40 67
 input[type="submit"] {
@@ -53,6 +80,7 @@ input[type="button"]:focus,
53 80
 input[type="submit"]:focus {
54 81
     background: #d48dd8;
55 82
 }
83
+*/
56 84
 
57 85
 .spoilerButton {
58 86
     max-width: 540px;
@@ -546,11 +574,6 @@ div.linkbox {
546 574
     padding-top: 0px;
547 575
 }
548 576
 
549
-.sidebar {
550
-    float: right;
551
-    width: 245px;
552
-}
553
-
554 577
 .head {
555 578
     padding: 4px;
556 579
     /* border-bottom: 1px solid #666; */
@@ -563,8 +586,8 @@ div.linkbox {
563 586
     padding: 3px 10px 10px 10px;
564 587
 }
565 588
 
566
-.main_column {
567
-    width: 592px;
589
+#content {
590
+    max-width: 67%;
568 591
 }
569 592
 
570 593
 .main_column table {

+ 5
- 2
templates/legal/about.html View File

@@ -3,6 +3,8 @@
3 3
 <section class="tldr">
4 4
   <p>
5 5
     BioTorrents.de is a functional experiment in comfy data distribution.
6
+    The tagline is "What.cd for genome sequences."
7
+    The scope is multidisciplinary and social science friendly.
6 8
   </p>
7 9
 
8 10
   <p>
@@ -12,9 +14,10 @@
12 14
   </p>
13 15
 
14 16
   <p>
15
-    BioTorrents.de provides an open platform for disadvantaged researchers to host their data.
17
+    BioTorrents.de is an open platform for disadvantaged researchers to host their data.
16 18
     More importantly, it provides the necessary tools for others to find and cite it later.
17 19
     It's a place for the Google Drives, FTP folders, and network shares that may not be accepted elsewhere.
20
+    It also plays well with institutional repositories and can efficiently mirror their data.
18 21
   </p>
19 22
 
20 23
   <p>
@@ -27,7 +30,7 @@
27 30
       Email
28 31
     </strong>
29 32
     <br />
30
-    help at biotorrents dot de
33
+    hello at torrents dot bio 
31 34
   </p>
32 35
 
33 36
   <p>

+ 3
- 3
templates/legal/dmca.html View File

@@ -3,8 +3,8 @@
3 3
 <section class="tldr">
4 4
   <p>
5 5
     <em>If</em> you're a copyright owner or an agent of one,
6
-    <em>and</em> you believe that user-generated content on the domain
7
-    https://biotorrents.de infringes your copyrights:
6
+    <em>and</em> you reasonably believe that user-generated content on the domains
7
+    torrents.bio or biotorrents.de infringes your copyrights:
8 8
     <em>then</em> you may notify our Digital Millennium Copyright Act (DMCA) agent in writing.
9 9
   </p>
10 10
 
@@ -69,7 +69,7 @@
69 69
       Email
70 70
     </strong>
71 71
     <br />
72
-    dmca at biotorrents dot de
72
+    dmca at torrents dot bio 
73 73
   </p>
74 74
 
75 75
   <p>

+ 2
- 2
templates/legal/privacy.html View File

@@ -188,7 +188,7 @@
188 188
   </h3>
189 189
 
190 190
   <p>
191
-    We last updated this policy on 2021-07-14.
191
+    We last updated this policy on 2021-07-28.
192 192
   </p>
193 193
 
194 194
 
@@ -220,7 +220,7 @@
220 220
       Email
221 221
     </strong>
222 222
     <br />
223
-    privacy at biotorrents dot de
223
+    privacy at torrents dot bio 
224 224
   </p>
225 225
 
226 226
   <p>

Loading…
Cancel
Save