Browse Source

Lots to do!

pjc 5 years ago
parent
commit
5e89ffcfac
69 changed files with 382 additions and 267 deletions
  1. 84
    0
      _packages/extension-parser/classes/config.php
  2. 55
    0
      _packages/extension-parser/classes/torrent_form.class.php
  3. 11
    0
      _packages/extension-parser/readme.md
  4. 2
    2
      classes/artists.class.php
  5. 1
    1
      classes/autoenable.class.php
  6. 1
    1
      classes/charts.class.php
  7. 1
    1
      classes/classloader.php
  8. 1
    1
      classes/collages.class.php
  9. 3
    2
      classes/comments.class.php
  10. 2
    1
      classes/commentsview.class.php
  11. 2
    2
      classes/config.template
  12. 1
    1
      classes/file_checker.class.php
  13. 1
    1
      classes/mysql.class.php
  14. 2
    1
      classes/notificationsmanager.class.php
  15. 6
    5
      classes/script_start.php
  16. 1
    1
      classes/text.class.php
  17. 1
    1
      classes/time.class.php
  18. 1
    1
      classes/tools.class.php
  19. 19
    31
      classes/torrent_form.class.php
  20. 3
    1
      classes/torrents.class.php
  21. 1
    1
      classes/tracker.class.php
  22. 1
    1
      classes/u2f.class.php
  23. 10
    2
      classes/validate.class.php
  24. 1
    1
      download.php
  25. 1
    0
      gazelle.sql
  26. 2
    2
      sections/ajax/autofill/jav.php
  27. 1
    1
      sections/ajax/collage.php
  28. 1
    1
      sections/ajax/forum/thread.php
  29. 4
    1
      sections/ajax/torrentgroupalbumart.php
  30. 1
    1
      sections/artist/download.php
  31. 1
    1
      sections/better/transcode_beta.php
  32. 1
    1
      sections/bookmarks/edit_torrents.php
  33. 1
    1
      sections/collages/artist_collage.php
  34. 1
    1
      sections/collages/torrent_collage.php
  35. 2
    2
      sections/donate/donate_gpal.php
  36. 1
    1
      sections/forums/get_post.php
  37. 1
    1
      sections/forums/search.php
  38. 2
    2
      sections/forums/take_reply.php
  39. 3
    1
      sections/forums/thread.php
  40. 5
    5
      sections/inbox/get_post.php
  41. 7
    8
      sections/index/index.php
  42. 9
    4
      sections/index/private.php
  43. 1
    1
      sections/login/index.php
  44. 50
    25
      sections/login/login.php
  45. 8
    7
      sections/reportsv2/search.php
  46. 2
    2
      sections/requests/new_edit.php
  47. 1
    1
      sections/requests/request.php
  48. 6
    8
      sections/schedule/daily/ratio_reqs.php
  49. 7
    7
      sections/schedule/hourly/front_page_stats.php
  50. 9
    11
      sections/staffpm/get_post.php
  51. 1
    1
      sections/tools/index.php
  52. 1
    1
      sections/tools/managers/enable_requests.php
  53. 1
    1
      sections/tools/managers/label_aliases.php
  54. 1
    1
      sections/tools/misc/create_user.php
  55. 1
    1
      sections/torrents/browse.php
  56. 2
    2
      sections/torrents/details.php
  57. 1
    1
      sections/torrents/takeedit.php
  58. 15
    4
      sections/upload/upload_handle.php
  59. 1
    1
      sections/user/index.php
  60. 1
    1
      sections/user/permissions.php
  61. 1
    1
      sections/user/sessions.php
  62. 1
    1
      sections/user/take_edit.php
  63. 1
    1
      sections/userhistory/email_history2.php
  64. 8
    8
      static/functions/ajax.class.js
  65. 1
    1
      static/functions/bbcode.js
  66. 2
    1
      static/functions/cookie.class.js
  67. 2
    1
      static/functions/countdown.class.js
  68. 2
    1
      static/functions/storage.class.js
  69. 0
    83
      templates/filemap.csv

+ 84
- 0
_packages/extension-parser/classes/config.php View File

@@ -0,0 +1,84 @@
1
+<?php
2
+
3
+# Sequencing Formats
4
+# https://www.ncbi.nlm.nih.gov/sra/docs/submitformats/
5
+$Containers = [
6
+  'BAM'        => ['bam'],
7
+  'CRAM'       => ['cram'],
8
+  'EMBL'       => ['embl'],
9
+  'FASTA'      => ['fa', 'fasta', 'fsa'],
10
+  'FASTA+QUAL' => ['qual'],
11
+  'CSFASTA'    => ['csfa', 'csfasta', 'csfsa'],
12
+  'FASTQ'      => ['fastq', 'fq', 'sanfastq'],
13
+  'GFF'        => ['gff', 'gff2', 'gff3'],
14
+  'GTF'        => ['gtf'],
15
+  'GenBank'    => ['gb', 'gbk', 'genbank'],
16
+  'HDF5'       => ['bash5', 'baxh5', 'fast5', 'hdf5'],
17
+  'PIR'        => ['pir'],
18
+  'QSeq'       => ['qseq'],
19
+  'SAM'        => ['sam'],
20
+  'SFF'        => ['sff'],
21
+  'SRF'        => ['srf'],
22
+  'SnapGene'   => ['dna', 'seq'],
23
+  'SwissProt'  => ['dat'],
24
+  'VCF'        => ['vcf'],
25
+  'Plain'      => ['csv', 'txt'],
26
+];
27
+
28
+# Imaging Formats
29
+# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3948928/
30
+$ContainersGames = [
31
+  'Analyze'   => ['hdr', 'img'],
32
+  'Interfile' => ['h33'],
33
+  'Dicom'     => ['dcm', 'dicom'],
34
+  'Nifti'     => ['nii', 'nifti'],
35
+  'Minc'      => ['minc', 'mnc'],
36
+  'JPEG'      => ['jfif', 'jpeg', 'jpg'],
37
+  'JPEG 2000' => ['j2k', 'jp2', 'jpf', 'jpm', 'jpx', 'mj2'],
38
+  'PNG'       => ['png'],
39
+  'TIFF'      => ['tif', 'tiff'],
40
+  'WebP'      => ['webp'],
41
+  'Other'     => [''],
42
+];
43
+
44
+# Protein Formats
45
+# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3518119/
46
+# DO NOT PARSE RAW FILES. TOO MANY COMPETING VENDORS
47
+$ContainersProt = [
48
+  'ABI/Sciex'      => ['t2d', 'wiff'],
49
+  'APML'           => ['apml'],
50
+  'ASF'            => ['asf'],
51
+  'Agilent/Bruker' => ['baf', 'd', 'fid', 'tdf', 'yep'],
52
+  'BlibBuild'      => ['blib'],
53
+  'Bruker/Varian'  => ['sms', 'xms'],
54
+  'Finnigan'       => ['dat', 'ms'],
55
+  'ION-TOF'        => ['ita', 'itm'],
56
+  'JCAMP-DX'       => ['jdx'],
57
+  'MGF'            => ['mgf'],
58
+  'MS2'            => ['ms2'],
59
+  'MSF'            => ['msf'],
60
+  'OMSSA'          => ['omssa', 'omx'],
61
+  'PEFF'           => ['peff'],
62
+  'Shimadzu'       => ['lcd', 'qgd', 'spc'],
63
+  'Skyline'        => ['sky', 'skyd'],
64
+  'TPP/SPC'        => ['dta'],
65
+  'Tandem'         => ['tandem'],
66
+  'TraML'          => ['traml'],
67
+  'ULVAC-PHI'      => ['tdc'],
68
+  'mzML'           => ['mzml'],
69
+  'mzXML'          => ['mzxml'],
70
+  'mzData'         => ['mzdata'],
71
+  'pepXML'         => ['pepxml'],
72
+  'protXML'        => ['protxml'],
73
+  'Plain'          => ['csv', 'txt'],
74
+];
75
+
76
+$Archives = [
77
+  '7z' => ['7z'],
78
+  'bzip2' => ['bz2', 'bzip2'],
79
+  'gzip' => ['gz', 'gzip', 'tgz', 'tpz'],
80
+  'Pickle' => ['pickle', 'pkl'],
81
+  'RAR' => ['rar', 'rev'],
82
+  'ZIP' => ['zip', 'zipx'],
83
+  'None' => [''],
84
+];

+ 55
- 0
_packages/extension-parser/classes/torrent_form.class.php View File

@@ -0,0 +1,55 @@
1
+<?php ?>
2
+
3
+<!-- Three container fields -->
4
+<tr id="container_tr">
5
+  <td class="label">
6
+    Format
7
+    <strong class="important_text">*</strong>
8
+  </td>
9
+  <td>
10
+    <select name="container">
11
+      <option value="Autofill">Autofill</option>
12
+      <?php
13
+          foreach ($this->Containers as $Name => $Container) {
14
+              echo "<option value='$Name'>$Name</option>\n";
15
+          } ?>
16
+    </select><br />
17
+    Data file format, or detect from file list
18
+  </td>
19
+</tr>
20
+
21
+<!-- 2 -->
22
+<tr id="container_games_tr">
23
+  <td class="label">
24
+    Format
25
+    <strong class="important_text">*</strong>
26
+  </td>
27
+  <td>
28
+    <select id="container" name="container">
29
+      <option value="Autofill">Autofill</option>
30
+      <?php
31
+          foreach ($this->ContainersGames as $Name => $Container) {
32
+              echo "<option value='$Name'>$Name</option>\n";
33
+          } ?>
34
+    </select><br />
35
+    Data file format, or detect from file list
36
+  </td>
37
+</tr>
38
+
39
+<!-- 3 -->
40
+<tr id="container_prot_tr">
41
+  <td class="label">
42
+    Format
43
+    <strong class="important_text">*</strong>
44
+  </td>
45
+  <td>
46
+    <select id="container" name="container">
47
+      <option value="Autofill">Autofill</option>
48
+      <?php
49
+          foreach ($this->ContainersProt as $Name => $Container) {
50
+              echo "<option value='$Name'>$Name</option>\n";
51
+          } ?>
52
+    </select><br />
53
+    Data file format, or detect from file list
54
+  </td>
55
+</tr>

+ 11
- 0
_packages/extension-parser/readme.md View File

@@ -0,0 +1,11 @@
1
+## Detect and autofill file types by extension
2
+
3
+One of the challenges of tracking biology data is the overwhelming number of file formats.
4
+If a user leaves the container or archive dropdown blank, this tool:
5
+  * Adds the file sizes of each extension
6
+  * Sorts the torrent file list by size
7
+  * Returns the first matching extension value
8
+
9
+## In this repo
10
+Please find all the snippets you need to implement a similar feature on your own tracker.
11
+The file and folder structure mirrors what Oppaitime Gazelle uses.

+ 2
- 2
classes/artists.class.php View File

@@ -83,7 +83,7 @@ class Artists
83 83
 
84 84
     /**
85 85
      * Format an array of artists for display.
86
-     * TODO: Revisit the logic of this, see if we can helper-function the copypasta.
86
+     * todo: Revisit the logic of this, see if we can helper-function the copypasta.
87 87
      *
88 88
      * @param array Artists an array of the form output by get_artists
89 89
      * @param boolean $MakeLink if true, the artists will be links, if false, they will be text.
@@ -199,7 +199,7 @@ class Artists
199 199
     /**
200 200
      * Remove LRM (left-right-marker) and trims, because people copypaste carelessly.
201 201
      * If we don't do this, we get seemingly duplicate artist names.
202
-     * TODO: make stricter, e.g. on all whitespace characters or Unicode normalisation
202
+     * todo: make stricter, e.g. on all whitespace characters or Unicode normalisation
203 203
      *
204 204
      * @param string $ArtistName
205 205
      */

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

@@ -307,7 +307,7 @@ class AutoEnable {
307 307
         }
308 308
 
309 309
         if (!empty($IP)) {
310
-            // TODO: make this work with encrypted IPs
310
+            // todo: Make this work with encrypted IPs
311 311
             $Where[] = "uer.IP = '$IP'";
312 312
         }
313 313
 

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

@@ -144,7 +144,7 @@ class PIE_CHART extends GOOGLE_CHARTS {
144 144
 
145 145
 
146 146
 class LOG_BAR_GRAPH extends GOOGLE_CHARTS {
147
-  //TODO: Finish.
147
+  // todo: Finish
148 148
   public function __construct ($Base, $Width, $Height, $Options = []) {
149 149
     parent::__construct('lc', $Width, $Height, $Options);
150 150
   }

+ 1
- 1
classes/classloader.php View File

@@ -7,7 +7,7 @@
7 7
 spl_autoload_register(function ($ClassName) {
8 8
   $FilePath = SERVER_ROOT . '/classes/' . strtolower($ClassName) . '.class.php';
9 9
   if (!file_exists($FilePath)) {
10
-    // TODO: Rename the following classes to conform with the code guidelines
10
+    // todo: Rename the following classes to conform with the code guidelines
11 11
     switch ($ClassName) {
12 12
       case 'MASS_USER_BOOKMARKS_EDITOR':
13 13
         $FileName = 'mass_user_bookmarks_editor.class';

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

@@ -33,7 +33,7 @@ class Collages
33 33
         list($CollageCount) = G::$DB->next_record();
34 34
 
35 35
         if ($CollageCount >= G::$LoggedUser['Permissions']['MaxCollages']) {
36
-            // @todo Fix this, the query was for COUNT(ID), so I highly doubt that this works... - Y
36
+            // todo: Fix this, the query was for COUNT(ID), so I highly doubt that this works... - Y
37 37
             list($CollageID) = G::$DB->next_record();
38 38
             header('Location: collage.php?id='.$CollageID);
39 39
             die();

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

@@ -49,7 +49,8 @@ class Comments {
49 49
    * @param int $PostID
50 50
    * @param string $NewBody
51 51
    * @param bool $SendPM If true, send a PM to the author of the comment informing him about the edit
52
-   * @todo Move permission check out of here/remove hardcoded error(404)
52
+   * 
53
+   * todo: Move permission check out of here/remove hardcoded error(404)
53 54
    */
54 55
   public static function edit($PostID, $NewBody, $SendPM = false) {
55 56
     $QueryID = G::$DB->get_query_id();
@@ -113,7 +114,7 @@ class Comments {
113 114
       Misc::send_pm($AuthorID, 0, $PMSubject, $PMBody);
114 115
     }
115 116
 
116
-    return true; // TODO: this should reflect whether or not the update was actually successful, e.g. by checking G::$DB->affected_rows after the UPDATE query
117
+    return true; // todo: This should reflect whether or not the update was actually successful, e.g., by checking G::$DB->affected_rows after the UPDATE query
117 118
   }
118 119
 
119 120
   /**

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

@@ -24,7 +24,8 @@ class CommentsView {
24 24
    * @param string $Link The link to the post elsewhere on the site
25 25
    * @param string $Header The header used in the post
26 26
    * @param bool $Tools Whether or not to show [Edit], [Report] etc.
27
-   * @todo Find a better way to pass the page (artist, collages, requests, torrents) to this function than extracting it from $Link
27
+   * 
28
+   * todo: Find a better way to pass the page (artist, collages, requests, torrents) to this function than extracting it from $Link
28 29
    */
29 30
   static function render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $EditedTime, $Link, $Unread = false, $Header = '', $Tools = true) {
30 31
     $UserInfo = Users::user_info($AuthorID);

+ 2
- 2
classes/config.template View File

@@ -102,8 +102,8 @@ define('FLS_TEAM',       '33');
102 102
 define('FORUM_MOD',      '9001');
103 103
 
104 104
 // Forums
105
-define('STAFF_FORUM',           0); # @todo
106
-define('DONOR_FORUM',           0); # @todo
105
+define('STAFF_FORUM',           0); # todo
106
+define('DONOR_FORUM',           0); # todo
107 107
 define('TRASH_FORUM_ID',        8);
108 108
 define('ANNOUNCEMENT_FORUM_ID', 1);
109 109
 

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

@@ -32,7 +32,7 @@ function check_name($Name) {
32 32
    * These characters are invalid in NTFS on Windows systems:
33 33
    *    : ? / < > \ * | "
34 34
    *
35
-   * TODO: Add "/" to the blacklist. Adding "/" to the blacklist causes problems with nested dirs, apparently.
35
+   * todo: Add "/" to the blacklist. Adding "/" to the blacklist causes problems with nested dirs, apparently
36 36
    *
37 37
    * Only the following characters need to be escaped (see the link below):
38 38
    *    \ - ^ ]

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

@@ -143,7 +143,7 @@ function db_array($Array, $DontEscape = [], $Quote = false) {
143 143
   return $Array;
144 144
 }
145 145
 
146
-// @todo Revisit access levels once Drone is replaced by ZeRobot
146
+// todo: Revisit access levels once Drone is replaced by ZeRobot
147 147
 class DB_MYSQL {
148 148
   public $LinkID = false;
149 149
   protected $QueryID = false;

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

@@ -599,7 +599,8 @@ class NotificationsManager {
599 599
   }
600 600
 
601 601
 /*
602
-  // TODO: Figure out what these functions are supposed to do and fix them
602
+  // todo: Figure out what these functions are supposed to do and fix them
603
+  
603 604
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
604 605
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
605 606
     if (empty($Notifications)) {

+ 6
- 5
classes/script_start.php View File

@@ -37,7 +37,8 @@ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])
37 37
 
38 38
 if (!isset($argv) && !empty($_SERVER['HTTP_HOST'])) {
39 39
   // Skip this block if running from cli or if the browser is old and shitty
40
-  // This should really be done in nginx config TODO: Remove
40
+  // This should really be done in nginx config
41
+  // todo: Remove
41 42
   if ($_SERVER['HTTP_HOST'] == 'www.'.SITE_DOMAIN) {
42 43
     header('Location: https://'.SITE_DOMAIN.$_SERVER['REQUEST_URI']); die();
43 44
   }
@@ -73,7 +74,7 @@ require(SERVER_ROOT.'/classes/classloader.php');
73 74
 
74 75
 // Note: G::initialize is called twice.
75 76
 // This is necessary as the code inbetween (initialization of $LoggedUser) makes use of G::$DB and G::$Cache.
76
-// TODO: remove one of the calls once we're moving everything into that class
77
+// todo: Remove one of the calls once we're moving everything into that class
77 78
 G::initialize();
78 79
 
79 80
 //Begin browser identification
@@ -84,7 +85,7 @@ $OperatingSystem = UserAgent::operating_system($_SERVER['HTTP_USER_AGENT']);
84 85
 $Debug->set_flag('start user handling');
85 86
 
86 87
 // Get classes
87
-// TODO: Remove these globals, replace by calls into Users
88
+// todo: Remove these globals, replace by calls into Users
88 89
 list($Classes, $ClassLevels) = Users::get_classes();
89 90
 
90 91
 //-- Load user information
@@ -100,7 +101,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
100 101
   $SessionID = $_COOKIE['session'];
101 102
   $LoggedUser['ID'] = (int)$_COOKIE['userid'];
102 103
 
103
-  $UserID = $LoggedUser['ID']; //TODO: UserID should not be LoggedUser
104
+  $UserID = $LoggedUser['ID']; //todo: UserID should not be LoggedUser
104 105
 
105 106
   if (!$LoggedUser['ID'] || !$SessionID) {
106 107
     logout();
@@ -292,7 +293,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
292 293
     $Cache->cache_value('stylesheets', $Stylesheets, 0);
293 294
   }
294 295
 
295
-  //A9 TODO: Clean up this messy solution
296
+  // todo: Clean up this messy solution
296 297
   $LoggedUser['StyleName'] = $Stylesheets[$LoggedUser['StyleID']]['Name'];
297 298
 
298 299
   if (empty($LoggedUser['Username'])) {

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

@@ -868,7 +868,7 @@ class Text {
868 868
           if (!self::valid_url($Block['Val'], '\.(mp3|ogg|wav)')) {
869 869
             $Str .= '[aud]'.$Block['Val'].'[/aud]';
870 870
           } else {
871
-            //TODO: Proxy this for staff?
871
+            // todo: Proxy this for staff?
872 872
             $Str .= '<audio controls="controls" src="'.$Block['Val'].'"><a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a></audio>';
873 873
           }
874 874
           break;

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

@@ -116,7 +116,7 @@ function time_minus($Offset, $Fuzzy = false) {
116 116
 }
117 117
 
118 118
 // This is never used anywhere with $timestamp set
119
-// TODO: Why don't we just use NOW() in the sql queries?
119
+// todo: Why don't we just use NOW() in the sql queries?
120 120
 function sqltime($timestamp = NULL) {
121 121
   return date('Y-m-d H:i:s', ($timestamp ?? time()));
122 122
 }

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

@@ -129,7 +129,7 @@ class Tools {
129 129
    * @return string the host.
130 130
    */
131 131
   public static function lookup_ip($IP) {
132
-    //TODO: use the G::$Cache
132
+    // todo: Use the G::$Cache
133 133
     $Output = explode(' ',shell_exec('host -W 1 '.escapeshellarg($IP)));
134 134
     if (count($Output) == 1 && empty($Output[0]))  { return ''; }
135 135
     if (count($Output) != 5)                       { return false; }

+ 19
- 31
classes/torrent_form.class.php View File

@@ -357,8 +357,8 @@ class TorrentForm
357 357
         if (!empty($Torrent['Artists'])) {
358 358
             foreach ($Torrent['Artists'] as $Num => $Artist) {
359 359
                 ?>
360
-      <input type="text" id="idols_<?= $Num ?>"
361
-        name="idols[]" size="45"
360
+      <input type="text" id="idols_<?= $Num ?>" name="idols[]"
361
+        size="45"
362 362
         value="<?= display_str($Artist['name']) ?>"
363 363
         <?= $this->Disabled ?>/>
364 364
       <?php if ($Num === 0) { ?>
@@ -417,8 +417,8 @@ class TorrentForm
417 417
   </tr>
418 418
   <?php } # Ends if NewTorrent line 256?>
419 419
 
420
-    <!-- Encoding -->
421
-    <tr id="codec_tr">
420
+  <!-- Encoding -->
421
+  <tr id="codec_tr">
422 422
     <td class="label">
423 423
       License
424 424
       <strong class="important_text">*</strong>
@@ -483,8 +483,8 @@ class TorrentForm
483 483
     </td>
484 484
   </tr>
485 485
 
486
-    <!-- Resolution -->
487
-    <tr id="resolution_tr">
486
+  <!-- Resolution -->
487
+  <tr id="resolution_tr">
488 488
     <td class="label">
489 489
       Assembly Level
490 490
       <strong class="important_text">*</strong>
@@ -519,7 +519,7 @@ class TorrentForm
519 519
     </td>
520 520
   </tr>
521 521
 
522
-  <!-- Container -->
522
+  <!-- Three container fields -->
523 523
   <tr id="container_tr">
524 524
     <td class="label">
525 525
       Format
@@ -529,19 +529,15 @@ class TorrentForm
529 529
       <select name="container">
530 530
         <option value="Autofill">Autofill</option>
531 531
         <?php
532
-          foreach ($this->Containers as $Cont) {
533
-              echo "\t\t\t\t\t\t<option value=\"$Cont\"";
534
-              if ($Cont === ($Torrent['Container'] ?? false)) {
535
-                  echo " selected";
536
-              }
537
-              echo ">$Cont</option>\n";
532
+          foreach ($this->Containers as $Name => $Container) {
533
+              echo "<option value='$Name'>$Name</option>\n";
538 534
           } ?>
539 535
       </select><br />
540 536
       Data file format, or detect from file list
541 537
     </td>
542 538
   </tr>
543 539
 
544
-  <!-- Alternate container 1 -->
540
+  <!-- 2 -->
545 541
   <tr id="container_games_tr">
546 542
     <td class="label">
547 543
       Format
@@ -551,20 +547,16 @@ class TorrentForm
551 547
       <select id="container" name="container">
552 548
         <option value="Autofill">Autofill</option>
553 549
         <?php
554
-          foreach ($this->ContainersGames as $Container) {
555
-              echo "\t\t\t\t\t\t<option value=\"$Container\"";
556
-              if ($Container === ($Torrent['Container'] ?? false)) {
557
-                  echo " selected";
558
-              }
559
-              echo ">$Container</option>\n";
550
+          foreach ($this->ContainersGames as $Name => $Container) {
551
+              echo "<option value='$Name'>$Name</option>\n";
560 552
           } ?>
561 553
       </select><br />
562 554
       Data file format, or detect from file list
563 555
     </td>
564 556
   </tr>
565 557
 
566
-    <!-- Alternate container 2 -->
567
-    <tr id="container_prot_tr">
558
+  <!-- 3 -->
559
+  <tr id="container_prot_tr">
568 560
     <td class="label">
569 561
       Format
570 562
       <strong class="important_text">*</strong>
@@ -573,12 +565,8 @@ class TorrentForm
573 565
       <select id="container" name="container">
574 566
         <option value="Autofill">Autofill</option>
575 567
         <?php
576
-          foreach ($this->ContainersProt as $Container) {
577
-              echo "\t\t\t\t\t\t<option value=\"$Container\"";
578
-              if ($Container === ($Torrent['Container'] ?? false)) {
579
-                  echo " selected";
580
-              }
581
-              echo ">$Container</option>\n";
568
+          foreach ($this->ContainersProt as $Name => $Container) {
569
+              echo "<option value='$Name'>$Name</option>\n";
582 570
           } ?>
583 571
       </select><br />
584 572
       Data file format, or detect from file list
@@ -595,12 +583,12 @@ class TorrentForm
595 583
       <select name='archive'>
596 584
         <option value="Autofill">Autofill</option>
597 585
         <?php
598
-          foreach ($this->Archives as $Archive) {
599
-              echo "\t\t\t\t\t\t<option value=\"$Archive\"";
586
+          foreach ($this->Archives as $Name => $Archive) {
587
+              echo "\t\t\t\t\t\t<option value=\"$Name\"";
600 588
               if ($Archive === ($Torrent['Archive'] ?? false)) {
601 589
                   echo ' selected';
602 590
               }
603
-              echo ">$Archive</option>\n";
591
+              echo ">$Name</option>\n";
604 592
           } ?>
605 593
       </select><br />
606 594
       Compression algorithm, or detect from file list

+ 3
- 1
classes/torrents.class.php View File

@@ -229,7 +229,9 @@ class Torrents {
229 229
    * @param int $TorrentID
230 230
    * @param int $UserID
231 231
    * @param string $Message
232
-   * @param boolean $Hidden Currently does fuck all. TODO: Fix that.
232
+   * @param boolean $Hidden Currently does fuck all.
233
+   * 
234
+   * todo: Fix that
233 235
    */
234 236
   public static function write_group_log($GroupID, $TorrentID, $UserID, $Message, $Hidden) {
235 237
     global $Time;

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

@@ -1,5 +1,5 @@
1 1
 <?
2
-// TODO: Turn this into a class with nice functions like update_user, delete_torrent, etc.
2
+// todo: Turn this into a class with nice functions like update_user, delete_torrent, etc.
3 3
 class Tracker {
4 4
   const STATS_MAIN = 0;
5 5
   const STATS_USER = 1;

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

@@ -299,7 +299,7 @@ class U2F {
299 299
     if (openssl_verify($dataToVerify, $signature, $pemKey, 'sha256') === 1) {
300 300
       $ctr = unpack("Nctr", substr($signData, 1, 4));
301 301
       $counter = $ctr['ctr'];
302
-      /* TODO: wrap-around should be handled somehow.. */
302
+      /* todo: wrap-around should be handled somehow... */
303 303
       if ($counter > $reg->counter) {
304 304
         $reg->counter = $counter;
305 305
         return $reg;

+ 10
- 2
classes/validate.class.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-/*-- TODO ---------------------------//
3
+/*-- todo ---------------------------//
4 4
 Writeup how to use the Validate class, add in support for form id checks
5 5
 Complete the number and date validation
6 6
 //-----------------------------------*/
@@ -44,7 +44,7 @@ class Validate
44 44
         foreach ($this->Fields as $FieldKey => $Field) {
45 45
             $ValidateVar = $ValidateArray[$FieldKey];
46 46
 
47
-            # @todo Change this to a switch statement
47
+            # todo: Change this to a switch statement
48 48
             if ($ValidateVar !== '' || !empty($Field['Required']) || $Field['Type'] === 'date') {
49 49
                 if ($Field['Type'] === 'string') {
50 50
                     if (isset($Field['MaxLength'])) {
@@ -63,6 +63,7 @@ class Validate
63 63
                     } elseif (strlen($ValidateVar) < $MinLength) {
64 64
                         return $Field['ErrorMessage'];
65 65
                     }
66
+
66 67
                 } elseif ($Field['Type'] === 'number') {
67 68
                     if (isset($Field['MaxLength'])) {
68 69
                         $MaxLength = $Field['MaxLength'];
@@ -90,6 +91,7 @@ class Validate
90 91
                     } elseif ($ValidateVar < $MinLength) {
91 92
                         return $Field['ErrorMessage']."$MinLength";
92 93
                     }
94
+
93 95
                 } elseif ($Field['Type'] === 'email') {
94 96
                     if (isset($Field['MaxLength'])) {
95 97
                         $MaxLength = $Field['MaxLength'];
@@ -109,6 +111,7 @@ class Validate
109 111
                     } elseif (strlen($ValidateVar) < $MinLength) {
110 112
                         return $Field['ErrorMessage'];
111 113
                     }
114
+
112 115
                 } elseif ($Field['Type'] === 'link') {
113 116
                     if (isset($Field['MaxLength'])) {
114 117
                         $MaxLength = $Field['MaxLength'];
@@ -128,6 +131,7 @@ class Validate
128 131
                     } elseif (strlen($ValidateVar) < $MinLength) {
129 132
                         return $Field['ErrorMessage'];
130 133
                     }
134
+
131 135
                 } elseif ($Field['Type'] === 'username') {
132 136
                     if (isset($Field['MaxLength'])) {
133 137
                         $MaxLength = $Field['MaxLength'];
@@ -147,18 +151,22 @@ class Validate
147 151
                     } elseif (strlen($ValidateVar) < $MinLength) {
148 152
                         return $Field['ErrorMessage'];
149 153
                     }
154
+
150 155
                 } elseif ($Field['Type'] === 'checkbox') {
151 156
                     if (!isset($ValidateArray[$FieldKey])) {
152 157
                         return $Field['ErrorMessage'];
153 158
                     }
159
+
154 160
                 } elseif ($Field['Type'] === 'compare') {
155 161
                     if ($ValidateArray[$Field['CompareField']] !== $ValidateVar) {
156 162
                         return $Field['ErrorMessage'];
157 163
                     }
164
+
158 165
                 } elseif ($Field['Type'] === 'inarray') {
159 166
                     if (array_search($ValidateVar, $Field['InArray']) === false) {
160 167
                         return $Field['ErrorMessage'];
161 168
                     }
169
+
162 170
                 } elseif ($Field['Type'] === 'regex') {
163 171
                     if (!preg_match($Field['Regex'], $ValidateVar)) {
164 172
                         return $Field['ErrorMessage'];

+ 1
- 1
download.php View File

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * Force file downloads
5 5
  * Currently used to download BibTeX citations
6
- * @todo Make this work with POST and display Show/Hide and Download buttons on the same line
6
+ * todo: Make this work with POST and display Show/Hide and Download buttons on the same line
7 7
  *
8 8
 
9 9
 if (isset($_POST['file']) && isset($_POST['content'])) {

+ 1
- 0
gazelle.sql View File

@@ -7,7 +7,7 @@
7 7
 --   * Ocelot tokens:      char(32)
8 8
 --   * Tag lists:          varchar(500)
9 9
 --
10
+-- todo: Finish explaining the schema
10 11
 
11 12
 SET FOREIGN_KEY_CHECKS = 0;
12 13
 

+ 2
- 2
sections/ajax/autofill/jav.php View File

@@ -19,9 +19,9 @@ if (!$debug && $Cache->get_value('jav_fill_json_'.$cn)) {
19 19
 } else {
20 20
 
21 21
   # Query the API
22
-  # @todo Valida to change $db
22
+  # todo: Validate to change $db
23 23
 
24
-/* @todo
24
+/* todo
25 25
  * switch $category:
26 26
  *   case 'DNA' || 'RNA':
27 27
  *     if $number = refseq_regex:

+ 1
- 1
sections/ajax/collage.php View File

@@ -32,7 +32,7 @@ if ($CollageData) {
32 32
   $SetCache = true;
33 33
 }
34 34
 
35
-// TODO: Cache this
35
+// todo: Cache this
36 36
 $DB->query("
37 37
   SELECT GroupID
38 38
   FROM collages_torrents

+ 1
- 1
sections/ajax/forum/thread.php View File

@@ -1,5 +1,5 @@
1 1
 <?php
2
-//TODO: Normalize thread_*_info don't need to waste all that ram on things that are already in other caches
2
+// todo: Normalize thread_*_info don't need to waste all that ram on things that are already in other caches
3 3
 /**********|| Page to show individual threads || ********************************\
4 4
 
5 5
 Things to expect in $_GET:

+ 4
- 1
sections/ajax/torrentgroupalbumart.php View File

@@ -3,15 +3,18 @@ require(SERVER_ROOT.'/sections/torrents/functions.php');
3 3
 
4 4
 $GroupID = (int)$_GET['id'];
5 5
 if ($GroupID === 0) {
6
-  error('bad id parameter', true);
6
+  error('Bad ID parameter', true);
7 7
 }
8 8
 
9 9
 $TorrentDetails = get_group_info($GroupID, true, 0, false);
10 10
 $TorrentDetails = $TorrentDetails[0];
11 11
 $Image = $TorrentDetails['WikiImage'];
12
+
13
+/*
12 14
 if (!$Image) { // handle no artwork
13 15
   $Image = STATIC_SERVER.'common/noartwork/'.$CategoryIcons[$TorrentDetails['CategoryID'] - 1];
14 16
 }
17
+*/
15 18
 
16 19
 json_die("success", array(
17 20
   'wikiImage' => $Image

+ 1
- 1
sections/artist/download.php View File

@@ -1,5 +1,5 @@
1 1
 <?
2
-//TODO: freeleech in ratio hit calculations, in addition to a warning of whats freeleech in the Summary.txt
2
+// todo: Freeleech in ratio hit calculations, in addition to a warning of whats freeleech in the Summary.txt
3 3
 /*
4 4
 This page is something of a hack so those
5 5
 easily scared off by funky solutions, don't

+ 1
- 1
sections/better/transcode_beta.php View File

@@ -302,7 +302,7 @@ if ($ResultCount == 0) {
302 302
     $TorrentTags = new Tags($Group['TagList']);
303 303
 
304 304
     foreach ($Group['Editions'] as $RemIdent => $Edition) {
305
-      // TODO: point to the correct FLAC (?)
305
+      // todo: Point to the correct FLAC (?)
306 306
       $FlacID = array_search(true, $Edition['FlacIDs']);
307 307
       $DisplayName = $ArtistNames . "<a href=\"torrents.php?id=$GroupID&amp;torrentid=$FlacID#torrent$FlacID\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">$GroupName</a>";
308 308
       if ($GroupYear > 0) {

+ 1
- 1
sections/bookmarks/edit_torrents.php View File

@@ -26,7 +26,7 @@ View::show_header('Organize Bookmarks', 'browse,jquery-ui,jquery.tablesorter,sor
26 26
 
27 27
 $EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
28 28
 
29
-list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID); // TODO: $TorrentList might not have the correct order, use the $GroupIDs instead
29
+list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID); // todo: $TorrentList might not have the correct order, use the $GroupIDs instead
30 30
 
31 31
 $TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
32 32
 $TT->render_all();

+ 1
- 1
sections/collages/artist_collage.php View File

@@ -1,5 +1,5 @@
1 1
 <?
2
-// TODO: Cache this
2
+// todo: Cache this
3 3
 $DB->query("
4 4
   SELECT
5 5
     ca.ArtistID,

+ 1
- 1
sections/collages/torrent_collage.php View File

@@ -4,7 +4,7 @@ function compare($X, $Y) {
4 4
 }
5 5
 
6 6
 // Build the data for the collage and the torrent list
7
-// TODO: Cache this
7
+// todo: Cache this
8 8
 $DB->query("
9 9
   SELECT
10 10
     ct.GroupID,

+ 2
- 2
sections/donate/donate_gpal.php View File

@@ -1,8 +1,8 @@
1 1
 <?
2
-//TODO: Developer, add resend last donation when available AND add missing headers to Test IPN
2
+// todo: Developer, add resend last donation when available AND add missing headers to Test IPN
3 3
 enforce_login();
4 4
 
5
-//Include the header
5
+// Include the header
6 6
 if ($LoggedUser['RatioWatch']) {
7 7
   error('Due to the high volume of payment disputes, we do not accept donations from users on ratio watch. Sorry.');
8 8
 }

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

@@ -1,5 +1,5 @@
1 1
 <?
2
-//TODO: make this use the cache version of the thread, save the db query
2
+// todo: make this use the cache version of the thread, save the db query
3 3
 /*********************************************************************\
4 4
 //--------------Get Post--------------------------------------------//
5 5
 

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

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-// @todo Clean up this fucking mess
3
+// todo: Clean up this fucking mess
4 4
 
5 5
 /*
6 6
 Forums search result page

+ 2
- 2
sections/forums/take_reply.php View File

@@ -1,7 +1,7 @@
1 1
 <?
2 2
 authorize();
3 3
 
4
-//TODO: Remove all the stupid queries that could get their information just as easily from the cache
4
+// todo: Remove all the stupid queries that could get their information just as easily from the cache
5 5
 /*********************************************************************\
6 6
 //--------------Take Post--------------------------------------------//
7 7
 
@@ -242,7 +242,7 @@ if ($ThreadInfo['LastPostAuthorID'] == $LoggedUser['ID'] && ((!check_perms('site
242 242
     'Body'         => $Body,
243 243
     'EditedUserID' => 0,
244 244
     'EditedTime'   => NULL,
245
-    'Username'     => $LoggedUser['Username'] //TODO: Remove, it's never used?
245
+    'Username'     => $LoggedUser['Username'] // todo: Remove, it's never used?
246 246
   ]);
247 247
   $Cache->commit_transaction(0);
248 248
 

+ 3
- 1
sections/forums/thread.php View File

@@ -1,5 +1,7 @@
1 1
 <?php
2
-//TODO: Normalize thread_*_info don't need to waste all that ram on things that are already in other caches
2
+
3
+// todo: Normalize thread_*_info don't need to waste all that ram on things that are already in other caches
4
+
3 5
 /**********|| Page to show individual threads || ********************************\
4 6
 
5 7
 Things to expect in $_GET:

+ 5
- 5
sections/inbox/get_post.php View File

@@ -1,5 +1,7 @@
1
-<?
2
-//TODO: make this use the cache version of the thread, save the db query
1
+<?php
2
+
3
+// todo: make this use the cache version of the thread, save the db query
4
+
3 5
 /*********************************************************************\
4 6
 //--------------Get Post--------------------------------------------//
5 7
 
@@ -13,7 +15,7 @@ $_GET['post'], which is the ID of the post.
13 15
 
14 16
 // Quick SQL injection check
15 17
 if (!$_GET['post'] || !is_number($_GET['post'])) {
16
-  error(0);
18
+    error(0);
17 19
 }
18 20
 
19 21
 // Variables for database input
@@ -32,5 +34,3 @@ $Body = apcu_exists('DBKEY') ? Crypto::decrypt($Body) : '[Encrypted]';
32 34
 // This gets sent to the browser, which echoes it wherever
33 35
 
34 36
 echo trim($Body);
35
-
36
-?>

+ 7
- 8
sections/index/index.php View File

@@ -1,17 +1,16 @@
1
-<?
1
+<?php
2 2
 if (isset($LoggedUser['ID'])) {
3
-  if (!isset($_REQUEST['action'])) {
4
-    include('private.php');
5
-  } else {
6
-    switch ($_REQUEST['action']) {
3
+    if (!isset($_REQUEST['action'])) {
4
+        include('private.php');
5
+    } else {
6
+        switch ($_REQUEST['action']) {
7 7
       case 'poll':
8 8
         include(SERVER_ROOT.'/sections/forums/poll_vote.php');
9 9
         break;
10 10
       default:
11 11
         error(0);
12 12
     }
13
-  }
13
+    }
14 14
 } else {
15
-  header('Location: login.php');
15
+    header('Location: login.php');
16 16
 }
17
-?>

+ 9
- 4
sections/index/private.php View File

@@ -169,6 +169,8 @@ if (count($Freeleeches)) {
169 169
 <?
170 170
 }
171 171
 ?>
172
+
173
+<!-- Stats -->
172 174
     <div class="box">
173 175
       <div class="head colhead_dark"><strong>Stats</strong></div>
174 176
       <ul class="stats nobullet">
@@ -260,7 +262,7 @@ if (($ArtistCount = $Cache->get_value('stats_artist_count')) === false) {
260 262
         <li>Torrent Groups: <?=number_format($GroupCount)?></li>
261 263
         <li>Artists: <?=number_format($ArtistCount)?></li>
262 264
 <?
263
-//End Torrent Stats
265
+// End Torrent Stats
264 266
 
265 267
 if (($RequestStats = $Cache->get_value('stats_requests')) === false) {
266 268
   $DB->query("
@@ -277,7 +279,7 @@ if (($RequestStats = $Cache->get_value('stats_requests')) === false) {
277 279
   list($RequestCount, $FilledCount) = $RequestStats;
278 280
 }
279 281
 
280
-// do not divide by zero
282
+// Do not divide by zero
281 283
 if ($RequestCount > 0) {
282 284
   $RequestsFilledPercent = $FilledCount / $RequestCount * 100;
283 285
 } else {
@@ -295,7 +297,7 @@ if ($SnatchStats = $Cache->get_value('stats_snatches')) {
295 297
 }
296 298
 
297 299
 if (($PeerStats = $Cache->get_value('stats_peers')) === false) {
298
-  //Cache lock!
300
+  // Cache lock!
299 301
   $PeerStatsLocked = $Cache->get_value('stats_peers_lock');
300 302
   if (!$PeerStatsLocked) {
301 303
     $Cache->cache_value('stats_peers_lock', 1, 30);
@@ -330,6 +332,8 @@ if (!$PeerStatsLocked) {
330 332
         <li>Seeder/leecher ratio: <?=$Ratio?></li>
331 333
       </ul>
332 334
     </div>
335
+
336
+    <!-- Polls -->
333 337
 <?
334 338
 if (($TopicID = $Cache->get_value('polls_featured')) === false) {
335 339
   $DB->query("
@@ -388,6 +392,7 @@ if ($TopicID) {
388 392
   list($UserResponse) = $DB->next_record();
389 393
 
390 394
 ?>
395
+
391 396
     <div class="box">
392 397
       <div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' [Closed]'; } ?></strong></div>
393 398
       <div class="pad">
@@ -430,7 +435,7 @@ if ($TopicID) {
430 435
     </div>
431 436
 <?
432 437
 }
433
-//polls();
438
+// polls();
434 439
 ?>
435 440
   </div>
436 441
   <div class="main_column">

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

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-/*-- TODO ---------------------------//
3
+/*-- todo ---------------------------//
4 4
 Add the JavaScript validation into the display page using the class
5 5
 //-----------------------------------*/
6 6
 

+ 50
- 25
sections/login/login.php View File

@@ -1,30 +1,51 @@
1
-<? View::show_header('Login'); ?>
2
-  <span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
3
-<?
4
-if (!$Banned) {
1
+<?php
2
+View::show_header('Login');
5 3
 ?>
6
-  <form class="auth_form" name="login" id="loginform" method="post" action="login.php">
7
-<?
4
+
5
+<span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
6
+
7
+<?php
8
+if (!$Banned) {
9
+    ?>
10
+
11
+<form class="auth_form" name="login" id="loginform" method="post" action="login.php">
12
+
13
+  <?php
8 14
   if (isset($Err)) {
9
-?>
15
+      ?>
16
+
10 17
   <span class="warning"><?=$Err?><br /><br /></span>
11
-<?  } ?>
12
-<?  if ($Attempts > 0) { ?>
13
-  You have <span class="info"><?=(6 - $Attempts)?></span> attempts remaining.<br /><br />
18
+
19
+  <?php
20
+  } ?>
21
+
22
+  <?php if ($Attempts > 0) { ?>
23
+
24
+  You have <span class="info"><?=(6 - $Attempts)?></span> attempts
25
+  remaining.<br /><br />
14 26
   <strong>WARNING:</strong> You will be banned for 6 hours after your login attempts run out!<br /><br />
15
-<?  } ?>
27
+
28
+  <?php } ?>
29
+
16 30
   <table class="layout">
31
+
32
+    <!-- todo: Put index page stats here -->
33
+
17 34
     <tr>
18 35
       <td colspan="2">
19
-        <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" placeholder="Username" size="40" />
36
+        <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="username"
37
+          id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}"
38
+          autofocus="autofocus" placeholder="Username" size="40" />
20 39
       </td>
21 40
     </tr>
22 41
     <tr>
23 42
       <td>
24
-        <input type="password" name="password" id="password" class="inputtext" required="required" maxlength="307200" pattern=".{6,307200}" placeholder="Password" />
43
+        <input type="password" name="password" id="password" class="inputtext" required="required" maxlength="307200"
44
+          pattern=".{6,307200}" placeholder="Password" />
25 45
       </td>
26 46
       <td>
27
-        <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}" inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA" />
47
+        <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}"
48
+          inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA" />
28 49
       </td>
29 50
     </tr>
30 51
     <tr>
@@ -33,18 +54,22 @@ if (!$Banned) {
33 54
       </td>
34 55
     </tr>
35 56
   </table>
36
-  </form>
37
-<?
57
+</form>
58
+<?php
38 59
 } else {
39
-?>
40
-  <span class="warning">You are banned from logging in for a few hours.</span>
41
-<?
42
-}
60
+      ?>
61
+<span class="warning">You are banned from logging in for a few hours.</span>
62
+<?php
63
+  }
43 64
 
44 65
 if ($Attempts > 0) {
45
-?>
46
-  <br /><br />
47
-  Forgot your password? <a href="login.php?act=recover" class="tooltip" title="Recover your password" style="text-decoration: underline;">Reset it here!</a>
48
-<?
66
+    ?>
67
+
68
+<br /><br />
69
+Forgot your password? <a href="login.php?act=recover" class="tooltip" title="Recover your password"
70
+  style="text-decoration: underline;">Reset it here!</a>
71
+
72
+<?php
49 73
 }
50
-View::show_footer(); ?>
74
+
75
+View::show_footer();

+ 8
- 7
sections/reportsv2/search.php View File

@@ -1,21 +1,22 @@
1
-<?
1
+<?php
2
+
2 3
 /*
3
- * TODO: I'm not writing documentation for this page until I write this page >.>
4
+ * todo: I'm not writing documentation for this page until I write this page >.>
4 5
  */
6
+
5 7
 if (!check_perms('admin_reports')) {
6
-  error(403);
8
+    error(403);
7 9
 }
8 10
 
9 11
 View::show_header('Reports V2!', 'reportsv2');
10
-
11 12
 ?>
13
+
12 14
 <div class="header">
13 15
   <h2>Search</h2>
14
-<? include('header.php'); ?>
16
+  <?php include('header.php'); ?>
15 17
 </div>
16 18
 <div class="thin box pad">
17 19
   On hold until someone fixes the main torrents search.
18 20
 </div>
19
-<?
21
+<?php
20 22
 View::show_footer();
21
-?>

+ 2
- 2
sections/requests/new_edit.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-# @todo Fix multiple authors and bounty preview
3
+# todo: Fix multiple authors and bounty preview
4 4
 
5 5
 /*
6 6
  * Yeah, that's right, edit and new are the same place again.
@@ -350,7 +350,7 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
350 350
             <input type="hidden" id="current_downloaded"
351 351
               value="<?= $LoggedUser['BytesDownloaded'] ?>" />
352 352
             <ul>
353
-              <!-- @todo Return this feature
353
+              <!-- todo: Return this feature
354 354
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">90.00 MB</span></li> -->
355 355
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span>
356 356
               </li>

+ 1
- 1
sections/requests/request.php View File

@@ -322,7 +322,7 @@ $encoded_artist = urlencode($encoded_artist);
322 322
             <input id="total_bounty" type="hidden" value="<?=$RequestVotes['TotalBounty']?>" />
323 323
 
324 324
             <ul>
325
-              <!-- @todo Return this feature
325
+              <!-- todo: Return this feature
326 326
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">0.00 MiB</span></li> -->
327 327
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span></li>
328 328
               <li><strong>Ratio:</strong> <span id="new_ratio"><?= Format::get_ratio_html($LoggedUser['BytesUploaded'],$LoggedUser['BytesDownloaded']) ?></span></li>

+ 6
- 8
sections/schedule/daily/ratio_reqs.php View File

@@ -1,4 +1,4 @@
1
-<?
1
+<?php
2 2
 //------------------- Ratio requirements -----------------------//
3 3
 
4 4
 // Clear old seed time history
@@ -63,26 +63,24 @@ $DB->query("
63 63
   WHERE s.NumSnatches > 0");
64 64
 
65 65
 
66
-// TODO: change from PHP_INT_MAX to INF when we get prepared statements working (because apparently that works)
66
+// todo: Change from PHP_INT_MAX to INF when we get prepared statements working (because apparently that works)
67 67
 $DownloadBarrier = PHP_INT_MAX;
68 68
 
69 69
 foreach (RATIO_REQUIREMENTS as $Requirement) {
70
-  list($Download, $Ratio, $MinRatio) = $Requirement;
70
+    list($Download, $Ratio, $MinRatio) = $Requirement;
71 71
 
72
-  $DB->query("
72
+    $DB->query("
73 73
     UPDATE users_main
74 74
     SET RequiredRatio = RequiredRatioWork * $Ratio
75 75
     WHERE Downloaded >= $Download
76 76
       AND Downloaded < $DownloadBarrier");
77 77
 
78
-  $DB->query("
78
+    $DB->query("
79 79
     UPDATE users_main
80 80
     SET RequiredRatio = $MinRatio
81 81
     WHERE Downloaded >= $Download
82 82
       AND Downloaded < $DownloadBarrier
83 83
       AND RequiredRatio < $MinRatio");
84 84
 
85
-  $DownloadBarrier = $Download;
85
+    $DownloadBarrier = $Download;
86 86
 }
87
-
88
-?>

+ 7
- 7
sections/schedule/hourly/front_page_stats.php View File

@@ -1,14 +1,15 @@
1
-<?
1
+<?php
2
+
2 3
 //------------- Front page stats ----------------------------------------//
3 4
 
4
-//Love or hate, this makes things a hell of a lot faster
5
+// Love or hate, this makes things a hell of a lot faster
5 6
 
6
-if ($Hour % 2 == 0) {
7
-  $DB->query("
7
+if ($Hour % 2 === 0) {
8
+    $DB->query("
8 9
     SELECT COUNT(uid) AS Snatches
9 10
     FROM xbt_snatched");
10
-  list($SnatchStats) = $DB->next_record();
11
-  $Cache->cache_value('stats_snatches', $SnatchStats, 0);
11
+    list($SnatchStats) = $DB->next_record();
12
+    $Cache->cache_value('stats_snatches', $SnatchStats, 0);
12 13
 }
13 14
 
14 15
 $DB->query("
@@ -44,4 +45,3 @@ $DB->query("
44 45
 list($UserStats['Month']) = $DB->next_record();
45 46
 
46 47
 $Cache->cache_value('stats_users', $UserStats, 0);
47
-?>

+ 9
- 11
sections/staffpm/get_post.php View File

@@ -1,5 +1,6 @@
1
-<?
2
-//TODO: make this use the cache version of the thread, save the db query
1
+<?php
2
+// todo: Make this use the cache version of the thread, save the db query
3
+
3 4
 /*********************************************************************\
4 5
 //--------------Get Post--------------------------------------------//
5 6
 
@@ -13,14 +14,13 @@ $_GET['post'], which is the ID of the post.
13 14
 
14 15
 // Quick SQL injection check
15 16
 if (!$_GET['post'] || !is_number($_GET['post'])) {
16
-  error(0);
17
+    error(0);
17 18
 }
18 19
 
19 20
 // Variables for database input
20 21
 $PostID = $_GET['post'];
21 22
 
22
-// Message is selected providing the user quoting is the guy who opened the PM or has
23
-// the right level
23
+// Message is selected providing the user quoting is the guy who opened the PM or has the right level
24 24
 $DB->query("
25 25
   SELECT m.Message, c.Level, c.UserID
26 26
   FROM staff_pm_messages AS m
@@ -28,11 +28,9 @@ $DB->query("
28 28
   WHERE m.ID = '$PostID'");
29 29
 list($Message, $Level, $UserID) = $DB->next_record(MYSQLI_NUM);
30 30
 
31
-if (($LoggedUser['ID'] == $UserID) || ($IsFLS && $LoggedUser['Class'] >= $Level)) {
32
-  // This gets sent to the browser, which echoes it wherever
33
-  echo trim($Message);
31
+if (($LoggedUser['ID'] === $UserID) || ($IsFLS && $LoggedUser['Class'] >= $Level)) {
32
+    // This gets sent to the browser, which echoes it wherever
33
+    echo trim($Message);
34 34
 } else {
35
-  error(403);
35
+    error(403);
36 36
 }
37
-
38
-?>

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

@@ -351,7 +351,7 @@ switch ($_REQUEST['action']) {
351 351
     break;
352 352
 
353 353
   case 'ip_ban':
354
-    //TODO: Clean up DB table ip_bans.
354
+    // todo: Clean up DB table ip_bans
355 355
     include(SERVER_ROOT.'/sections/tools/managers/bans.php');
356 356
     break;
357 357
   case 'quick_ban':

+ 1
- 1
sections/tools/managers/enable_requests.php View File

@@ -35,7 +35,7 @@ $OrderBy = "uer.Timestamp";
35 35
 $OrderWay = "DESC";
36 36
 
37 37
 // Build query for different views
38
-// TODO: Work with encrypted values
38
+// todo: Work with encrypted values
39 39
 if (!isset($_GET['view'])) {
40 40
   $_GET['view'] = 'main';
41 41
 }

+ 1
- 1
sections/tools/managers/label_aliases.php View File

@@ -15,7 +15,7 @@ $OrderBy = $_GET['order'] === 'BadLabels' ? 'BadLabel' : 'AliasLabel';
15 15
 /*
16 16
 $LabelID = (int)$_GET['id'];
17 17
 $LabelNameSQL = '';
18
-//TODO join with labels table to get label name
18
+// todo: Join with labels table to get label name
19 19
 if (!empty($LabelID)) {
20 20
   $DB->query("
21 21
     SELECT name

+ 1
- 1
sections/tools/misc/create_user.php View File

@@ -1,5 +1,5 @@
1 1
 <?
2
-//TODO: rewrite this, make it cleaner, make it work right, add it common stuff
2
+// todo: Rewrite this, make it cleaner, make it work right, add it common stuff
3 3
 if (!check_perms('admin_create_users')) {
4 4
   error(403);
5 5
 }

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

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-# @todo Go through line by line
3
+# todo: Go through line by line
4 4
 
5 5
 include(SERVER_ROOT.'/sections/torrents/functions.php');
6 6
 

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

@@ -777,7 +777,7 @@ $filename = "BioTorrents.de-$TorrentID";
777 777
   note    = {Online; accessed ".strftime('%Y-%m-%d')."},
778 778
 },"; ?>
779 779
 
780
-              <!-- @todo Download BibTeX citation feature
780
+              <!-- todo: Download BibTeX citation feature
781 781
 <form method="post" action="download.php">
782 782
 <input type="hidden" name="file" id="file" value="< ? = urlencode($filename) ? >"
783 783
               />
@@ -1000,7 +1000,7 @@ if (count($PersonalCollages) > 0) {
1000 1000
         $ThumbURL = ImageTools::process($Screenshot['Image'], 'thumb');
1001 1001
         */
1002 1002
 
1003
-      /* @todo Bring this back
1003
+      /* todo: Bring this back
1004 1004
       if (check_perms('users_mod')) {
1005 1005
         ?><img class='tooltip lightbox-init' title='<?=Users::format_username($Screenshot['UserID'], false, false, false)?> - <?=time_diff($Screenshot['Time'])?>' lightbox-img="<?=$SSURL?>" src="<?=$ThumbURL?>" /><?
1006 1006
       } else {

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

@@ -433,7 +433,7 @@ $DB->query("
433 433
   WHERE ID = $GroupID");
434 434
 list($Name) = $DB->next_record(MYSQLI_NUM, false);
435 435
 
436
-Misc::write_log("Torrent $TorrentID ($Name) in group $GroupID was edited by ".$LoggedUser['Username']." ($LogDetails)"); // TODO: this is probably broken
436
+Misc::write_log("Torrent $TorrentID ($Name) in group $GroupID was edited by ".$LoggedUser['Username']." ($LogDetails)"); // todo: This is probably broken
437 437
 Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $LogDetails, 0);
438 438
 $Cache->delete_value("torrents_details_$GroupID");
439 439
 $Cache->delete_value("torrent_download_$TorrentID");

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

@@ -31,7 +31,7 @@ $Feed = new Feed;
31 31
 //--------------- Set $Properties array ---------------------------------------//
32 32
 // This is used if the form doesn't validate, and when the time comes to enter //
33 33
 // it into the database.                 
34
-// @todo Do something about this mess
34
+// todo: Do something about this mess
35 35
 //****************************************************************************//
36 36
 
37 37
 $Properties = [];
@@ -131,7 +131,7 @@ $Validate->SetFields(
131 131
     array('inarray' => array_keys($Categories))
132 132
 );
133 133
 
134
-# @todo Remove the switch statement
134
+# todo: Remove the switch statement
135 135
 switch ($Type) {
136 136
     /*
137 137
   case 'Imaging':
@@ -231,6 +231,16 @@ default:
231 231
             array('inarray' => array_merge($Media, $MediaManga, $Platform))
232 232
         );
233 233
 
234
+        # torrents.Container
235
+        $Validate->SetFields(
236
+            'container',
237
+            '1',
238
+            'inarray',
239
+            'Please select a valid format.',
240
+            array('inarray' => array_merge($Containers, $ContainersGames, ContainersProt))
241
+        );
242
+
243
+        /*
234 244
         # torrents.Container
235 245
         $Validate->SetFields(
236 246
             'container',
@@ -239,6 +249,7 @@ default:
239 249
             'Please select a valid format.',
240 250
             array('inarray' => array_merge($Containers, $ContainersGames))
241 251
         );
252
+        */
242 253
 
243 254
         # torrents_group.TagList
244 255
         $Validate->SetFields(
@@ -509,7 +520,7 @@ if (!isset($GroupID) || !$GroupID) {
509 520
     $Cache->increment('stats_group_count');
510 521
 
511 522
     // Add screenshots
512
-    // @todo Clear DB_MYSQL::exec_prepared_query() errors
523
+    // todo: Clear DB_MYSQL::exec_prepared_query() errors
513 524
     $Screenshots = explode("\n", $T['Screenshots']);
514 525
     $Screenshots = array_map('trim', $Screenshots);
515 526
 
@@ -661,7 +672,7 @@ $Debug->set_flag('upload: ocelot updated');
661 672
 $Cache->cache_value("torrent_{$TorrentID}_lock", true, 600);
662 673
 
663 674
 // Give BP if necessary
664
-// @todo Repurpose this
675
+// todo: Repurpose this
665 676
 if (($Type === "Movies" || $Type === "Anime") && ($T['Container'] === 'ISO' || $T['Container'] === 'M2TS' || $T['Container'] === 'VOB IFO')) {
666 677
     $BPAmt = (int) 2*($TotalSize / (1024*1024*1024))*1000;
667 678
 

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

@@ -1,5 +1,5 @@
1 1
 <?
2
-//TODO
2
+// todo
3 3
 /*****************************************************************
4 4
 Finish removing the take[action] pages and utilize the index correctly
5 5
 Should the advanced search really only show if they match 3 perms?

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

@@ -1,5 +1,5 @@
1 1
 <?
2
-//TODO: Redo HTML
2
+// todo: Redo HTML
3 3
 if (!check_perms('admin_manage_permissions')) {
4 4
   error(403);
5 5
 }

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

@@ -1,6 +1,6 @@
1 1
 <?
2 2
 
3
-//TODO: restrict to viewing below class, username in h2
3
+//todo: restrict to viewing below class, username in h2
4 4
 if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
5 5
   if (!is_number($_GET['userid'])) {
6 6
     error(404);

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

@@ -236,7 +236,7 @@ if (check_perms('site_advanced_search')) {
236 236
   unset($Options['SearchType']);
237 237
 }
238 238
 
239
-//TODO: Remove the following after a significant amount of time
239
+// todo: Remove the following after a significant amount of time
240 240
 unset($Options['ArtistNoRedirect']);
241 241
 unset($Options['ShowQueryList']);
242 242
 unset($Options['ShowCacheList']);

+ 1
- 1
sections/userhistory/email_history2.php View File

@@ -29,7 +29,7 @@ if (!check_perms('users_view_email', $Class)) {
29 29
   error(403);
30 30
 }
31 31
 
32
-// TODO: Is this even used?
32
+// todo: Is this even used?
33 33
 $UsersOnly = $_GET['usersonly'] ?? false;
34 34
 
35 35
 $DB->query("

+ 8
- 8
static/functions/ajax.class.js View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  TODO: Further optimize serialize function
2
+  todo: Further optimize serialize function
3 3
 
4 4
   UPDATE: We were forced to create an individual XHR for each request
5 5
   to avoid race conditions on slower browsers where the request would
@@ -18,7 +18,6 @@
18 18
     $('#quickpost').raw().value = "[quote="+username+"]" + ajax.response + "[/quote]";
19 19
   }
20 20
   ajax.get("?action=get_post&post=" + postid);
21
-
22 21
 */
23 22
 "use strict";
24 23
 var ajax = {
@@ -96,13 +95,14 @@ var ajax = {
96 95
     return query.substr(0, query.length - 1);
97 96
   }
98 97
 };
99
-//Bookmarks
98
+
99
+// Bookmarks
100 100
 function Bookmark(type, id, newName) {
101 101
   var bmLinks = $('#bookmarklink_' + type + '_' + id + ', .bookmarklink_' + type + '_' + id);
102 102
   var oldName = bmLinks.html();
103
-  ajax.get("bookmarks.php?action=add&type=" + type + "&auth=" + authkey + "&id=" + id, function() {
103
+  ajax.get("bookmarks.php?action=add&type=" + type + "&auth=" + authkey + "&id=" + id, function () {
104 104
     bmLinks.parent('.remove_bookmark, .add_bookmark').toggleClass('add_bookmark remove_bookmark');
105
-    bmLinks.html(newName).attr('title', 'Remove bookmark').removeAttr('onclick').off('click').click(function() {
105
+    bmLinks.html(newName).attr('title', 'Remove bookmark').removeAttr('onclick').off('click').click(function () {
106 106
       Unbookmark(type, id, oldName);
107 107
       return false;
108 108
     });
@@ -111,7 +111,7 @@ function Bookmark(type, id, newName) {
111 111
 
112 112
 function Unbookmark(type, id, newName) {
113 113
   if (window.location.pathname.indexOf('bookmarks.php') != -1) {
114
-    ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() {
114
+    ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function () {
115 115
       $('#group_' + id).remove();
116 116
       $('.image_group_' + id).remove();
117 117
       $('.groupid_' + id).remove();
@@ -121,9 +121,9 @@ function Unbookmark(type, id, newName) {
121 121
   } else {
122 122
     var bmLinks = $('#bookmarklink_' + type + '_' + id + ', .bookmarklink_' + type + '_' + id);
123 123
     var oldName = bmLinks.html();
124
-    ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() {
124
+    ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function () {
125 125
       bmLinks.parent('.remove_bookmark, .add_bookmark').toggleClass('add_bookmark remove_bookmark');
126
-      bmLinks.html(newName).attr('title', 'Add bookmark').removeAttr('onclick').off('click').click(function() {
126
+      bmLinks.html(newName).attr('title', 'Add bookmark').removeAttr('onclick').off('click').click(function () {
127 127
         Bookmark(type, id, oldName);
128 128
         return false;
129 129
       });

+ 1
- 1
static/functions/bbcode.js View File

@@ -61,7 +61,7 @@ function EmojiBox(box) {
61 61
 }
62 62
 
63 63
 function BBEditor(box) {
64
-  // @todo Integrate BioJS functions here
64
+  // todo: Integrate BioJS functions here
65 65
   if (box.previousSibling && box.previousSibling.className == 'bbcode_bar') return
66 66
   let buttons = [
67 67
     {short:'B', name:'Bold', wrap:['[b]','[/b]']},

+ 2
- 1
static/functions/cookie.class.js View File

@@ -1,6 +1,7 @@
1 1
 /*
2
-  TODO: Document.
2
+  todo: Document
3 3
 */
4
+
4 5
 "use strict";
5 6
 var cookie = {
6 7
   get: function (cookie_name) {

+ 2
- 1
static/functions/countdown.class.js View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  TODO: Move to more efficient structure used in ajax.class.
2
+  todo: Move to more efficient structure used in ajax.class
3 3
 
4 4
   Example Usage:
5 5
   <script type="text/javascript">
@@ -12,6 +12,7 @@
12 12
     }
13 13
   </script>
14 14
 */
15
+
15 16
 "use strict";
16 17
 var count = {
17 18
   update: function (Offset) {

+ 2
- 1
static/functions/storage.class.js View File

@@ -1,6 +1,7 @@
1 1
 /*
2
-  TODO: Document.
2
+  todo: Document
3 3
 */
4
+
4 5
 "use strict";
5 6
 
6 7
 var cookie = {

+ 0
- 83
templates/filemap.csv View File

@@ -1,83 +0,0 @@
1
-# Containers
2
-# https://www.ncbi.nlm.nih.gov/sra/docs/submitformats/
3
-
4
-BAM		bam
5
-CRAM		cram
6
-EMBL		embl
7
-FASTA		fasta || fa || fsa
8
-FASTA+QUAL	fasta && qual
9
-CSFASTA+QUAL	csfasta && qual
10
-FASTQ		fastq || sanfastq || fq
11
-GFF		gff2 || gff3 || gff
12
-GTF		gtf
13
-GenBank		gb || gbk
14
-HDF5		hdf5 || (bash5 && baxh5) || fast5
15
-PIR		pir
16
-QSeq		qseq
17
-SAM		sam
18
-SFF		sff
19
-SRF		srf
20
-SnapGene	dna seq
21
-SwissProt	dat
22
-VCF		vcf
23
-Plain		txt csv
24
-
25
-
26
-# ContainersProt
27
-# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3518119/
28
-# DO NOT PARSE RAW FILES. TOO MANY COMPETING VENDORS
29
-
30
-ABI/Sciex	wiff t2d
31
-APML		apml
32
-ASF		asf
33
-Agilent/Bruker	d yep baf tdf fid
34
-BlibBuild	blib
35
-Bruker/Varian	sms xms
36
-Finnigan	dat ms
37
-ION-TOF		itm ita
38
-JCAMP-DX	jdx
39
-MGF		mgf
40
-MS2		ms2
41
-MSF		msf
42
-OMSSA		omx
43
-PEFF		peff
44
-Pickle		pkl pickle
45
-Shimadzu	qgd lcd spc
46
-Skyline		sky skyd
47
-TPP/SPC		dta
48
-Tandem		tandem
49
-TraML		traml
50
-ULVAC-PHI	tdc
51
-mzML		mzml
52
-mzXML		mzxml
53
-mzData		mzdata
54
-pepXML		pepxml
55
-protXML		protxml
56
-Plain		csv txt
57
-
58
-
59
-# ContainersGames
60
-# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3948928/
61
-
62
-Analyze		img || hdr
63
-#Interfile	img || hdr &| h33
64
-Dicom		dcm
65
-JPEG		jpg jpeg jfif
66
-JPEG 2000	jp2 j2k jpf jpx jpm mj2
67
-Minc		mnc
68
-Nifti		nii
69
-PNG		png
70
-TIFF		tiff tif
71
-WebP		webp
72
-Other		''
73
-
74
-
75
-# Archives
76
-
77
-7z		7z
78
-bzip2		bz2 bzip2
79
-gzip		gz gzip
80
-Pickle		pkl pickle
81
-RAR		rar rev
82
-ZIP		zip zipx
83
-None		''

Loading…
Cancel
Save