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

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

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

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
 
83
 
84
     /**
84
     /**
85
      * Format an array of artists for display.
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
      * @param array Artists an array of the form output by get_artists
88
      * @param array Artists an array of the form output by get_artists
89
      * @param boolean $MakeLink if true, the artists will be links, if false, they will be text.
89
      * @param boolean $MakeLink if true, the artists will be links, if false, they will be text.
199
     /**
199
     /**
200
      * Remove LRM (left-right-marker) and trims, because people copypaste carelessly.
200
      * Remove LRM (left-right-marker) and trims, because people copypaste carelessly.
201
      * If we don't do this, we get seemingly duplicate artist names.
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
      * @param string $ArtistName
204
      * @param string $ArtistName
205
      */
205
      */

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

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

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

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

+ 1
- 1
classes/classloader.php View File

7
 spl_autoload_register(function ($ClassName) {
7
 spl_autoload_register(function ($ClassName) {
8
   $FilePath = SERVER_ROOT . '/classes/' . strtolower($ClassName) . '.class.php';
8
   $FilePath = SERVER_ROOT . '/classes/' . strtolower($ClassName) . '.class.php';
9
   if (!file_exists($FilePath)) {
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
     switch ($ClassName) {
11
     switch ($ClassName) {
12
       case 'MASS_USER_BOOKMARKS_EDITOR':
12
       case 'MASS_USER_BOOKMARKS_EDITOR':
13
         $FileName = 'mass_user_bookmarks_editor.class';
13
         $FileName = 'mass_user_bookmarks_editor.class';

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

33
         list($CollageCount) = G::$DB->next_record();
33
         list($CollageCount) = G::$DB->next_record();
34
 
34
 
35
         if ($CollageCount >= G::$LoggedUser['Permissions']['MaxCollages']) {
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
             list($CollageID) = G::$DB->next_record();
37
             list($CollageID) = G::$DB->next_record();
38
             header('Location: collage.php?id='.$CollageID);
38
             header('Location: collage.php?id='.$CollageID);
39
             die();
39
             die();

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

49
    * @param int $PostID
49
    * @param int $PostID
50
    * @param string $NewBody
50
    * @param string $NewBody
51
    * @param bool $SendPM If true, send a PM to the author of the comment informing him about the edit
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
   public static function edit($PostID, $NewBody, $SendPM = false) {
55
   public static function edit($PostID, $NewBody, $SendPM = false) {
55
     $QueryID = G::$DB->get_query_id();
56
     $QueryID = G::$DB->get_query_id();
113
       Misc::send_pm($AuthorID, 0, $PMSubject, $PMBody);
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
    * @param string $Link The link to the post elsewhere on the site
24
    * @param string $Link The link to the post elsewhere on the site
25
    * @param string $Header The header used in the post
25
    * @param string $Header The header used in the post
26
    * @param bool $Tools Whether or not to show [Edit], [Report] etc.
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
   static function render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $EditedTime, $Link, $Unread = false, $Header = '', $Tools = true) {
30
   static function render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $EditedTime, $Link, $Unread = false, $Header = '', $Tools = true) {
30
     $UserInfo = Users::user_info($AuthorID);
31
     $UserInfo = Users::user_info($AuthorID);

+ 2
- 2
classes/config.template View File

102
 define('FORUM_MOD',      '9001');
102
 define('FORUM_MOD',      '9001');
103
 
103
 
104
 // Forums
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
 define('TRASH_FORUM_ID',        8);
107
 define('TRASH_FORUM_ID',        8);
108
 define('ANNOUNCEMENT_FORUM_ID', 1);
108
 define('ANNOUNCEMENT_FORUM_ID', 1);
109
 
109
 

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

32
    * These characters are invalid in NTFS on Windows systems:
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
    * Only the following characters need to be escaped (see the link below):
37
    * Only the following characters need to be escaped (see the link below):
38
    *    \ - ^ ]
38
    *    \ - ^ ]

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

143
   return $Array;
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
 class DB_MYSQL {
147
 class DB_MYSQL {
148
   public $LinkID = false;
148
   public $LinkID = false;
149
   protected $QueryID = false;
149
   protected $QueryID = false;

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

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
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
604
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
604
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
605
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
605
     if (empty($Notifications)) {
606
     if (empty($Notifications)) {

+ 6
- 5
classes/script_start.php View File

37
 
37
 
38
 if (!isset($argv) && !empty($_SERVER['HTTP_HOST'])) {
38
 if (!isset($argv) && !empty($_SERVER['HTTP_HOST'])) {
39
   // Skip this block if running from cli or if the browser is old and shitty
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
   if ($_SERVER['HTTP_HOST'] == 'www.'.SITE_DOMAIN) {
42
   if ($_SERVER['HTTP_HOST'] == 'www.'.SITE_DOMAIN) {
42
     header('Location: https://'.SITE_DOMAIN.$_SERVER['REQUEST_URI']); die();
43
     header('Location: https://'.SITE_DOMAIN.$_SERVER['REQUEST_URI']); die();
43
   }
44
   }
73
 
74
 
74
 // Note: G::initialize is called twice.
75
 // Note: G::initialize is called twice.
75
 // This is necessary as the code inbetween (initialization of $LoggedUser) makes use of G::$DB and G::$Cache.
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
 G::initialize();
78
 G::initialize();
78
 
79
 
79
 //Begin browser identification
80
 //Begin browser identification
84
 $Debug->set_flag('start user handling');
85
 $Debug->set_flag('start user handling');
85
 
86
 
86
 // Get classes
87
 // Get classes
87
-// TODO: Remove these globals, replace by calls into Users
88
+// todo: Remove these globals, replace by calls into Users
88
 list($Classes, $ClassLevels) = Users::get_classes();
89
 list($Classes, $ClassLevels) = Users::get_classes();
89
 
90
 
90
 //-- Load user information
91
 //-- Load user information
100
   $SessionID = $_COOKIE['session'];
101
   $SessionID = $_COOKIE['session'];
101
   $LoggedUser['ID'] = (int)$_COOKIE['userid'];
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
   if (!$LoggedUser['ID'] || !$SessionID) {
106
   if (!$LoggedUser['ID'] || !$SessionID) {
106
     logout();
107
     logout();
292
     $Cache->cache_value('stylesheets', $Stylesheets, 0);
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
   $LoggedUser['StyleName'] = $Stylesheets[$LoggedUser['StyleID']]['Name'];
297
   $LoggedUser['StyleName'] = $Stylesheets[$LoggedUser['StyleID']]['Name'];
297
 
298
 
298
   if (empty($LoggedUser['Username'])) {
299
   if (empty($LoggedUser['Username'])) {

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

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

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

116
 }
116
 }
117
 
117
 
118
 // This is never used anywhere with $timestamp set
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
 function sqltime($timestamp = NULL) {
120
 function sqltime($timestamp = NULL) {
121
   return date('Y-m-d H:i:s', ($timestamp ?? time()));
121
   return date('Y-m-d H:i:s', ($timestamp ?? time()));
122
 }
122
 }

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

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

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

357
         if (!empty($Torrent['Artists'])) {
357
         if (!empty($Torrent['Artists'])) {
358
             foreach ($Torrent['Artists'] as $Num => $Artist) {
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
         value="<?= display_str($Artist['name']) ?>"
362
         value="<?= display_str($Artist['name']) ?>"
363
         <?= $this->Disabled ?>/>
363
         <?= $this->Disabled ?>/>
364
       <?php if ($Num === 0) { ?>
364
       <?php if ($Num === 0) { ?>
417
   </tr>
417
   </tr>
418
   <?php } # Ends if NewTorrent line 256?>
418
   <?php } # Ends if NewTorrent line 256?>
419
 
419
 
420
-    <!-- Encoding -->
421
-    <tr id="codec_tr">
420
+  <!-- Encoding -->
421
+  <tr id="codec_tr">
422
     <td class="label">
422
     <td class="label">
423
       License
423
       License
424
       <strong class="important_text">*</strong>
424
       <strong class="important_text">*</strong>
483
     </td>
483
     </td>
484
   </tr>
484
   </tr>
485
 
485
 
486
-    <!-- Resolution -->
487
-    <tr id="resolution_tr">
486
+  <!-- Resolution -->
487
+  <tr id="resolution_tr">
488
     <td class="label">
488
     <td class="label">
489
       Assembly Level
489
       Assembly Level
490
       <strong class="important_text">*</strong>
490
       <strong class="important_text">*</strong>
519
     </td>
519
     </td>
520
   </tr>
520
   </tr>
521
 
521
 
522
-  <!-- Container -->
522
+  <!-- Three container fields -->
523
   <tr id="container_tr">
523
   <tr id="container_tr">
524
     <td class="label">
524
     <td class="label">
525
       Format
525
       Format
529
       <select name="container">
529
       <select name="container">
530
         <option value="Autofill">Autofill</option>
530
         <option value="Autofill">Autofill</option>
531
         <?php
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
       </select><br />
535
       </select><br />
540
       Data file format, or detect from file list
536
       Data file format, or detect from file list
541
     </td>
537
     </td>
542
   </tr>
538
   </tr>
543
 
539
 
544
-  <!-- Alternate container 1 -->
540
+  <!-- 2 -->
545
   <tr id="container_games_tr">
541
   <tr id="container_games_tr">
546
     <td class="label">
542
     <td class="label">
547
       Format
543
       Format
551
       <select id="container" name="container">
547
       <select id="container" name="container">
552
         <option value="Autofill">Autofill</option>
548
         <option value="Autofill">Autofill</option>
553
         <?php
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
       </select><br />
553
       </select><br />
562
       Data file format, or detect from file list
554
       Data file format, or detect from file list
563
     </td>
555
     </td>
564
   </tr>
556
   </tr>
565
 
557
 
566
-    <!-- Alternate container 2 -->
567
-    <tr id="container_prot_tr">
558
+  <!-- 3 -->
559
+  <tr id="container_prot_tr">
568
     <td class="label">
560
     <td class="label">
569
       Format
561
       Format
570
       <strong class="important_text">*</strong>
562
       <strong class="important_text">*</strong>
573
       <select id="container" name="container">
565
       <select id="container" name="container">
574
         <option value="Autofill">Autofill</option>
566
         <option value="Autofill">Autofill</option>
575
         <?php
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
       </select><br />
571
       </select><br />
584
       Data file format, or detect from file list
572
       Data file format, or detect from file list
595
       <select name='archive'>
583
       <select name='archive'>
596
         <option value="Autofill">Autofill</option>
584
         <option value="Autofill">Autofill</option>
597
         <?php
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
               if ($Archive === ($Torrent['Archive'] ?? false)) {
588
               if ($Archive === ($Torrent['Archive'] ?? false)) {
601
                   echo ' selected';
589
                   echo ' selected';
602
               }
590
               }
603
-              echo ">$Archive</option>\n";
591
+              echo ">$Name</option>\n";
604
           } ?>
592
           } ?>
605
       </select><br />
593
       </select><br />
606
       Compression algorithm, or detect from file list
594
       Compression algorithm, or detect from file list

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

229
    * @param int $TorrentID
229
    * @param int $TorrentID
230
    * @param int $UserID
230
    * @param int $UserID
231
    * @param string $Message
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
   public static function write_group_log($GroupID, $TorrentID, $UserID, $Message, $Hidden) {
236
   public static function write_group_log($GroupID, $TorrentID, $UserID, $Message, $Hidden) {
235
     global $Time;
237
     global $Time;

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

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
 class Tracker {
3
 class Tracker {
4
   const STATS_MAIN = 0;
4
   const STATS_MAIN = 0;
5
   const STATS_USER = 1;
5
   const STATS_USER = 1;

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

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

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

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

+ 1
- 1
download.php View File

3
 /*
3
 /*
4
  * Force file downloads
4
  * Force file downloads
5
  * Currently used to download BibTeX citations
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
 if (isset($_POST['file']) && isset($_POST['content'])) {
9
 if (isset($_POST['file']) && isset($_POST['content'])) {

+ 1
- 0
gazelle.sql View File

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

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

19
 } else {
19
 } else {
20
 
20
 
21
   # Query the API
21
   # Query the API
22
-  # @todo Valida to change $db
22
+  # todo: Validate to change $db
23
 
23
 
24
-/* @todo
24
+/* todo
25
  * switch $category:
25
  * switch $category:
26
  *   case 'DNA' || 'RNA':
26
  *   case 'DNA' || 'RNA':
27
  *     if $number = refseq_regex:
27
  *     if $number = refseq_regex:

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

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

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

1
 <?php
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
 /**********|| Page to show individual threads || ********************************\
3
 /**********|| Page to show individual threads || ********************************\
4
 
4
 
5
 Things to expect in $_GET:
5
 Things to expect in $_GET:

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

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

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

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
 This page is something of a hack so those
4
 This page is something of a hack so those
5
 easily scared off by funky solutions, don't
5
 easily scared off by funky solutions, don't

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

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

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

26
 
26
 
27
 $EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
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
 $TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
31
 $TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
32
 $TT->render_all();
32
 $TT->render_all();

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

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

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

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

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

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
 enforce_login();
3
 enforce_login();
4
 
4
 
5
-//Include the header
5
+// Include the header
6
 if ($LoggedUser['RatioWatch']) {
6
 if ($LoggedUser['RatioWatch']) {
7
   error('Due to the high volume of payment disputes, we do not accept donations from users on ratio watch. Sorry.');
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
 <?
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
 //--------------Get Post--------------------------------------------//
4
 //--------------Get Post--------------------------------------------//
5
 
5
 

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

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

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

1
 <?
1
 <?
2
 authorize();
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
 //--------------Take Post--------------------------------------------//
6
 //--------------Take Post--------------------------------------------//
7
 
7
 
242
     'Body'         => $Body,
242
     'Body'         => $Body,
243
     'EditedUserID' => 0,
243
     'EditedUserID' => 0,
244
     'EditedTime'   => NULL,
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
   $Cache->commit_transaction(0);
247
   $Cache->commit_transaction(0);
248
 
248
 

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

1
 <?php
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
 /**********|| Page to show individual threads || ********************************\
5
 /**********|| Page to show individual threads || ********************************\
4
 
6
 
5
 Things to expect in $_GET:
7
 Things to expect in $_GET:

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

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
 //--------------Get Post--------------------------------------------//
6
 //--------------Get Post--------------------------------------------//
5
 
7
 
13
 
15
 
14
 // Quick SQL injection check
16
 // Quick SQL injection check
15
 if (!$_GET['post'] || !is_number($_GET['post'])) {
17
 if (!$_GET['post'] || !is_number($_GET['post'])) {
16
-  error(0);
18
+    error(0);
17
 }
19
 }
18
 
20
 
19
 // Variables for database input
21
 // Variables for database input
32
 // This gets sent to the browser, which echoes it wherever
34
 // This gets sent to the browser, which echoes it wherever
33
 
35
 
34
 echo trim($Body);
36
 echo trim($Body);
35
-
36
-?>

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

1
-<?
1
+<?php
2
 if (isset($LoggedUser['ID'])) {
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
       case 'poll':
7
       case 'poll':
8
         include(SERVER_ROOT.'/sections/forums/poll_vote.php');
8
         include(SERVER_ROOT.'/sections/forums/poll_vote.php');
9
         break;
9
         break;
10
       default:
10
       default:
11
         error(0);
11
         error(0);
12
     }
12
     }
13
-  }
13
+    }
14
 } else {
14
 } else {
15
-  header('Location: login.php');
15
+    header('Location: login.php');
16
 }
16
 }
17
-?>

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

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

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

1
 <?php
1
 <?php
2
 
2
 
3
-/*-- TODO ---------------------------//
3
+/*-- todo ---------------------------//
4
 Add the JavaScript validation into the display page using the class
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
-<? 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
   if (isset($Err)) {
14
   if (isset($Err)) {
9
-?>
15
+      ?>
16
+
10
   <span class="warning"><?=$Err?><br /><br /></span>
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
   <strong>WARNING:</strong> You will be banned for 6 hours after your login attempts run out!<br /><br />
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
   <table class="layout">
30
   <table class="layout">
31
+
32
+    <!-- todo: Put index page stats here -->
33
+
17
     <tr>
34
     <tr>
18
       <td colspan="2">
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
       </td>
39
       </td>
21
     </tr>
40
     </tr>
22
     <tr>
41
     <tr>
23
       <td>
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
       </td>
45
       </td>
26
       <td>
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
       </td>
49
       </td>
29
     </tr>
50
     </tr>
30
     <tr>
51
     <tr>
33
       </td>
54
       </td>
34
     </tr>
55
     </tr>
35
   </table>
56
   </table>
36
-  </form>
37
-<?
57
+</form>
58
+<?php
38
 } else {
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
 if ($Attempts > 0) {
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
-<?
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
 if (!check_perms('admin_reports')) {
7
 if (!check_perms('admin_reports')) {
6
-  error(403);
8
+    error(403);
7
 }
9
 }
8
 
10
 
9
 View::show_header('Reports V2!', 'reportsv2');
11
 View::show_header('Reports V2!', 'reportsv2');
10
-
11
 ?>
12
 ?>
13
+
12
 <div class="header">
14
 <div class="header">
13
   <h2>Search</h2>
15
   <h2>Search</h2>
14
-<? include('header.php'); ?>
16
+  <?php include('header.php'); ?>
15
 </div>
17
 </div>
16
 <div class="thin box pad">
18
 <div class="thin box pad">
17
   On hold until someone fixes the main torrents search.
19
   On hold until someone fixes the main torrents search.
18
 </div>
20
 </div>
19
-<?
21
+<?php
20
 View::show_footer();
22
 View::show_footer();
21
-?>

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

1
 <?php
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
  * Yeah, that's right, edit and new are the same place again.
6
  * Yeah, that's right, edit and new are the same place again.
350
             <input type="hidden" id="current_downloaded"
350
             <input type="hidden" id="current_downloaded"
351
               value="<?= $LoggedUser['BytesDownloaded'] ?>" />
351
               value="<?= $LoggedUser['BytesDownloaded'] ?>" />
352
             <ul>
352
             <ul>
353
-              <!-- @todo Return this feature
353
+              <!-- todo: Return this feature
354
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">90.00 MB</span></li> -->
354
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">90.00 MB</span></li> -->
355
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span>
355
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span>
356
               </li>
356
               </li>

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

322
             <input id="total_bounty" type="hidden" value="<?=$RequestVotes['TotalBounty']?>" />
322
             <input id="total_bounty" type="hidden" value="<?=$RequestVotes['TotalBounty']?>" />
323
 
323
 
324
             <ul>
324
             <ul>
325
-              <!-- @todo Return this feature
325
+              <!-- todo: Return this feature
326
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">0.00 MiB</span></li> -->
326
               <li><strong>Bounty:</strong> <span id="bounty_after_tax">0.00 MiB</span></li> -->
327
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span></li>
327
               <li><strong>Uploaded:</strong> <span id="new_uploaded"><?= Format::get_size($LoggedUser['BytesUploaded']) ?></span></li>
328
               <li><strong>Ratio:</strong> <span id="new_ratio"><?= Format::get_ratio_html($LoggedUser['BytesUploaded'],$LoggedUser['BytesDownloaded']) ?></span></li>
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
-<?
1
+<?php
2
 //------------------- Ratio requirements -----------------------//
2
 //------------------- Ratio requirements -----------------------//
3
 
3
 
4
 // Clear old seed time history
4
 // Clear old seed time history
63
   WHERE s.NumSnatches > 0");
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
 $DownloadBarrier = PHP_INT_MAX;
67
 $DownloadBarrier = PHP_INT_MAX;
68
 
68
 
69
 foreach (RATIO_REQUIREMENTS as $Requirement) {
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
     UPDATE users_main
73
     UPDATE users_main
74
     SET RequiredRatio = RequiredRatioWork * $Ratio
74
     SET RequiredRatio = RequiredRatioWork * $Ratio
75
     WHERE Downloaded >= $Download
75
     WHERE Downloaded >= $Download
76
       AND Downloaded < $DownloadBarrier");
76
       AND Downloaded < $DownloadBarrier");
77
 
77
 
78
-  $DB->query("
78
+    $DB->query("
79
     UPDATE users_main
79
     UPDATE users_main
80
     SET RequiredRatio = $MinRatio
80
     SET RequiredRatio = $MinRatio
81
     WHERE Downloaded >= $Download
81
     WHERE Downloaded >= $Download
82
       AND Downloaded < $DownloadBarrier
82
       AND Downloaded < $DownloadBarrier
83
       AND RequiredRatio < $MinRatio");
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
-<?
1
+<?php
2
+
2
 //------------- Front page stats ----------------------------------------//
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
     SELECT COUNT(uid) AS Snatches
9
     SELECT COUNT(uid) AS Snatches
9
     FROM xbt_snatched");
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
 $DB->query("
15
 $DB->query("
44
 list($UserStats['Month']) = $DB->next_record();
45
 list($UserStats['Month']) = $DB->next_record();
45
 
46
 
46
 $Cache->cache_value('stats_users', $UserStats, 0);
47
 $Cache->cache_value('stats_users', $UserStats, 0);
47
-?>

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

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
 //--------------Get Post--------------------------------------------//
5
 //--------------Get Post--------------------------------------------//
5
 
6
 
13
 
14
 
14
 // Quick SQL injection check
15
 // Quick SQL injection check
15
 if (!$_GET['post'] || !is_number($_GET['post'])) {
16
 if (!$_GET['post'] || !is_number($_GET['post'])) {
16
-  error(0);
17
+    error(0);
17
 }
18
 }
18
 
19
 
19
 // Variables for database input
20
 // Variables for database input
20
 $PostID = $_GET['post'];
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
 $DB->query("
24
 $DB->query("
25
   SELECT m.Message, c.Level, c.UserID
25
   SELECT m.Message, c.Level, c.UserID
26
   FROM staff_pm_messages AS m
26
   FROM staff_pm_messages AS m
28
   WHERE m.ID = '$PostID'");
28
   WHERE m.ID = '$PostID'");
29
 list($Message, $Level, $UserID) = $DB->next_record(MYSQLI_NUM);
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
 } else {
34
 } else {
35
-  error(403);
35
+    error(403);
36
 }
36
 }
37
-
38
-?>

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

351
     break;
351
     break;
352
 
352
 
353
   case 'ip_ban':
353
   case 'ip_ban':
354
-    //TODO: Clean up DB table ip_bans.
354
+    // todo: Clean up DB table ip_bans
355
     include(SERVER_ROOT.'/sections/tools/managers/bans.php');
355
     include(SERVER_ROOT.'/sections/tools/managers/bans.php');
356
     break;
356
     break;
357
   case 'quick_ban':
357
   case 'quick_ban':

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

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

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

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

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

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
 if (!check_perms('admin_create_users')) {
3
 if (!check_perms('admin_create_users')) {
4
   error(403);
4
   error(403);
5
 }
5
 }

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

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

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

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

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

433
   WHERE ID = $GroupID");
433
   WHERE ID = $GroupID");
434
 list($Name) = $DB->next_record(MYSQLI_NUM, false);
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
 Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $LogDetails, 0);
437
 Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $LogDetails, 0);
438
 $Cache->delete_value("torrents_details_$GroupID");
438
 $Cache->delete_value("torrents_details_$GroupID");
439
 $Cache->delete_value("torrent_download_$TorrentID");
439
 $Cache->delete_value("torrent_download_$TorrentID");

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

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

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

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

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

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

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

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
 if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
4
 if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
5
   if (!is_number($_GET['userid'])) {
5
   if (!is_number($_GET['userid'])) {
6
     error(404);
6
     error(404);

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

236
   unset($Options['SearchType']);
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
 unset($Options['ArtistNoRedirect']);
240
 unset($Options['ArtistNoRedirect']);
241
 unset($Options['ShowQueryList']);
241
 unset($Options['ShowQueryList']);
242
 unset($Options['ShowCacheList']);
242
 unset($Options['ShowCacheList']);

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

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

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

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

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

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

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

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

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

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
   Example Usage:
4
   Example Usage:
5
   <script type="text/javascript">
5
   <script type="text/javascript">
12
     }
12
     }
13
   </script>
13
   </script>
14
 */
14
 */
15
+
15
 "use strict";
16
 "use strict";
16
 var count = {
17
 var count = {
17
   update: function (Offset) {
18
   update: function (Offset) {

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

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

+ 0
- 83
templates/filemap.csv View File

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