Browse Source

Code style: replace "array()" with "[]"

This was an automatic mass-replace. Manual replacement of array(...)
will continue
spaghetti 8 years ago
parent
commit
e650a1ab73
100 changed files with 359 additions and 358 deletions
  1. 2
    2
      classes/NMA_API.php
  2. 4
    4
      classes/artists.class.php
  3. 4
    4
      classes/artists_similar.class.php
  4. 2
    2
      classes/autoenable.class.php
  5. 2
    2
      classes/badges.class.php
  6. 5
    5
      classes/bencodedecode.class.php
  7. 2
    2
      classes/bencodetorrent.class.php
  8. 7
    7
      classes/cache.class.php
  9. 2
    2
      classes/calendarview.class.php
  10. 11
    11
      classes/charts.class.php
  11. 6
    6
      classes/debug.class.php
  12. 5
    5
      classes/donations.class.php
  13. 3
    3
      classes/donationsbitcoin.class.php
  14. 2
    2
      classes/feed.class.php
  15. 1
    1
      classes/format.class.php
  16. 7
    7
      classes/forums.class.php
  17. 4
    4
      classes/imagetools.class.php
  18. 3
    3
      classes/invite_tree.class.php
  19. 4
    4
      classes/irc.class.php
  20. 2
    2
      classes/mass_user_bookmarks_editor.class.php
  21. 1
    1
      classes/mass_user_torrents_table_view.class.php
  22. 11
    11
      classes/mediainfo.class.php
  23. 8
    8
      classes/misc.class.php
  24. 7
    7
      classes/mysql.class.php
  25. 11
    11
      classes/notificationsmanager.class.php
  26. 1
    1
      classes/paranoia.class.php
  27. 2
    2
      classes/permissions.class.php
  28. 8
    8
      classes/requests.class.php
  29. 1
    1
      classes/sitehistory.class.php
  30. 2
    2
      classes/sphinxql.class.php
  31. 8
    8
      classes/sphinxqlquery.class.php
  32. 5
    5
      classes/sphinxqlresult.class.php
  33. 2
    2
      classes/subscriptions.class.php
  34. 3
    3
      classes/tags.class.php
  35. 1
    1
      classes/templates.class.php
  36. 4
    4
      classes/testing.class.php
  37. 4
    4
      classes/text.class.php
  38. 3
    3
      classes/textarea_preview.class.php
  39. 1
    1
      classes/tools.class.php
  40. 4
    4
      classes/torrent.class.php
  41. 3
    3
      classes/torrent_32bit.class.php
  42. 14
    14
      classes/torrent_form.class.php
  43. 20
    20
      classes/torrents.class.php
  44. 5
    5
      classes/torrentsdl.class.php
  45. 2
    2
      classes/tracker.class.php
  46. 1
    1
      classes/twofa.class.php
  47. 1
    1
      classes/util.php
  48. 2
    2
      classes/validate.class.php
  49. 2
    2
      classes/view.class.php
  50. 2
    2
      classes/votes.class.php
  51. 3
    3
      design/privateheader.php
  52. 1
    1
      feeds.php
  53. 2
    2
      sections/ajax/announcements.php
  54. 11
    11
      sections/ajax/artist.php
  55. 2
    2
      sections/ajax/better/single.php
  56. 6
    6
      sections/ajax/better/transcode.php
  57. 1
    1
      sections/ajax/bookmarks/artists.php
  58. 2
    2
      sections/ajax/bookmarks/torrents.php
  59. 4
    4
      sections/ajax/browse.php
  60. 10
    10
      sections/ajax/collage.php
  61. 3
    3
      sections/ajax/doujin.php
  62. 3
    3
      sections/ajax/forum/forum.php
  63. 6
    6
      sections/ajax/forum/main.php
  64. 5
    5
      sections/ajax/forum/thread.php
  65. 1
    1
      sections/ajax/get_user_notifications.php
  66. 1
    1
      sections/ajax/inbox/inbox.php
  67. 1
    1
      sections/ajax/inbox/viewconv.php
  68. 1
    1
      sections/ajax/index.php
  69. 4
    3
      sections/ajax/javfill.php
  70. 1
    1
      sections/ajax/news_ajax.php
  71. 3
    3
      sections/ajax/notifications.php
  72. 3
    3
      sections/ajax/request.php
  73. 8
    8
      sections/ajax/requests.php
  74. 1
    1
      sections/ajax/subscriptions.php
  75. 1
    1
      sections/ajax/tcomments.php
  76. 2
    2
      sections/ajax/top10/tags.php
  77. 3
    3
      sections/ajax/top10/torrents.php
  78. 2
    2
      sections/ajax/top10/users.php
  79. 1
    1
      sections/ajax/torrentgroup.php
  80. 1
    1
      sections/ajax/user.php
  81. 1
    1
      sections/ajax/user_recents.php
  82. 1
    1
      sections/ajax/userhistory/post_history.php
  83. 5
    5
      sections/artist/artist.php
  84. 2
    2
      sections/artist/autocomplete.php
  85. 4
    4
      sections/better/snatch.php
  86. 4
    4
      sections/better/transcode.php
  87. 5
    5
      sections/better/transcode_beta.php
  88. 4
    4
      sections/better/upload.php
  89. 3
    3
      sections/bookmarks/torrents.php
  90. 2
    2
      sections/collages/add_artist.php
  91. 2
    2
      sections/collages/add_torrent.php
  92. 3
    3
      sections/collages/artist_collage.php
  93. 1
    1
      sections/collages/manage.php
  94. 1
    1
      sections/collages/manage_artists_handle.php
  95. 1
    1
      sections/collages/manage_handle.php
  96. 1
    1
      sections/collages/new_handle.php
  97. 5
    5
      sections/collages/torrent_collage.php
  98. 3
    3
      sections/comments/comments.php
  99. 1
    1
      sections/forums/forum.php
  100. 0
    0
      sections/forums/poll_mod.php

+ 2
- 2
classes/NMA_API.php View File

53
     /**
53
     /**
54
      * @param array $options
54
      * @param array $options
55
      */
55
      */
56
-    function __construct($options = array())
56
+    function __construct($options = [])
57
     {
57
     {
58
         if (!isset($options['apikey'])) {
58
         if (!isset($options['apikey'])) {
59
             return $this->error('You must supply a API Key');
59
             return $this->error('You must supply a API Key');
82
     public function verify($key = false)
82
     public function verify($key = false)
83
     {
83
     {
84
 
84
 
85
-        $options = array();
85
+        $options = [];
86
 
86
 
87
         if ($key !== false) {
87
         if ($key !== false) {
88
             $options['apikey'] = $key;
88
             $options['apikey'] = $key;

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

18
    * 6 => DJ
18
    * 6 => DJ
19
    */
19
    */
20
   public static function get_artists($GroupIDs) {
20
   public static function get_artists($GroupIDs) {
21
-    $Results = array();
22
-    $DBs = array();
21
+    $Results = [];
22
+    $DBs = [];
23
     foreach ($GroupIDs as $GroupID) {
23
     foreach ($GroupIDs as $GroupID) {
24
       if (!is_number($GroupID)) {
24
       if (!is_number($GroupID)) {
25
         continue;
25
         continue;
56
           G::$Cache->cache_value('groups_artists_'.$GroupID, $New[$GroupID]);
56
           G::$Cache->cache_value('groups_artists_'.$GroupID, $New[$GroupID]);
57
         }
57
         }
58
         else {
58
         else {
59
-          G::$Cache->cache_value('groups_artists_'.$GroupID, array());
59
+          G::$Cache->cache_value('groups_artists_'.$GroupID, []);
60
         }
60
         }
61
       }
61
       }
62
       $Missing = array_diff($GroupIDs, array_keys($Results));
62
       $Missing = array_diff($GroupIDs, array_keys($Results));
63
       if (!empty($Missing)) {
63
       if (!empty($Missing)) {
64
-        $Results += array_fill_keys($Missing, array());
64
+        $Results += array_fill_keys($Missing, []);
65
       }
65
       }
66
     }
66
     }
67
     return $Results;
67
     return $Results;

+ 4
- 4
classes/artists_similar.class.php View File

7
   var $Displayed = false;
7
   var $Displayed = false;
8
   var $x = 0;
8
   var $x = 0;
9
   var $y = 0;
9
   var $y = 0;
10
-  var $Similar = array();
10
+  var $Similar = [];
11
 
11
 
12
   function ARTIST($ID = '', $Name = '') {
12
   function ARTIST($ID = '', $Name = '') {
13
     $this->ID = $ID;
13
     $this->ID = $ID;
17
 }
17
 }
18
 
18
 
19
 class ARTISTS_SIMILAR extends ARTIST{
19
 class ARTISTS_SIMILAR extends ARTIST{
20
-  var $Artists = array();
20
+  var $Artists = [];
21
   var $TotalScore = 0;
21
   var $TotalScore = 0;
22
 
22
 
23
   var $xValues = array(WIDTH=>1);
23
   var $xValues = array(WIDTH=>1);
49
 
49
 
50
 
50
 
51
     // Get artists that are directly similar to the artist
51
     // Get artists that are directly similar to the artist
52
-    $ArtistIDs = array();
52
+    $ArtistIDs = [];
53
     G::$DB->query("
53
     G::$DB->query("
54
       SELECT
54
       SELECT
55
         s2.ArtistID,
55
         s2.ArtistID,
113
   }
113
   }
114
 
114
 
115
   function set_positions() {
115
   function set_positions() {
116
-    $xValues = array(); // Possible x values
116
+    $xValues = []; // Possible x values
117
     $Root = ceil(WIDTH / 4); // Half-way into half of the image
117
     $Root = ceil(WIDTH / 4); // Half-way into half of the image
118
     $Offset = 4; // Distance from the root (a quarter of the way into the image) to the x value
118
     $Offset = 4; // Distance from the root (a quarter of the way into the image) to the x value
119
 
119
 

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

97
             error(404);
97
             error(404);
98
         }
98
         }
99
 
99
 
100
-        $UserInfo = array();
100
+        $UserInfo = [];
101
         $IDs = (!is_array($IDs)) ? [$IDs] : $IDs;
101
         $IDs = (!is_array($IDs)) ? [$IDs] : $IDs;
102
 
102
 
103
         if (count($IDs) == 0) {
103
         if (count($IDs) == 0) {
290
      * @return array The WHERE conditions for the query
290
      * @return array The WHERE conditions for the query
291
      */
291
      */
292
     public static function build_search_query($Username, $IP, $SubmittedBetween, $SubmittedTimestamp1, $SubmittedTimestamp2, $HandledUsername, $HandledBetween, $HandledTimestamp1, $HandledTimestamp2, $OutcomeSearch, $Checked) {
292
     public static function build_search_query($Username, $IP, $SubmittedBetween, $SubmittedTimestamp1, $SubmittedTimestamp2, $HandledUsername, $HandledBetween, $HandledTimestamp1, $HandledTimestamp2, $OutcomeSearch, $Checked) {
293
-        $Where = array();
293
+        $Where = [];
294
 
294
 
295
         if (!empty($Username)) {
295
         if (!empty($Username)) {
296
             $Where[] = "um1.Username = '$Username'";
296
             $Where[] = "um1.Username = '$Username'";

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

7
    * @return array of BadgeIDs
7
    * @return array of BadgeIDs
8
    */
8
    */
9
   public static function get_badges($UserID) {
9
   public static function get_badges($UserID) {
10
-    $Result = array();
10
+    $Result = [];
11
 
11
 
12
     if (G::$Cache->get_value('user_badges_'.$UserID)) {
12
     if (G::$Cache->get_value('user_badges_'.$UserID)) {
13
       return G::$Cache->get_value('user_badges_'.$UserID);
13
       return G::$Cache->get_value('user_badges_'.$UserID);
64
    * @return array of BadgeIDs
64
    * @return array of BadgeIDs
65
    */
65
    */
66
   public static function get_displayed_badges($UserID) {
66
   public static function get_displayed_badges($UserID) {
67
-    $Result = array();
67
+    $Result = [];
68
 
68
 
69
     $Badges = self::get_badges($UserID);
69
     $Badges = self::get_badges($UserID);
70
 
70
 

+ 5
- 5
classes/bencodedecode.class.php View File

7
   private $Data;
7
   private $Data;
8
   private $Length;
8
   private $Length;
9
   private $Pos = 0;
9
   private $Pos = 0;
10
-  public $Dec = array();
10
+  public $Dec = [];
11
   public $ExitOnError = true;
11
   public $ExitOnError = true;
12
   const SnipLength = 40;
12
   const SnipLength = 40;
13
 
13
 
91
         return Int64::make($Value);
91
         return Int64::make($Value);
92
 
92
 
93
       case 'l':
93
       case 'l':
94
-        $Value = array();
94
+        $Value = [];
95
         $this->Pos++;
95
         $this->Pos++;
96
         while ($this->Data[$this->Pos] != 'e') {
96
         while ($this->Data[$this->Pos] != 'e') {
97
           if ($this->Pos >= $this->Length) {
97
           if ($this->Pos >= $this->Length) {
103
         return $Value;
103
         return $Value;
104
 
104
 
105
       case 'd':
105
       case 'd':
106
-        $Value = array();
106
+        $Value = [];
107
         $this->Pos++;
107
         $this->Pos++;
108
         while ($this->Data[$this->Pos] != 'e') {
108
         while ($this->Data[$this->Pos] != 'e') {
109
           $Length = substr($this->Data, $this->Pos, strpos($this->Data, ':', $this->Pos) - $this->Pos);
109
           $Length = substr($this->Data, $this->Pos, strpos($this->Data, ':', $this->Pos) - $this->Pos);
146
       return Int64::get($Data);
146
       return Int64::get($Data);
147
     }
147
     }
148
     if (is_bool($Data)) {
148
     if (is_bool($Data)) {
149
-      return array();
149
+      return [];
150
     }
150
     }
151
     if (is_array($Data)) {
151
     if (is_array($Data)) {
152
-      $Output = array();
152
+      $Output = [];
153
       foreach ($Data as $Key => $Val) {
153
       foreach ($Data as $Key => $Val) {
154
         $Output[$Key] = $this->dump($Escape, $Val);
154
         $Output[$Key] = $this->dump($Escape, $Val);
155
       }
155
       }

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

4
  */
4
  */
5
 class BencodeTorrent extends BencodeDecode {
5
 class BencodeTorrent extends BencodeDecode {
6
   private $PathKey = 'path';
6
   private $PathKey = 'path';
7
-  public $Files = array();
7
+  public $Files = [];
8
   public $Size = 0;
8
   public $Size = 0;
9
 
9
 
10
   /**
10
   /**
31
         $this->PathKey = 'path.utf-8';
31
         $this->PathKey = 'path.utf-8';
32
       }
32
       }
33
       foreach ($InfoDict['files'] as $File) {
33
       foreach ($InfoDict['files'] as $File) {
34
-        $TmpPath = array();
34
+        $TmpPath = [];
35
         foreach ($File[$this->PathKey] as $SubPath) {
35
         foreach ($File[$this->PathKey] as $SubPath) {
36
           $TmpPath[] = $SubPath;
36
           $TmpPath[] = $SubPath;
37
         }
37
         }

+ 7
- 7
classes/cache.class.php View File

34
    */
34
    */
35
   const GROUP_VERSION = 5;
35
   const GROUP_VERSION = 5;
36
 
36
 
37
-  public $CacheHits = array();
38
-  public $MemcacheDBArray = array();
37
+  public $CacheHits = [];
38
+  public $MemcacheDBArray = [];
39
   public $MemcacheDBKey = '';
39
   public $MemcacheDBKey = '';
40
   protected $InTransaction = false;
40
   protected $InTransaction = false;
41
   public $Time = 0;
41
   public $Time = 0;
42
-  private $Servers = array();
42
+  private $Servers = [];
43
   private $PersistentKeys = array(
43
   private $PersistentKeys = array(
44
     'ajax_requests_*',
44
     'ajax_requests_*',
45
     'query_lock_*',
45
     'query_lock_*',
52
     'global_notification',
52
     'global_notification',
53
     'notifications_one_reads_*',
53
     'notifications_one_reads_*',
54
   );
54
   );
55
-  private $ClearedKeys = array();
55
+  private $ClearedKeys = [];
56
 
56
 
57
   public $CanClear = false;
57
   public $CanClear = false;
58
   public $InternalCache = true;
58
   public $InternalCache = true;
197
     $Value = $this->get($Key);
197
     $Value = $this->get($Key);
198
     if (!is_array($Value)) {
198
     if (!is_array($Value)) {
199
       $this->InTransaction = false;
199
       $this->InTransaction = false;
200
-      $this->MemcacheDBKey = array();
200
+      $this->MemcacheDBKey = [];
201
       $this->MemcacheDBKey = '';
201
       $this->MemcacheDBKey = '';
202
       return false;
202
       return false;
203
     }
203
     }
209
 
209
 
210
   public function cancel_transaction() {
210
   public function cancel_transaction() {
211
     $this->InTransaction = false;
211
     $this->InTransaction = false;
212
-    $this->MemcacheDBKey = array();
212
+    $this->MemcacheDBKey = [];
213
     $this->MemcacheDBKey = '';
213
     $this->MemcacheDBKey = '';
214
   }
214
   }
215
 
215
 
385
    * @return array (host => bool status, ...)
385
    * @return array (host => bool status, ...)
386
    */
386
    */
387
   public function server_status() {
387
   public function server_status() {
388
-    $Status = array();
388
+    $Status = [];
389
     foreach ($this->Servers as $Server) {
389
     foreach ($this->Servers as $Server) {
390
       $Status["$Server[host]:$Server[port]"] = $this->getServerStatus($Server['host'], $Server['port']);
390
       $Status["$Server[host]:$Server[port]"] = $this->getServerStatus($Server['host'], $Server['port']);
391
     }
391
     }

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

32
 
32
 
33
   private static function get_events_on($Day, $Events) {
33
   private static function get_events_on($Day, $Events) {
34
     // Linear search, Lol.
34
     // Linear search, Lol.
35
-    $Results = array();
35
+    $Results = [];
36
     foreach ($Events as $Event) {
36
     foreach ($Events as $Event) {
37
       if ($Event['StartDay'] == $Day || ($Event['StartDay'] <= $Day && $Event['EndDay'] >= $Day)) {
37
       if ($Event['StartDay'] == $Day || ($Event['StartDay'] <= $Day && $Event['EndDay'] >= $Day)) {
38
         $Results[] = $Event;
38
         $Results[] = $Event;
59
     $DaysInMonth = date('t', mktime(0 ,0 ,0, $Month, 1, $Year));
59
     $DaysInMonth = date('t', mktime(0 ,0 ,0, $Month, 1, $Year));
60
     $DaysThisWeek = 1;
60
     $DaysThisWeek = 1;
61
     $DayCounter = 0;
61
     $DayCounter = 0;
62
-    $DatesArray = array();
62
+    $DatesArray = [];
63
 ?>
63
 ?>
64
 
64
 
65
     <table class="calendar">
65
     <table class="calendar">

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

1
 <?
1
 <?
2
 class GOOGLE_CHARTS {
2
 class GOOGLE_CHARTS {
3
   protected $URL = 'https://chart.googleapis.com/chart';
3
   protected $URL = 'https://chart.googleapis.com/chart';
4
-  protected $Labels = array();
5
-  protected $Data = array();
6
-  protected $Options = array();
4
+  protected $Labels = [];
5
+  protected $Data = [];
6
+  protected $Options = [];
7
 
7
 
8
   public function __construct($Type, $Width, $Height, $Options) {
8
   public function __construct($Type, $Width, $Height, $Options) {
9
     if ($Width * $Height > 300000 || $Height > 1000 || $Width > 1000) {
9
     if ($Width * $Height > 300000 || $Height > 1000 || $Width > 1000) {
72
 }
72
 }
73
 
73
 
74
 class AREA_GRAPH extends GOOGLE_CHARTS {
74
 class AREA_GRAPH extends GOOGLE_CHARTS {
75
-  public function __construct ($Width, $Height, $Options = array()) {
75
+  public function __construct ($Width, $Height, $Options = []) {
76
     parent::__construct('lc', $Width, $Height, $Options);
76
     parent::__construct('lc', $Width, $Height, $Options);
77
   }
77
   }
78
 
78
 
83
   public function generate() {
83
   public function generate() {
84
     $Max = max($this->Data);
84
     $Max = max($this->Data);
85
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
85
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
86
-    $Data = array();
86
+    $Data = [];
87
     foreach ($this->Data as $Value) {
87
     foreach ($this->Data as $Value) {
88
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
88
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
89
     }
89
     }
92
 }
92
 }
93
 
93
 
94
 class PIE_CHART extends GOOGLE_CHARTS {
94
 class PIE_CHART extends GOOGLE_CHARTS {
95
-  public function __construct ($Width, $Height, $Options = array()) {
95
+  public function __construct ($Width, $Height, $Options = []) {
96
     $Type = ((isset($this->Options['3D'])) ? 'p3' : 'p');
96
     $Type = ((isset($this->Options['3D'])) ? 'p3' : 'p');
97
     parent::__construct($Type, $Width, $Height, $Options);
97
     parent::__construct($Type, $Width, $Height, $Options);
98
   }
98
   }
110
       $this->Data = array_reverse($this->Data);
110
       $this->Data = array_reverse($this->Data);
111
     }
111
     }
112
 
112
 
113
-    $Data = array();
113
+    $Data = [];
114
     $Labels = $this->Labels;
114
     $Labels = $this->Labels;
115
     $OtherPercentage = 0.00;
115
     $OtherPercentage = 0.00;
116
     $OtherData = 0;
116
     $OtherData = 0;
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 = array()) {
148
+  public function __construct ($Base, $Width, $Height, $Options = []) {
149
     parent::__construct('lc', $Width, $Height, $Options);
149
     parent::__construct('lc', $Width, $Height, $Options);
150
   }
150
   }
151
 
151
 
156
   public function generate() {
156
   public function generate() {
157
     $Max = max($this->Data);
157
     $Max = max($this->Data);
158
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
158
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
159
-    $Data = array();
159
+    $Data = [];
160
     foreach ($this->Data as $Value) {
160
     foreach ($this->Data as $Value) {
161
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
161
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
162
     }
162
     }
182
     $Max = max($this->Data);
182
     $Max = max($this->Data);
183
     $Sum = array_sum($this->Data);
183
     $Sum = array_sum($this->Data);
184
     $Increment = ($Max / $Sum) * 25; // * 100% / 4divisions
184
     $Increment = ($Max / $Sum) * 25; // * 100% / 4divisions
185
-    $Data = array();
186
-    $Labels = array();
185
+    $Data = [];
186
+    $Labels = [];
187
     foreach ($this->Data as $Key => $Value) {
187
     foreach ($this->Data as $Key => $Value) {
188
       $Data[] = $this->encode(($Value / $Max) * 4095);
188
       $Data[] = $this->encode(($Value / $Max) * 4095);
189
       $Labels[] = '@t'.str_replace(array(' ', ','),array('+', '\,'), $this->Labels[$Key]).',000000,1,'.round((($Key + 1) / $Count) - (12 / $Height), 2).':0,12';
189
       $Labels[] = '@t'.str_replace(array(' ', ','),array('+', '\,'), $this->Labels[$Key]).',000000,1,'.round((($Key + 1) / $Count) - (12 / $Height), 2).':0,12';

+ 6
- 6
classes/debug.class.php View File

7
 define('MAX_QUERIES', 30); //Maxmimum queries
7
 define('MAX_QUERIES', 30); //Maxmimum queries
8
 
8
 
9
 class DEBUG {
9
 class DEBUG {
10
-  public $Errors = array();
11
-  public $Flags = array();
12
-  public $Perf = array();
13
-  private $LoggedVars = array();
10
+  public $Errors = [];
11
+  public $Flags = [];
12
+  public $Perf = [];
13
+  private $LoggedVars = [];
14
 
14
 
15
   public function profile($Automatic = '') {
15
   public function profile($Automatic = '') {
16
     global $ScriptStartTime;
16
     global $ScriptStartTime;
17
-    $Reason = array();
17
+    $Reason = [];
18
 
18
 
19
     if (!empty($Automatic)) {
19
     if (!empty($Automatic)) {
20
       $Reason[] = $Automatic;
20
       $Reason[] = $Automatic;
136
 
136
 
137
   protected function format_args($Array) {
137
   protected function format_args($Array) {
138
     $LastKey = -1;
138
     $LastKey = -1;
139
-    $Return = array();
139
+    $Return = [];
140
     foreach ($Array as $Key => $Val) {
140
     foreach ($Array as $Key => $Val) {
141
       $Return[$Key] = '';
141
       $Return[$Key] = '';
142
       if (!is_int($Key) || $Key != $LastKey + 1) {
142
       if (!is_int($Key) || $Key != $LastKey + 1) {

+ 5
- 5
classes/donations.class.php View File

229
         // 2 hours less than 32 days to account for schedule run times
229
         // 2 hours less than 32 days to account for schedule run times
230
 
230
 
231
     if (G::$DB->record_count() > 0) {
231
     if (G::$DB->record_count() > 0) {
232
-      $UserIDs = array();
232
+      $UserIDs = [];
233
       while (list($UserID, $Rank) = G::$DB->next_record()) {
233
       while (list($UserID, $Rank) = G::$DB->next_record()) {
234
         G::$Cache->delete_value("donor_info_$UserID");
234
         G::$Cache->delete_value("donor_info_$UserID");
235
         G::$Cache->delete_value("donor_title_$UserID");
235
         G::$Cache->delete_value("donor_title_$UserID");
403
 
403
 
404
 
404
 
405
   public static function get_enabled_rewards($UserID) {
405
   public static function get_enabled_rewards($UserID) {
406
-    $Rewards = array();
406
+    $Rewards = [];
407
     $Rank = self::get_rank($UserID);
407
     $Rank = self::get_rank($UserID);
408
     $SpecialRank = self::get_special_rank($UserID);
408
     $SpecialRank = self::get_special_rank($UserID);
409
     $HasAll = $SpecialRank == 3;
409
     $HasAll = $SpecialRank == 3;
495
     $SpecialRank = self::get_special_rank($UserID);
495
     $SpecialRank = self::get_special_rank($UserID);
496
     $HasAll = $SpecialRank == 3;
496
     $HasAll = $SpecialRank == 3;
497
     $Counter = 0;
497
     $Counter = 0;
498
-    $Insert = array();
499
-    $Values = array();
500
-    $Update = array();
498
+    $Insert = [];
499
+    $Values = [];
500
+    $Update = [];
501
 
501
 
502
     $Insert[] = "UserID";
502
     $Insert[] = "UserID";
503
     $Values[] = "'$UserID'";
503
     $Values[] = "'$UserID'";

+ 3
- 3
classes/donationsbitcoin.class.php View File

10
       $Donations = BitcoinRpc::listreceivedbyaddress();
10
       $Donations = BitcoinRpc::listreceivedbyaddress();
11
     }
11
     }
12
     if (empty($Donations)) {
12
     if (empty($Donations)) {
13
-      return array();
13
+      return [];
14
     }
14
     }
15
-    $BTCUsers = array();
15
+    $BTCUsers = [];
16
     foreach ($Donations as $Account) {
16
     foreach ($Donations as $Account) {
17
       $BTCUsers[$Account->address] = $Account->amount;
17
       $BTCUsers[$Account->address] = $Account->amount;
18
     }
18
     }
108
     if (G::$DB->has_results()) {
108
     if (G::$DB->has_results()) {
109
       $UserIDs = G::$DB->to_pair(0, 1);
109
       $UserIDs = G::$DB->to_pair(0, 1);
110
     } else {
110
     } else {
111
-      $UserIDs = array();
111
+      $UserIDs = [];
112
     }
112
     }
113
     G::$DB->set_query_id($QueryID);
113
     G::$DB->set_query_id($QueryID);
114
     return $UserIDs;
114
     return $UserIDs;

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

47
     global $Cache;
47
     global $Cache;
48
     $Entries = $Cache->get_value($CacheKey);
48
     $Entries = $Cache->get_value($CacheKey);
49
     if (!$Entries) {
49
     if (!$Entries) {
50
-      $Entries = array();
50
+      $Entries = [];
51
     } else {
51
     } else {
52
       foreach ($Entries as $Item) {
52
       foreach ($Entries as $Item) {
53
         echo str_replace(array('[[PASSKEY]]', '[[AUTHKEY]]'), array(display_str($PassKey), display_str($AuthKey)), $Item);
53
         echo str_replace(array('[[PASSKEY]]', '[[AUTHKEY]]'), array(display_str($PassKey), display_str($AuthKey)), $Item);
59
     global $Cache;
59
     global $Cache;
60
     $Entries = $Cache->get_value($CacheKey, true);
60
     $Entries = $Cache->get_value($CacheKey, true);
61
     if (!$Entries) {
61
     if (!$Entries) {
62
-      $Entries = array();
62
+      $Entries = [];
63
     } else {
63
     } else {
64
       if (count($Entries) >= 50) {
64
       if (count($Entries) >= 50) {
65
         array_pop($Entries);
65
         array_pop($Entries);

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

408
    * @param array $Array The array the option is in, defaults to GET.
408
    * @param array $Array The array the option is in, defaults to GET.
409
    * @return void
409
    * @return void
410
    */
410
    */
411
-  public static function selected($Name, $Value, $Attribute = 'selected', $Array = array()) {
411
+  public static function selected($Name, $Value, $Attribute = 'selected', $Array = []) {
412
     if (empty($Array)) {
412
     if (empty($Array)) {
413
       $Array = $_GET;
413
       $Array = $_GET;
414
     }
414
     }

+ 7
- 7
classes/forums.class.php View File

134
       G::$DB->query("
134
       G::$DB->query("
135
         SELECT ID, Name
135
         SELECT ID, Name
136
         FROM forums_categories");
136
         FROM forums_categories");
137
-      $ForumCats = array();
137
+      $ForumCats = [];
138
       while (list ($ID, $Name) = G::$DB->next_record()) {
138
       while (list ($ID, $Name) = G::$DB->next_record()) {
139
         $ForumCats[$ID] = $Name;
139
         $ForumCats[$ID] = $Name;
140
       }
140
       }
180
       G::$DB->query("
180
       G::$DB->query("
181
         SELECT ForumID, ThreadID
181
         SELECT ForumID, ThreadID
182
         FROM forums_specific_rules");
182
         FROM forums_specific_rules");
183
-      $SpecificRules = array();
183
+      $SpecificRules = [];
184
       while (list($ForumID, $ThreadID) = G::$DB->next_record(MYSQLI_NUM, false)) {
184
       while (list($ForumID, $ThreadID) = G::$DB->next_record(MYSQLI_NUM, false)) {
185
         $SpecificRules[$ForumID][] = $ThreadID;
185
         $SpecificRules[$ForumID][] = $ThreadID;
186
       }
186
       }
189
         if (isset($SpecificRules[$ForumID])) {
189
         if (isset($SpecificRules[$ForumID])) {
190
           $Forum['SpecificRules'] = $SpecificRules[$ForumID];
190
           $Forum['SpecificRules'] = $SpecificRules[$ForumID];
191
         } else {
191
         } else {
192
-          $Forum['SpecificRules'] = array();
192
+          $Forum['SpecificRules'] = [];
193
         }
193
         }
194
       }
194
       }
195
       G::$Cache->cache_value('forums_list', $Forums, 0);
195
       G::$Cache->cache_value('forums_list', $Forums, 0);
205
     if (isset(G::$LoggedUser['CustomForums'])) {
205
     if (isset(G::$LoggedUser['CustomForums'])) {
206
       return (array)array_keys(G::$LoggedUser['CustomForums'], 1);
206
       return (array)array_keys(G::$LoggedUser['CustomForums'], 1);
207
     } else {
207
     } else {
208
-      return array();
208
+      return [];
209
     }
209
     }
210
   }
210
   }
211
 
211
 
217
     if (isset(G::$LoggedUser['CustomForums'])) {
217
     if (isset(G::$LoggedUser['CustomForums'])) {
218
       return (array)array_keys(G::$LoggedUser['CustomForums'], 0);
218
       return (array)array_keys(G::$LoggedUser['CustomForums'], 0);
219
     } else {
219
     } else {
220
-      return array();
220
+      return [];
221
     }
221
     }
222
   }
222
   }
223
 
223
 
232
     } else {
232
     } else {
233
       $PerPage = POSTS_PER_PAGE;
233
       $PerPage = POSTS_PER_PAGE;
234
     }
234
     }
235
-    $TopicIDs = array();
235
+    $TopicIDs = [];
236
     foreach ($Forums as $Forum) {
236
     foreach ($Forums as $Forum) {
237
       if (!empty($Forum['LastPostTopicID'])) {
237
       if (!empty($Forum['LastPostTopicID'])) {
238
         $TopicIDs[] = $Forum['LastPostTopicID'];
238
         $TopicIDs[] = $Forum['LastPostTopicID'];
259
       $LastRead = G::$DB->to_array('TopicID', MYSQLI_ASSOC);
259
       $LastRead = G::$DB->to_array('TopicID', MYSQLI_ASSOC);
260
       G::$DB->set_query_id($QueryID);
260
       G::$DB->set_query_id($QueryID);
261
     } else {
261
     } else {
262
-      $LastRead = array();
262
+      $LastRead = [];
263
     }
263
     }
264
     return $LastRead;
264
     return $LastRead;
265
   }
265
   }

+ 4
- 4
classes/imagetools.class.php View File

9
    * Store processed links to avoid repetition
9
    * Store processed links to avoid repetition
10
    * @var array 'URL' => 'Parsed URL'
10
    * @var array 'URL' => 'Parsed URL'
11
    */
11
    */
12
-  private static $Storage = array();
12
+  private static $Storage = [];
13
 
13
 
14
   /**
14
   /**
15
    * We use true as an extra property to make the domain an array key
15
    * We use true as an extra property to make the domain an array key
52
    * Array of user IDs whose avatars have been checked for size
52
    * Array of user IDs whose avatars have been checked for size
53
    * @var array $CheckedAvatars
53
    * @var array $CheckedAvatars
54
    */
54
    */
55
-  private static $CheckedAvatars = array();
56
-  private static $CheckedAvatars2 = array();
55
+  private static $CheckedAvatars = [];
56
+  private static $CheckedAvatars2 = [];
57
 
57
 
58
   /**
58
   /**
59
    * Array of user IDs whose donor icons have been checked for size
59
    * Array of user IDs whose donor icons have been checked for size
60
    * @var array $CheckedDonorIcons
60
    * @var array $CheckedDonorIcons
61
    */
61
    */
62
-  private static $CheckedDonorIcons = array();
62
+  private static $CheckedDonorIcons = [];
63
 
63
 
64
   /**
64
   /**
65
    * Checks from our list of valid hosts
65
    * Checks from our list of valid hosts

+ 3
- 3
classes/invite_tree.class.php View File

11
   var $Visible = true;
11
   var $Visible = true;
12
 
12
 
13
   // Set things up
13
   // Set things up
14
-  function INVITE_TREE($UserID, $Options = array()) {
14
+  function INVITE_TREE($UserID, $Options = []) {
15
     $this->UserID = $UserID;
15
     $this->UserID = $UserID;
16
     if ($Options['visible'] === false) {
16
     if ($Options['visible'] === false) {
17
       $this->Visible = false;
17
       $this->Visible = false;
83
     $TopLevelUpload = 0;
83
     $TopLevelUpload = 0;
84
     $TopLevelDownload = 0;
84
     $TopLevelDownload = 0;
85
 
85
 
86
-    $ClassSummary = array();
86
+    $ClassSummary = [];
87
     global $Classes;
87
     global $Classes;
88
     foreach ($Classes as $ClassID => $Val) {
88
     foreach ($Classes as $ClassID => $Val) {
89
       $ClassSummary[$ClassID] = 0;
89
       $ClassSummary[$ClassID] = 0;
164
       This tree has <?=number_format($Count)?> entries, <?=number_format($Branches)?> branches, and a depth of <?=number_format($MaxTreeLevel - $OriginalTreeLevel)?>.
164
       This tree has <?=number_format($Count)?> entries, <?=number_format($Branches)?> branches, and a depth of <?=number_format($MaxTreeLevel - $OriginalTreeLevel)?>.
165
       It has
165
       It has
166
 <?
166
 <?
167
-      $ClassStrings = array();
167
+      $ClassStrings = [];
168
       foreach ($ClassSummary as $ClassID => $ClassCount) {
168
       foreach ($ClassSummary as $ClassID => $ClassCount) {
169
         if ($ClassCount == 0) {
169
         if ($ClassCount == 0) {
170
           continue;
170
           continue;

+ 4
- 4
classes/irc.class.php View File

17
   protected $Socket = false;
17
   protected $Socket = false;
18
   protected $Data = false;
18
   protected $Data = false;
19
   protected $Whois = false;
19
   protected $Whois = false;
20
-  protected $Identified = array();
21
-  protected $Channels = array();
22
-  protected $Messages = array();
20
+  protected $Identified = [];
21
+  protected $Channels = [];
22
+  protected $Messages = [];
23
   protected $LastChan = false;
23
   protected $LastChan = false;
24
   protected $ListenSocket = false;
24
   protected $ListenSocket = false;
25
   protected $Listened = false;
25
   protected $Listened = false;
176
         }
176
         }
177
       }
177
       }
178
       G::$DB->LinkID = false;
178
       G::$DB->LinkID = false;
179
-      G::$DB->Queries = array();
179
+      G::$DB->Queries = [];
180
     }
180
     }
181
   }
181
   }
182
 }
182
 }

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

34
    * Uses an IN() to match multiple items in one query.
34
    * Uses an IN() to match multiple items in one query.
35
    */
35
    */
36
   public function mass_remove() {
36
   public function mass_remove() {
37
-    $SQL = array();
37
+    $SQL = [];
38
     foreach ($_POST['remove'] as $GroupID => $K) {
38
     foreach ($_POST['remove'] as $GroupID => $K) {
39
       if (is_number($GroupID)) {
39
       if (is_number($GroupID)) {
40
         $SQL[] = sprintf('%d', $GroupID);
40
         $SQL[] = sprintf('%d', $GroupID);
58
    * Uses $_POST['sort'] values to update the DB.
58
    * Uses $_POST['sort'] values to update the DB.
59
    */
59
    */
60
   public function mass_update() {
60
   public function mass_update() {
61
-    $SQL = array();
61
+    $SQL = [];
62
     foreach ($_POST['sort'] as $GroupID => $Sort) {
62
     foreach ($_POST['sort'] as $GroupID => $Sort) {
63
       if (is_number($Sort) && is_number($GroupID)) {
63
       if (is_number($Sort) && is_number($GroupID)) {
64
         $SQL[] = sprintf('(%d, %d, %d)', $GroupID, $Sort, G::$LoggedUser['ID']);
64
         $SQL[] = sprintf('(%d, %d, %d)', $GroupID, $Sort, G::$LoggedUser['ID']);

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

171
   public function body () {
171
   public function body () {
172
     if ($this->HasTorrents)
172
     if ($this->HasTorrents)
173
       foreach ($this->TorrentList as $GroupID => $Group) {
173
       foreach ($this->TorrentList as $GroupID => $Group) {
174
-        $Artists = array();
174
+        $Artists = [];
175
 
175
 
176
         extract($Group);
176
         extract($Group);
177
         extract($this->CollageDataList[$GroupID]);
177
         extract($this->CollageDataList[$GroupID]);

+ 11
- 11
classes/mediainfo.class.php View File

25
     public function __construct($string='') {
25
     public function __construct($string='') {
26
         $this->index = 0;
26
         $this->index = 0;
27
         $this->output = '';
27
         $this->output = '';
28
-        $this->parsed_lines = array();
28
+        $this->parsed_lines = [];
29
         $this->set_string($string);
29
         $this->set_string($string);
30
         $p = new SectionParser();
30
         $p = new SectionParser();
31
         $this->add_parser($p);
31
         $this->add_parser($p);
125
     }
125
     }
126
 
126
 
127
     public function output_raw() {
127
     public function output_raw() {
128
-        $output = array();
128
+        $output = [];
129
         $sections = ['general', 'video', 'audio', 'text'];
129
         $sections = ['general', 'video', 'audio', 'text'];
130
 
130
 
131
         foreach($sections as $section) {
131
         foreach($sections as $section) {
132
             if (isset($this->parsers[$section])) {
132
             if (isset($this->parsers[$section])) {
133
-                $output[$section] = array();
133
+                $output[$section] = [];
134
                 foreach($this->parsers[$section] as $index => $parser) {
134
                 foreach($this->parsers[$section] as $index => $parser) {
135
                     $output[$section][$index] = $parser->output_raw();
135
                     $output[$section][$index] = $parser->output_raw();
136
                 }
136
                 }
162
 
162
 
163
     protected function new_mediainfo() {
163
     protected function new_mediainfo() {
164
         $this->output .= $this->output(false);
164
         $this->output .= $this->output(false);
165
-        $this->parsed_lines = array();
165
+        $this->parsed_lines = [];
166
         foreach(array_keys($this->parsers) as $key) {
166
         foreach(array_keys($this->parsers) as $key) {
167
             if ($key != static::GENERIC_PARSER)
167
             if ($key != static::GENERIC_PARSER)
168
                 unset($this->parsers[$key]);
168
                 unset($this->parsers[$key]);
176
     protected $index;
176
     protected $index;
177
 
177
 
178
 
178
 
179
-    public function __construct(&$lines=array(),&$i=0) {
179
+    public function __construct(&$lines=[],&$i=0) {
180
         $this->set_lines($lines,$i);
180
         $this->set_lines($lines,$i);
181
     }
181
     }
182
-    public function set_lines(&$lines=array(),&$i=0){
182
+    public function set_lines(&$lines=[],&$i=0){
183
         $this->lines = &$lines;
183
         $this->lines = &$lines;
184
         $this->index = &$i;
184
         $this->index = &$i;
185
     }
185
     }
277
     }
277
     }
278
     public function output_raw() {
278
     public function output_raw() {
279
         $this->process_vars();
279
         $this->process_vars();
280
-        $output = array();
280
+        $output = [];
281
         $properties = [
281
         $properties = [
282
             'audioformat', 'audiobitrate', 'audiochannels',
282
             'audioformat', 'audiobitrate', 'audiochannels',
283
             'audiochannelpositions', 'audiotitle', 'audiolang', 'audioprofile',
283
             'audiochannelpositions', 'audiotitle', 'audiolang', 'audioprofile',
400
     }
400
     }
401
     public function output_raw() {
401
     public function output_raw() {
402
         $this->process_vars();
402
         $this->process_vars();
403
-        $output = array();
403
+        $output = [];
404
         $properties = [
404
         $properties = [
405
             'filename', 'generalformat', 'duration', 'filesize', 'form_codec',
405
             'filename', 'generalformat', 'duration', 'filesize', 'form_codec',
406
             'form_releasegroup'
406
             'form_releasegroup'
420
                 $this->form_codec = '---';
420
                 $this->form_codec = '---';
421
                 break;
421
                 break;
422
         }
422
         }
423
-        $matches = array();
423
+        $matches = [];
424
         preg_match('/(?:^|.*\\|\/)\[(.*?)\].*$/',
424
         preg_match('/(?:^|.*\\|\/)\[(.*?)\].*$/',
425
             $this->filename, $matches);
425
             $this->filename, $matches);
426
         $this->form_releasegroup = $matches ? $matches[1] : '';
426
         $this->form_releasegroup = $matches ? $matches[1] : '';
461
     }
461
     }
462
     public function output_raw() {
462
     public function output_raw() {
463
         $this->process_vars();
463
         $this->process_vars();
464
-        $output = array();
464
+        $output = [];
465
         $properties = [
465
         $properties = [
466
             'title', 'language', 'format', 'default', 'processed_language',
466
             'title', 'language', 'format', 'default', 'processed_language',
467
             'form_format'
467
             'form_format'
566
     }
566
     }
567
     public function output_raw() {
567
     public function output_raw() {
568
         $this->process_vars();
568
         $this->process_vars();
569
-        $output = array();
569
+        $output = [];
570
         $properties = [
570
         $properties = [
571
             'videoformat', 'videoformatversion', 'codec', 'width', 'height',
571
             'videoformat', 'videoformatversion', 'codec', 'width', 'height',
572
             'writinglibrary', 'frameratemode', 'framerate', 'aspectratio',
572
             'writinglibrary', 'frameratemode', 'framerate', 'aspectratio',

+ 8
- 8
classes/misc.class.php View File

173
     }
173
     }
174
     list($AuthorName) = G::$DB->next_record();
174
     list($AuthorName) = G::$DB->next_record();
175
 
175
 
176
-    $ThreadInfo = array();
176
+    $ThreadInfo = [];
177
     $ThreadInfo['IsLocked'] = 0;
177
     $ThreadInfo['IsLocked'] = 0;
178
     $ThreadInfo['IsSticky'] = 0;
178
     $ThreadInfo['IsSticky'] = 0;
179
 
179
 
242
         $Part1 = array_slice($Forum, 0, $Stickies, true); //Stickies
242
         $Part1 = array_slice($Forum, 0, $Stickies, true); //Stickies
243
         $Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); //Rest of page
243
         $Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); //Rest of page
244
       } else {
244
       } else {
245
-        $Part1 = array();
245
+        $Part1 = [];
246
         $Part3 = $Forum;
246
         $Part3 = $Forum;
247
       }
247
       }
248
       if (is_null($Part1)) {
248
       if (is_null($Part1)) {
249
-        $Part1 = array();
249
+        $Part1 = [];
250
       }
250
       }
251
       if (is_null($Part3)) {
251
       if (is_null($Part3)) {
252
-        $Part3 = array();
252
+        $Part3 = [];
253
       }
253
       }
254
       $Forum = $Part1 + $Part2 + $Part3;
254
       $Forum = $Part1 + $Part2 + $Part3;
255
       G::$Cache->cache_value("forums_$ForumID", array($Forum, '', 0, $Stickies), 0);
255
       G::$Cache->cache_value("forums_$ForumID", array($Forum, '', 0, $Stickies), 0);
327
    * @return boolean true if (substring of) $Needle exists in $Haystack
327
    * @return boolean true if (substring of) $Needle exists in $Haystack
328
    */
328
    */
329
   public static function in_array_partial($Needle, $Haystack) {
329
   public static function in_array_partial($Needle, $Haystack) {
330
-    static $Searches = array();
330
+    static $Searches = [];
331
     if (array_key_exists($Needle, $Searches)) {
331
     if (array_key_exists($Needle, $Searches)) {
332
       return $Searches[$Needle];
332
       return $Searches[$Needle];
333
     }
333
     }
381
    * @return array IDs
381
    * @return array IDs
382
    */
382
    */
383
   public static function get_tags($TagNames) {
383
   public static function get_tags($TagNames) {
384
-    $TagIDs = array();
384
+    $TagIDs = [];
385
     foreach ($TagNames as $Index => $TagName) {
385
     foreach ($TagNames as $Index => $TagName) {
386
       $Tag = G::$Cache->get_value("tag_id_$TagName");
386
       $Tag = G::$Cache->get_value("tag_id_$TagName");
387
       if (is_array($Tag)) {
387
       if (is_array($Tag)) {
469
    *  If array, it's a list of array keys not to escape.
469
    *  If array, it's a list of array keys not to escape.
470
    * @return mutated version of $Array with values escaped.
470
    * @return mutated version of $Array with values escaped.
471
    */
471
    */
472
-  public static function display_array($Array, $Escape = array()) {
472
+  public static function display_array($Array, $Escape = []) {
473
     foreach ($Array as $Key => $Val) {
473
     foreach ($Array as $Key => $Val) {
474
       if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
474
       if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
475
         $Array[$Key] = display_str($Val);
475
         $Array[$Key] = display_str($Val);
484
    * @return array of results
484
    * @return array of results
485
    */
485
    */
486
   public static function search_array($Array, $Key, $Value) {
486
   public static function search_array($Array, $Key, $Value) {
487
-    $Results = array();
487
+    $Results = [];
488
     if (is_array($Array))
488
     if (is_array($Array))
489
     {
489
     {
490
       if (isset($Array[$Key]) && $Array[$Key] == $Value) {
490
       if (isset($Array[$Key]) && $Array[$Key] == $Value) {

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

131
   return $String;
131
   return $String;
132
 }
132
 }
133
 
133
 
134
-function db_array($Array, $DontEscape = array(), $Quote = false) {
134
+function db_array($Array, $DontEscape = [], $Quote = false) {
135
   foreach ($Array as $Key => $Val) {
135
   foreach ($Array as $Key => $Val) {
136
     if (!in_array($Key, $DontEscape)) {
136
     if (!in_array($Key, $DontEscape)) {
137
       if ($Quote) {
137
       if ($Quote) {
148
 class DB_MYSQL {
148
 class DB_MYSQL {
149
   public $LinkID = false;
149
   public $LinkID = false;
150
   protected $QueryID = false;
150
   protected $QueryID = false;
151
-  protected $Record = array();
151
+  protected $Record = [];
152
   protected $Row;
152
   protected $Row;
153
   protected $Errno = 0;
153
   protected $Errno = 0;
154
   protected $Error = '';
154
   protected $Error = '';
155
 
155
 
156
-  public $Queries = array();
156
+  public $Queries = [];
157
   public $Time = 0.0;
157
   public $Time = 0.0;
158
 
158
 
159
   protected $Database = '';
159
   protected $Database = '';
352
   // If $Key is set, use the $Key column in the result set as the array key
352
   // If $Key is set, use the $Key column in the result set as the array key
353
   // Otherwise, use an integer
353
   // Otherwise, use an integer
354
   function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) {
354
   function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) {
355
-    $Return = array();
355
+    $Return = [];
356
     while ($Row = mysqli_fetch_array($this->QueryID, $Type)) {
356
     while ($Row = mysqli_fetch_array($this->QueryID, $Type)) {
357
       if ($Escape !== false) {
357
       if ($Escape !== false) {
358
         $Row = Misc::display_array($Row, $Escape);
358
         $Row = Misc::display_array($Row, $Escape);
369
 
369
 
370
   //  Loops through the result set, collecting the $ValField column into an array with $KeyField as keys
370
   //  Loops through the result set, collecting the $ValField column into an array with $KeyField as keys
371
   function to_pair($KeyField, $ValField, $Escape = true) {
371
   function to_pair($KeyField, $ValField, $Escape = true) {
372
-    $Return = array();
372
+    $Return = [];
373
     while ($Row = mysqli_fetch_array($this->QueryID)) {
373
     while ($Row = mysqli_fetch_array($this->QueryID)) {
374
       if ($Escape) {
374
       if ($Escape) {
375
         $Key = display_str($Row[$KeyField]);
375
         $Key = display_str($Row[$KeyField]);
386
 
386
 
387
   //  Loops through the result set, collecting the $Key column into an array
387
   //  Loops through the result set, collecting the $Key column into an array
388
   function collect($Key, $Escape = true) {
388
   function collect($Key, $Escape = true) {
389
-    $Return = array();
389
+    $Return = [];
390
     while ($Row = mysqli_fetch_array($this->QueryID)) {
390
     while ($Row = mysqli_fetch_array($this->QueryID)) {
391
       $Return[] = $Escape ? display_str($Row[$Key]) : $Row[$Key];
391
       $Return[] = $Escape ? display_str($Row[$Key]) : $Row[$Key];
392
     }
392
     }
413
    * and stores them in $this->Queries.
413
    * and stores them in $this->Queries.
414
    */
414
    */
415
   function warnings() {
415
   function warnings() {
416
-    $Warnings = array();
416
+    $Warnings = [];
417
     if (!is_bool($this->LinkID) && mysqli_warning_count($this->LinkID)) {
417
     if (!is_bool($this->LinkID) && mysqli_warning_count($this->LinkID)) {
418
       $e = mysqli_get_warnings($this->LinkID);
418
       $e = mysqli_get_warnings($this->LinkID);
419
       do {
419
       do {

+ 11
- 11
classes/notificationsmanager.class.php View File

58
   private $Settings;
58
   private $Settings;
59
   private $Skipped;
59
   private $Skipped;
60
 
60
 
61
-  function __construct($UserID, $Skip = array(), $Load = true, $AutoSkip = true) {
61
+  function __construct($UserID, $Skip = [], $Load = true, $AutoSkip = true) {
62
     $this->UserID = $UserID;
62
     $this->UserID = $UserID;
63
-    $this->Notifications = array();
63
+    $this->Notifications = [];
64
     $this->Settings = self::get_settings($UserID);
64
     $this->Settings = self::get_settings($UserID);
65
     $this->Skipped = $Skip;
65
     $this->Skipped = $Skip;
66
     if ($AutoSkip) {
66
     if ($AutoSkip) {
110
 
110
 
111
   public function clear_notifications_array() {
111
   public function clear_notifications_array() {
112
     unset($this->Notifications);
112
     unset($this->Notifications);
113
-    $this->Notifications = array();
113
+    $this->Notifications = [];
114
   }
114
   }
115
 
115
 
116
   private function create_notification($Type, $ID, $Message, $URL, $Importance) {
116
   private function create_notification($Type, $ID, $Message, $URL, $Importance) {
139
         FROM users_notifications_settings
139
         FROM users_notifications_settings
140
         WHERE $Type != 0
140
         WHERE $Type != 0
141
           AND UserID IN ($UserIDs)");
141
           AND UserID IN ($UserIDs)");
142
-      $UserIDs = array();
142
+      $UserIDs = [];
143
       while (list($ID) = G::$DB->next_record()) {
143
       while (list($ID) = G::$DB->next_record()) {
144
         $UserIDs[] = $ID;
144
         $UserIDs[] = $ID;
145
       }
145
       }
147
       foreach ($UserIDs as $UserID) {
147
       foreach ($UserIDs as $UserID) {
148
         $OneReads = G::$Cache->get_value("notifications_one_reads_$UserID");
148
         $OneReads = G::$Cache->get_value("notifications_one_reads_$UserID");
149
         if (!$OneReads) {
149
         if (!$OneReads) {
150
-          $OneReads = array();
150
+          $OneReads = [];
151
         }
151
         }
152
         array_unshift($OneReads, $this->create_notification($OneReads, "oneread_" . uniqid(), null, $Message, $URL, $Importance));
152
         array_unshift($OneReads, $this->create_notification($OneReads, "oneread_" . uniqid(), null, $Message, $URL, $Importance));
153
         $OneReads = array_filter($OneReads);
153
         $OneReads = array_filter($OneReads);
170
       FROM users_notifications_settings
170
       FROM users_notifications_settings
171
       WHERE $Type != 0
171
       WHERE $Type != 0
172
         $UserWhere");
172
         $UserWhere");
173
-    $IDs = array();
173
+    $IDs = [];
174
     while (list($ID) = G::$DB->next_record()) {
174
     while (list($ID) = G::$DB->next_record()) {
175
       $IDs[] = $ID;
175
       $IDs[] = $ID;
176
     }
176
     }
496
       FROM staff_pm_conversations
496
       FROM staff_pm_conversations
497
       WHERE Unread = true
497
       WHERE Unread = true
498
         AND UserID = " . G::$LoggedUser['ID']);
498
         AND UserID = " . G::$LoggedUser['ID']);
499
-    $IDs = array();
499
+    $IDs = [];
500
     while (list($ID) = G::$DB->next_record()) {
500
     while (list($ID) = G::$DB->next_record()) {
501
       $IDs[] = $ID;
501
       $IDs[] = $ID;
502
     }
502
     }
518
       FROM pm_conversations_users
518
       FROM pm_conversations_users
519
       WHERE Unread = '1'
519
       WHERE Unread = '1'
520
         AND UserID = " . G::$LoggedUser['ID']);
520
         AND UserID = " . G::$LoggedUser['ID']);
521
-    $IDs = array();
521
+    $IDs = [];
522
     while (list($ID) = G::$DB->next_record()) {
522
     while (list($ID) = G::$DB->next_record()) {
523
       $IDs[] = $ID;
523
       $IDs[] = $ID;
524
     }
524
     }
541
       FROM users_notify_torrents
541
       FROM users_notify_torrents
542
       WHERE UserID = ' " . G::$LoggedUser['ID'] . "'
542
       WHERE UserID = ' " . G::$LoggedUser['ID'] . "'
543
         AND UnRead = '1'");
543
         AND UnRead = '1'");
544
-    $IDs = array();
544
+    $IDs = [];
545
     while (list($ID) = G::$DB->next_record()) {
545
     while (list($ID) = G::$DB->next_record()) {
546
       $IDs[] = $ID;
546
       $IDs[] = $ID;
547
     }
547
     }
606
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
606
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
607
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
607
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
608
     if (empty($Notifications)) {
608
     if (empty($Notifications)) {
609
-      $Notifications = array();
609
+      $Notifications = [];
610
     }
610
     }
611
     array_unshift($Notifications, $this->create_notification($Type, $ID, $Message, $URL, $Importance, $AutoExpire));
611
     array_unshift($Notifications, $this->create_notification($Type, $ID, $Message, $URL, $Importance, $AutoExpire));
612
     G::$Cache->cache_value("user_cache_notifications_$UserID", $Notifications, 0);
612
     G::$Cache->cache_value("user_cache_notifications_$UserID", $Notifications, 0);
644
       // A little cheat technique, gets all keys in the $_POST array starting with 'notifications_'
644
       // A little cheat technique, gets all keys in the $_POST array starting with 'notifications_'
645
       $Settings = array_intersect_key($_POST, array_flip(preg_grep('/^notifications_/', array_keys($_POST))));
645
       $Settings = array_intersect_key($_POST, array_flip(preg_grep('/^notifications_/', array_keys($_POST))));
646
     }
646
     }
647
-    $Update = array();
647
+    $Update = [];
648
     foreach (self::$Types as $Type) {
648
     foreach (self::$Types as $Type) {
649
       $Popup = array_key_exists("notifications_{$Type}_popup", $Settings);
649
       $Popup = array_key_exists("notifications_{$Type}_popup", $Settings);
650
       $Traditional = array_key_exists("notifications_{$Type}_traditional", $Settings);
650
       $Traditional = array_key_exists("notifications_{$Type}_traditional", $Settings);

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

54
     $Paranoia = json_decode($Paranoia, true);
54
     $Paranoia = json_decode($Paranoia, true);
55
   }
55
   }
56
   if (!is_array($Paranoia)) {
56
   if (!is_array($Paranoia)) {
57
-    $Paranoia = array();
57
+    $Paranoia = [];
58
   }
58
   }
59
   if (is_array($Property)) {
59
   if (is_array($Property)) {
60
     $all = true;
60
     $all = true;

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

74
     $Permissions = self::get_permissions($UserInfo['PermissionID']);
74
     $Permissions = self::get_permissions($UserInfo['PermissionID']);
75
 
75
 
76
     // Manage 'special' inherited permissions
76
     // Manage 'special' inherited permissions
77
-    $BonusPerms = array();
77
+    $BonusPerms = [];
78
     $BonusCollages = 0;
78
     $BonusCollages = 0;
79
     foreach ($UserInfo['ExtraClasses'] as $PermID => $Value) {
79
     foreach ($UserInfo['ExtraClasses'] as $PermID => $Value) {
80
       $ClassPerms = self::get_permissions($PermID);
80
       $ClassPerms = self::get_permissions($PermID);
84
     }
84
     }
85
 
85
 
86
     if (empty($CustomPermissions)) {
86
     if (empty($CustomPermissions)) {
87
-      $CustomPermissions = array();
87
+      $CustomPermissions = [];
88
     }
88
     }
89
 
89
 
90
     $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages;
90
     $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages;

+ 8
- 8
classes/requests.class.php View File

75
     }
75
     }
76
     // Make sure there's something in $RequestIDs, otherwise the SQL will break
76
     // Make sure there's something in $RequestIDs, otherwise the SQL will break
77
     if (count($RequestIDs) === 0) {
77
     if (count($RequestIDs) === 0) {
78
-      return array();
78
+      return [];
79
     }
79
     }
80
     $IDs = implode(',', array_keys($NotFound));
80
     $IDs = implode(',', array_keys($NotFound));
81
 
81
 
111
       $Tags = self::get_tags(G::$DB->collect('ID', false));
111
       $Tags = self::get_tags(G::$DB->collect('ID', false));
112
       foreach ($Requests as $Request) {
112
       foreach ($Requests as $Request) {
113
         unset($NotFound[$Request['ID']]);
113
         unset($NotFound[$Request['ID']]);
114
-        $Request['Tags'] = isset($Tags[$Request['ID']]) ? $Tags[$Request['ID']] : array();
114
+        $Request['Tags'] = isset($Tags[$Request['ID']]) ? $Tags[$Request['ID']] : [];
115
         $Found[$Request['ID']] = $Request;
115
         $Found[$Request['ID']] = $Request;
116
         G::$Cache->cache_value('request_'.$Request['ID'], $Request, 0);
116
         G::$Cache->cache_value('request_'.$Request['ID'], $Request, 0);
117
       }
117
       }
149
     if (is_array($Artists)) {
149
     if (is_array($Artists)) {
150
       $Results = $Artists;
150
       $Results = $Artists;
151
     } else {
151
     } else {
152
-      $Results = array();
152
+      $Results = [];
153
       $QueryID = G::$DB->get_query_id();
153
       $QueryID = G::$DB->get_query_id();
154
       G::$DB->query("
154
       G::$DB->query("
155
         SELECT
155
         SELECT
172
 
172
 
173
   public static function get_tags($RequestIDs) {
173
   public static function get_tags($RequestIDs) {
174
     if (empty($RequestIDs)) {
174
     if (empty($RequestIDs)) {
175
-      return array();
175
+      return [];
176
     }
176
     }
177
     if (is_array($RequestIDs)) {
177
     if (is_array($RequestIDs)) {
178
       $RequestIDs = implode(',', $RequestIDs);
178
       $RequestIDs = implode(',', $RequestIDs);
189
       ORDER BY rt.TagID ASC");
189
       ORDER BY rt.TagID ASC");
190
     $Tags = G::$DB->to_array(false, MYSQLI_NUM, false);
190
     $Tags = G::$DB->to_array(false, MYSQLI_NUM, false);
191
     G::$DB->set_query_id($QueryID);
191
     G::$DB->set_query_id($QueryID);
192
-    $Results = array();
192
+    $Results = [];
193
     foreach ($Tags as $TagsRow) {
193
     foreach ($Tags as $TagsRow) {
194
       list($RequestID, $TagID, $TagName) = $TagsRow;
194
       list($RequestID, $TagID, $TagName) = $TagsRow;
195
       $Results[$RequestID][$TagID] = $TagName;
195
       $Results[$RequestID][$TagID] = $TagName;
213
       if (!G::$DB->has_results()) {
213
       if (!G::$DB->has_results()) {
214
         return array(
214
         return array(
215
           'TotalBounty' => 0,
215
           'TotalBounty' => 0,
216
-          'Voters' => array());
216
+          'Voters' => []);
217
       }
217
       }
218
       $Votes = G::$DB->to_array();
218
       $Votes = G::$DB->to_array();
219
 
219
 
220
-      $RequestVotes = array();
220
+      $RequestVotes = [];
221
       $RequestVotes['TotalBounty'] = array_sum(G::$DB->collect('Bounty'));
221
       $RequestVotes['TotalBounty'] = array_sum(G::$DB->collect('Bounty'));
222
 
222
 
223
       foreach ($Votes as $Vote) {
223
       foreach ($Votes as $Vote) {
224
         list($UserID, $Bounty, $Username) = $Vote;
224
         list($UserID, $Bounty, $Username) = $Vote;
225
-        $VoteArray = array();
225
+        $VoteArray = [];
226
         $VotesArray[] = array('UserID' => $UserID, 'Username' => $Username, 'Bounty' => $Bounty);
226
         $VotesArray[] = array('UserID' => $UserID, 'Username' => $Username, 'Bounty' => $Bounty);
227
       }
227
       }
228
 
228
 

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

107
     $SubCategory = (int)$SubCategory;
107
     $SubCategory = (int)$SubCategory;
108
     $Tags = db_string($Tags);
108
     $Tags = db_string($Tags);
109
     $Limit = (int)$Limit;
109
     $Limit = (int)$Limit;
110
-    $Where = array();
110
+    $Where = [];
111
     if (!empty($Month)) {
111
     if (!empty($Month)) {
112
       $Where[] = " MONTH(Date) = '$Month' ";
112
       $Where[] = " MONTH(Date) = '$Month' ";
113
     }
113
     }

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

4
 }
4
 }
5
 
5
 
6
 class Sphinxql extends mysqli {
6
 class Sphinxql extends mysqli {
7
-  private static $Connections = array();
7
+  private static $Connections = [];
8
   private $Server;
8
   private $Server;
9
   private $Port;
9
   private $Port;
10
   private $Socket;
10
   private $Socket;
11
   private $Ident;
11
   private $Ident;
12
   private $Connected = false;
12
   private $Connected = false;
13
 
13
 
14
-  public static $Queries = array();
14
+  public static $Queries = [];
15
   public static $Time = 0.0;
15
   public static $Time = 0.0;
16
 
16
 
17
 
17
 

+ 8
- 8
classes/sphinxqlquery.class.php View File

61
       $this->error("Attribute name and filter value are required.");
61
       $this->error("Attribute name and filter value are required.");
62
       return $this;
62
       return $this;
63
     }
63
     }
64
-    $Filters = array();
64
+    $Filters = [];
65
     if (is_array($Values)) {
65
     if (is_array($Values)) {
66
       foreach ($Values as $Value) {
66
       foreach ($Values as $Value) {
67
         if (!is_number($Value)) {
67
         if (!is_number($Value)) {
172
    */
172
    */
173
   public function order_by($Attribute = false, $Mode = false) {
173
   public function order_by($Attribute = false, $Mode = false) {
174
     if (empty($Attribute)) {
174
     if (empty($Attribute)) {
175
-      $this->SortBy = array();
175
+      $this->SortBy = [];
176
     } else {
176
     } else {
177
       $this->SortBy[] = "$Attribute $Mode";
177
       $this->SortBy[] = "$Attribute $Mode";
178
     }
178
     }
244
    * @return string of options
244
    * @return string of options
245
    */
245
    */
246
   private function build_options() {
246
   private function build_options() {
247
-    $Options = array();
247
+    $Options = [];
248
     foreach ($this->Options as $Option => $Value) {
248
     foreach ($this->Options as $Option => $Value) {
249
       $Options[] = "$Option = $Value";
249
       $Options[] = "$Option = $Value";
250
     }
250
     }
346
    * Reset all query options and conditions
346
    * Reset all query options and conditions
347
    */
347
    */
348
   public function reset() {
348
   public function reset() {
349
-    $this->Errors = array();
350
-    $this->Expressions = array();
351
-    $this->Filters = array();
349
+    $this->Errors = [];
350
+    $this->Expressions = [];
351
+    $this->Filters = [];
352
     $this->GroupBy = '';
352
     $this->GroupBy = '';
353
     $this->Indexes = '';
353
     $this->Indexes = '';
354
-    $this->Limits = array();
354
+    $this->Limits = [];
355
     $this->Options = array('ranker' => 'none');
355
     $this->Options = array('ranker' => 'none');
356
     $this->QueryString = '';
356
     $this->QueryString = '';
357
     $this->Select = '*';
357
     $this->Select = '*';
358
-    $this->SortBy = array();
358
+    $this->SortBy = [];
359
     $this->SortGroupBy = '';
359
     $this->SortGroupBy = '';
360
   }
360
   }
361
 
361
 

+ 5
- 5
classes/sphinxqlresult.class.php View File

47
    * @return array with the $Key value of all results
47
    * @return array with the $Key value of all results
48
    */
48
    */
49
   public function collect($Key) {
49
   public function collect($Key) {
50
-    $Return = array();
50
+    $Return = [];
51
     while ($Row = $this->fetch_array()) {
51
     while ($Row = $this->fetch_array()) {
52
       $Return[] = $Row[$Key];
52
       $Return[] = $Row[$Key];
53
     }
53
     }
63
    * @return array with all available data for the matches
63
    * @return array with all available data for the matches
64
    */
64
    */
65
   public function to_array($Key, $ResultType = MYSQLI_ASSOC) {
65
   public function to_array($Key, $ResultType = MYSQLI_ASSOC) {
66
-    $Return = array();
66
+    $Return = [];
67
     while ($Row = $this->fetch_array($ResultType)) {
67
     while ($Row = $this->fetch_array($ResultType)) {
68
       if ($Key !== false) {
68
       if ($Key !== false) {
69
         $Return[$Row[$Key]] = $Row;
69
         $Return[$Row[$Key]] = $Row;
83
    * @return array with $Key1 => $Key2 pairs for matches
83
    * @return array with $Key1 => $Key2 pairs for matches
84
    */
84
    */
85
   public function to_pair($Key1, $Key2) {
85
   public function to_pair($Key1, $Key2) {
86
-    $Return = array();
86
+    $Return = [];
87
     while ($Row = $this->fetch_array()) {
87
     while ($Row = $this->fetch_array()) {
88
       $Return[$Row[$Key1]] = $Row[$Key2];
88
       $Return[$Row[$Key1]] = $Row[$Key2];
89
     }
89
     }
100
   public function get_meta($Keys = false) {
100
   public function get_meta($Keys = false) {
101
     if ($Keys !== false) {
101
     if ($Keys !== false) {
102
       if (is_array($Keys)) {
102
       if (is_array($Keys)) {
103
-        $Return = array();
103
+        $Return = [];
104
         foreach ($Keys as $Key) {
104
         foreach ($Keys as $Key) {
105
           if (!isset($this->Meta[$Key])) {
105
           if (!isset($this->Meta[$Key])) {
106
             continue;
106
             continue;
125
   public function get_result_info($Keys = false) {
125
   public function get_result_info($Keys = false) {
126
     if ($Keys !== false) {
126
     if ($Keys !== false) {
127
       if (is_array($Keys)) {
127
       if (is_array($Keys)) {
128
-        $Return = array();
128
+        $Return = [];
129
         foreach ($Keys as $Key) {
129
         foreach ($Keys as $Key) {
130
           if (!isset($this->Result->$Key)) {
130
           if (!isset($this->Result->$Key)) {
131
             continue;
131
             continue;

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

17
      * different Page are: forums: TopicID artist: ArtistID collages:
17
      * different Page are: forums: TopicID artist: ArtistID collages:
18
      * CollageID requests: RequestID torrents: GroupID
18
      * CollageID requests: RequestID torrents: GroupID
19
      */
19
      */
20
-    $Matches = array();
20
+    $Matches = [];
21
     preg_match_all('/\[quote(?:=(.*)(?:\|.*)?)?]|\[\/quote]/iU', $Body, $Matches, PREG_SET_ORDER);
21
     preg_match_all('/\[quote(?:=(.*)(?:\|.*)?)?]|\[\/quote]/iU', $Body, $Matches, PREG_SET_ORDER);
22
 
22
 
23
     if (count($Matches)) {
23
     if (count($Matches)) {
24
-      $Usernames = array();
24
+      $Usernames = [];
25
       $Level = 0;
25
       $Level = 0;
26
       foreach ($Matches as $M) {
26
       foreach ($Matches as $M) {
27
         if ($M[0] != '[/quote]') {
27
         if ($M[0] != '[/quote]') {

+ 3
- 3
classes/tags.class.php View File

30
    * @static
30
    * @static
31
    * @var array $All Class Tags
31
    * @var array $All Class Tags
32
    */
32
    */
33
-  private static $All = array();
33
+  private static $All = [];
34
 
34
 
35
   /**
35
   /**
36
    * All tags in the current instance
36
    * All tags in the current instance
41
   /**
41
   /**
42
    * @var array $TagLink Tag link list
42
    * @var array $TagLink Tag link list
43
    */
43
    */
44
-  private $TagLink = array();
44
+  private $TagLink = [];
45
 
45
 
46
   /**
46
   /**
47
    * @var string $Primary The primary tag
47
    * @var string $Primary The primary tag
66
       $this->Primary = $this->Tags[0];
66
       $this->Primary = $this->Tags[0];
67
       sort($this->Tags);
67
       sort($this->Tags);
68
     } else {
68
     } else {
69
-      $this->Tags = array();
69
+      $this->Tags = [];
70
     }
70
     }
71
   }
71
   }
72
 
72
 

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

7
 
7
 
8
 class TEMPLATE {
8
 class TEMPLATE {
9
   var $file = '';
9
   var $file = '';
10
-  var $vars = array();
10
+  var $vars = [];
11
 
11
 
12
   function open($file) {
12
   function open($file) {
13
     $this->file = file($file);
13
     $this->file = file($file);

+ 4
- 4
classes/testing.class.php View File

2
 
2
 
3
 class Testing {
3
 class Testing {
4
   private static $ClassDirectories = array("classes");
4
   private static $ClassDirectories = array("classes");
5
-  private static $Classes = array();
5
+  private static $Classes = [];
6
 
6
 
7
   /**
7
   /**
8
    * Initialize the testasble classes into a map keyed by class name
8
    * Initialize the testasble classes into a map keyed by class name
87
       $ReflectionClass = $Class;
87
       $ReflectionClass = $Class;
88
     }
88
     }
89
     $ReflectionMethods = $ReflectionClass->getMethods();
89
     $ReflectionMethods = $ReflectionClass->getMethods();
90
-    $TestableMethods = array();
90
+    $TestableMethods = [];
91
     foreach($ReflectionMethods as $Method) {
91
     foreach($ReflectionMethods as $Method) {
92
       if ($Method->isPublic() && $Method->isStatic() && strpos($Method->getDocComment(), "@Test")) {
92
       if ($Method->isPublic() && $Method->isStatic() && strpos($Method->getDocComment(), "@Test")) {
93
         $TestableMethods[] = $Method;
93
         $TestableMethods[] = $Method;
110
    */
110
    */
111
   public static function get_undocumented_methods($Class) {
111
   public static function get_undocumented_methods($Class) {
112
     $ReflectionClass = self::$Classes[$Class];
112
     $ReflectionClass = self::$Classes[$Class];
113
-    $Methods = array();
113
+    $Methods = [];
114
     foreach($ReflectionClass->getMethods() as $Method) {
114
     foreach($ReflectionClass->getMethods() as $Method) {
115
       if (!$Method->getDocComment()) {
115
       if (!$Method->getDocComment()) {
116
         $Methods[] = $Method;
116
         $Methods[] = $Method;
124
    */
124
    */
125
   public static function get_documented_methods($Class)  {
125
   public static function get_documented_methods($Class)  {
126
     $ReflectionClass = self::$Classes[$Class];
126
     $ReflectionClass = self::$Classes[$Class];
127
-    $Methods = array();
127
+    $Methods = [];
128
     foreach($ReflectionClass->getMethods() as $Method) {
128
     foreach($ReflectionClass->getMethods() as $Method) {
129
       if ($Method->getDocComment()) {
129
       if ($Method->getDocComment()) {
130
         $Methods[] = $Method;
130
         $Methods[] = $Method;

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

125
    * Processed version of the $Smileys array, see {@link smileys}
125
    * Processed version of the $Smileys array, see {@link smileys}
126
    * @var array $ProcessedSmileys
126
    * @var array $ProcessedSmileys
127
    */
127
    */
128
-  private static $ProcessedSmileys = array();
128
+  private static $ProcessedSmileys = [];
129
 
129
 
130
   /**
130
   /**
131
    * Whether or not to turn images into URLs (used inside [quote] tags).
131
    * Whether or not to turn images into URLs (used inside [quote] tags).
202
     global $Debug;
202
     global $Debug;
203
     $Debug->set_flag('BBCode start');
203
     $Debug->set_flag('BBCode start');
204
     $Str = display_str($Str);
204
     $Str = display_str($Str);
205
-    self::$Headlines = array();
205
+    self::$Headlines = [];
206
 
206
 
207
     $Str = preg_replace('/\[\\[(ch|uch)]\]/i', '', $Str);
207
     $Str = preg_replace('/\[\\[(ch|uch)]\]/i', '', $Str);
208
     $Str = preg_replace('/\[ch\]/i', '[ch][/ch]', $Str);
208
     $Str = preg_replace('/\[ch\]/i', '[ch][/ch]', $Str);
344
   private static function parse($Str) {
344
   private static function parse($Str) {
345
     $i = 0; // Pointer to keep track of where we are in $Str
345
     $i = 0; // Pointer to keep track of where we are in $Str
346
     $Len = strlen($Str);
346
     $Len = strlen($Str);
347
-    $Array = array();
347
+    $Array = [];
348
     $ArrayPos = 0;
348
     $ArrayPos = 0;
349
     $StrLC = strtolower($Str);
349
     $StrLC = strtolower($Str);
350
 
350
 
721
           break;
721
           break;
722
         case 'torrent':
722
         case 'torrent':
723
           $Pattern = '/('.SITE_DOMAIN.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i';
723
           $Pattern = '/('.SITE_DOMAIN.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i';
724
-          $Matches = array();
724
+          $Matches = [];
725
           if (preg_match($Pattern, $Block['Val'], $Matches)) {
725
           if (preg_match($Pattern, $Block['Val'], $Matches)) {
726
             if (isset($Matches[2])) {
726
             if (isset($Matches[2])) {
727
               $GroupID = $Matches[2];
727
               $GroupID = $Matches[2];

+ 3
- 3
classes/textarea_preview.class.php View File

14
    * @static
14
    * @static
15
    * @var array $_ID Array of textarea IDs
15
    * @var array $_ID Array of textarea IDs
16
    */
16
    */
17
-  protected static $_ID = array();
17
+  protected static $_ID = [];
18
 
18
 
19
   /**
19
   /**
20
    * @static
20
    * @static
56
    * @return void
56
    * @return void
57
    */
57
    */
58
   private static function iterator() {
58
   private static function iterator() {
59
-    $script = array();
59
+    $script = [];
60
     for ($i = 0; $i < self::$Textareas; $i++) {
60
     for ($i = 0; $i < self::$Textareas; $i++) {
61
       if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
61
       if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
62
         $a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
62
         $a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
149
    */
149
    */
150
   public function __construct($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 10,
150
   public function __construct($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 10,
151
     $Preview = true, $Buttons = true, $Buffer = false,
151
     $Preview = true, $Buttons = true, $Buffer = false,
152
-    array $ExtraAttributes = array()
152
+    array $ExtraAttributes = []
153
   ) {
153
   ) {
154
     $this->id = parent::$Textareas;
154
     $this->id = parent::$Textareas;
155
     parent::$Textareas += 1;
155
     parent::$Textareas += 1;

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

60
    * @return the country of origin
60
    * @return the country of origin
61
    */
61
    */
62
   public static function geoip($IP) {
62
   public static function geoip($IP) {
63
-    static $IPs = array();
63
+    static $IPs = [];
64
     if (isset($IPs[$IP])) {
64
     if (isset($IPs[$IP])) {
65
       return $IPs[$IP];
65
       return $IPs[$IP];
66
     }
66
     }

+ 4
- 4
classes/torrent.class.php View File

237
   }
237
   }
238
 
238
 
239
   function set_announce_list($UrlsList) {
239
   function set_announce_list($UrlsList) {
240
-    $AnnounceList = new BENCODE_LIST(array(), true);
240
+    $AnnounceList = new BENCODE_LIST([], true);
241
     foreach ($UrlsList as $Urls) {
241
     foreach ($UrlsList as $Urls) {
242
       $SubList = new BENCODE_LIST($Urls, true);
242
       $SubList = new BENCODE_LIST($Urls, true);
243
       unset($SubList->Str);
243
       unset($SubList->Str);
255
   //  * the files in the torrent
255
   //  * the files in the torrent
256
   //  * the total size of files described therein
256
   //  * the total size of files described therein
257
   function file_list() {
257
   function file_list() {
258
-    $FileList = array();
258
+    $FileList = [];
259
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
259
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
260
       $TotalSize = $this->Val['info']->Val['length'];
260
       $TotalSize = $this->Val['info']->Val['length'];
261
       $FileList[] = array($TotalSize, $this->get_name());
261
       $FileList[] = array($TotalSize, $this->get_name());
262
     } else { // Multiple file mode
262
     } else { // Multiple file mode
263
-      $FileNames = array();
264
-      $FileSizes = array();
263
+      $FileNames = [];
264
+      $FileSizes = [];
265
       $TotalSize = 0;
265
       $TotalSize = 0;
266
       $Files = $this->Val['info']->Val['files']->Val;
266
       $Files = $this->Val['info']->Val['files']->Val;
267
       if (isset($Files[0]->Val['path.utf-8'])) {
267
       if (isset($Files[0]->Val['path.utf-8'])) {

+ 3
- 3
classes/torrent_32bit.class.php View File

248
   //  * the files in the torrent
248
   //  * the files in the torrent
249
   //  * the total size of files described therein
249
   //  * the total size of files described therein
250
   function file_list() {
250
   function file_list() {
251
-    $FileList = array();
251
+    $FileList = [];
252
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
252
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
253
       $TotalSize = substr($this->Val['info']->Val['length'],7);
253
       $TotalSize = substr($this->Val['info']->Val['length'],7);
254
       $FileList[] = array($TotalSize, $this->get_name());
254
       $FileList[] = array($TotalSize, $this->get_name());
255
     } else { // Multiple file mode
255
     } else { // Multiple file mode
256
-      $FileNames = array();
257
-      $FileSizes = array();
256
+      $FileNames = [];
257
+      $FileSizes = [];
258
       $TotalSize = 0;
258
       $TotalSize = 0;
259
       $Files = $this->Val['info']->Val['files']->Val;
259
       $Files = $this->Val['info']->Val['files']->Val;
260
       if (isset($Files[0]->Val['path.utf-8'])) {
260
       if (isset($Files[0]->Val['path.utf-8'])) {

+ 14
- 14
classes/torrent_form.class.php View File

14
 
14
 
15
 class TORRENT_FORM {
15
 class TORRENT_FORM {
16
   var $UploadForm = '';
16
   var $UploadForm = '';
17
-  var $Categories = array();
18
-  var $Formats = array();
19
-  var $Bitrates = array();
20
-  var $Media = array();
21
-  var $MediaManaga = array();
22
-  var $Containers = array();
23
-  var $ContainersGames = array();
24
-  var $Codecs = array();
25
-  var $Resolutions = array();
26
-  var $AudioFormats = array();
27
-  var $Subbing = array();
28
-  var $Languages = array();
29
-  var $Platform = array();
17
+  var $Categories = [];
18
+  var $Formats = [];
19
+  var $Bitrates = [];
20
+  var $Media = [];
21
+  var $MediaManaga = [];
22
+  var $Containers = [];
23
+  var $ContainersGames = [];
24
+  var $Codecs = [];
25
+  var $Resolutions = [];
26
+  var $AudioFormats = [];
27
+  var $Subbing = [];
28
+  var $Languages = [];
29
+  var $Platform = [];
30
   var $NewTorrent = false;
30
   var $NewTorrent = false;
31
-  var $Torrent = array();
31
+  var $Torrent = [];
32
   var $Error = false;
32
   var $Error = false;
33
   var $TorrentID = false;
33
   var $TorrentID = false;
34
   var $Disabled = '';
34
   var $Disabled = '';

+ 20
- 20
classes/torrents.class.php View File

64
     }
64
     }
65
     // Make sure there's something in $GroupIDs, otherwise the SQL will break
65
     // Make sure there's something in $GroupIDs, otherwise the SQL will break
66
     if (count($GroupIDs) === 0) {
66
     if (count($GroupIDs) === 0) {
67
-      return array();
67
+      return [];
68
     }
68
     }
69
 
69
 
70
     /*
70
     /*
77
 
77
 
78
     if (count($NotFound) > 0) {
78
     if (count($NotFound) > 0) {
79
       $IDs = implode(',', array_keys($NotFound));
79
       $IDs = implode(',', array_keys($NotFound));
80
-      $NotFound = array();
80
+      $NotFound = [];
81
       $QueryID = G::$DB->get_query_id();
81
       $QueryID = G::$DB->get_query_id();
82
       G::$DB->query("
82
       G::$DB->query("
83
         SELECT
83
         SELECT
87
 
87
 
88
       while ($Group = G::$DB->next_record(MYSQLI_ASSOC, true)) {
88
       while ($Group = G::$DB->next_record(MYSQLI_ASSOC, true)) {
89
         $NotFound[$Group['ID']] = $Group;
89
         $NotFound[$Group['ID']] = $Group;
90
-        $NotFound[$Group['ID']]['Torrents'] = array();
91
-        $NotFound[$Group['ID']]['Artists'] = array();
90
+        $NotFound[$Group['ID']]['Torrents'] = [];
91
+        $NotFound[$Group['ID']]['Artists'] = [];
92
       }
92
       }
93
       G::$DB->set_query_id($QueryID);
93
       G::$DB->set_query_id($QueryID);
94
 
94
 
101
 
101
 
102
       while ($Screenshot = G::$DB->next_record(MYSQLI_ASSOC, true)) {
102
       while ($Screenshot = G::$DB->next_record(MYSQLI_ASSOC, true)) {
103
         if (!isset($NotFound[$Screenshot['GroupID']]['Screenshots']))
103
         if (!isset($NotFound[$Screenshot['GroupID']]['Screenshots']))
104
-          $NotFound[$Screenshot['GroupID']]['Screenshots'] = array();
104
+          $NotFound[$Screenshot['GroupID']]['Screenshots'] = [];
105
         $NotFound[$Screenshot['GroupID']]['Screenshots'][] = $Screenshot;
105
         $NotFound[$Screenshot['GroupID']]['Screenshots'][] = $Screenshot;
106
       }
106
       }
107
 
107
 
138
     if ($GetArtists) {
138
     if ($GetArtists) {
139
       $Artists = Artists::get_artists($GroupIDs);
139
       $Artists = Artists::get_artists($GroupIDs);
140
     } else {
140
     } else {
141
-      $Artists = array();
141
+      $Artists = [];
142
     }
142
     }
143
 
143
 
144
     if ($Return) { // If we're interested in the data, and not just caching it
144
     if ($Return) { // If we're interested in the data, and not just caching it
659
    * @param boolean $ShowEdition if false, RemasterYear/RemasterTitle will be omitted
659
    * @param boolean $ShowEdition if false, RemasterYear/RemasterTitle will be omitted
660
    */
660
    */
661
   public static function torrent_info($Data, $ShowMedia = true, $ShowEdition = false, $HTMLy = true) {
661
   public static function torrent_info($Data, $ShowMedia = true, $ShowEdition = false, $HTMLy = true) {
662
-    $Info = array();
662
+    $Info = [];
663
     if ($ShowMedia && !empty($Data['Media'])) {
663
     if ($ShowMedia && !empty($Data['Media'])) {
664
       $Info[] = $Data['Media'];
664
       $Info[] = $Data['Media'];
665
     }
665
     }
865
     $Buckets = 64;
865
     $Buckets = 64;
866
     $LastBucket = $Buckets - 1;
866
     $LastBucket = $Buckets - 1;
867
     $BucketID = $TorrentID & $LastBucket;
867
     $BucketID = $TorrentID & $LastBucket;
868
-    static $SnatchedTorrents = array(), $UpdateTime = array();
868
+    static $SnatchedTorrents = [], $UpdateTime = [];
869
 
869
 
870
     if (empty($SnatchedTorrents)) {
870
     if (empty($SnatchedTorrents)) {
871
       $SnatchedTorrents = array_fill(0, $Buckets, false);
871
       $SnatchedTorrents = array_fill(0, $Buckets, false);
886
       // This bucket hasn't been checked before
886
       // This bucket hasn't been checked before
887
       $CurSnatchedTorrents = G::$Cache->get_value("users_snatched_{$UserID}_$BucketID", true);
887
       $CurSnatchedTorrents = G::$Cache->get_value("users_snatched_{$UserID}_$BucketID", true);
888
       if ($CurSnatchedTorrents === false || $CurTime > $UpdateTime['next']) {
888
       if ($CurSnatchedTorrents === false || $CurTime > $UpdateTime['next']) {
889
-        $Updated = array();
889
+        $Updated = [];
890
         $QueryID = G::$DB->get_query_id();
890
         $QueryID = G::$DB->get_query_id();
891
         if ($CurSnatchedTorrents === false || $UpdateTime['last'] == 0) {
891
         if ($CurSnatchedTorrents === false || $UpdateTime['last'] == 0) {
892
           for ($i = 0; $i < $Buckets; $i++) {
892
           for ($i = 0; $i < $Buckets; $i++) {
893
-            $SnatchedTorrents[$i] = array();
893
+            $SnatchedTorrents[$i] = [];
894
           }
894
           }
895
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
895
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
896
           G::$DB->query("
896
           G::$DB->query("
916
             if ($SnatchedTorrents[$CurBucketID] === false) {
916
             if ($SnatchedTorrents[$CurBucketID] === false) {
917
               $SnatchedTorrents[$CurBucketID] = G::$Cache->get_value("users_snatched_{$UserID}_$CurBucketID", true);
917
               $SnatchedTorrents[$CurBucketID] = G::$Cache->get_value("users_snatched_{$UserID}_$CurBucketID", true);
918
               if ($SnatchedTorrents[$CurBucketID] === false) {
918
               if ($SnatchedTorrents[$CurBucketID] === false) {
919
-                $SnatchedTorrents[$CurBucketID] = array();
919
+                $SnatchedTorrents[$CurBucketID] = [];
920
               }
920
               }
921
             }
921
             }
922
             $SnatchedTorrents[$CurBucketID][(int)$ID] = true;
922
             $SnatchedTorrents[$CurBucketID][(int)$ID] = true;
946
     $Buckets = 64;
946
     $Buckets = 64;
947
     $LastBucket = $Buckets - 1;
947
     $LastBucket = $Buckets - 1;
948
     $BucketID = $TorrentID & $LastBucket;
948
     $BucketID = $TorrentID & $LastBucket;
949
-    static $SeedingTorrents = array(), $UpdateTime = array();
949
+    static $SeedingTorrents = [], $UpdateTime = [];
950
 
950
 
951
     if (empty($SeedingTorrents)) {
951
     if (empty($SeedingTorrents)) {
952
       $SeedingTorrents = array_fill(0, $Buckets, false);
952
       $SeedingTorrents = array_fill(0, $Buckets, false);
967
       // This bucket hasn't been checked before
967
       // This bucket hasn't been checked before
968
       $CurSeedingTorrents = G::$Cache->get_value("users_seeding_{$UserID}_$BucketID", true);
968
       $CurSeedingTorrents = G::$Cache->get_value("users_seeding_{$UserID}_$BucketID", true);
969
       if ($CurSeedingTorrents === false || $CurTime > $UpdateTime['next']) {
969
       if ($CurSeedingTorrents === false || $CurTime > $UpdateTime['next']) {
970
-        $Updated = array();
970
+        $Updated = [];
971
         $QueryID = G::$DB->get_query_id();
971
         $QueryID = G::$DB->get_query_id();
972
         if ($CurSeedingTorrents === false || $UpdateTime['last'] == 0) {
972
         if ($CurSeedingTorrents === false || $UpdateTime['last'] == 0) {
973
           for ($i = 0; $i < $Buckets; $i++) {
973
           for ($i = 0; $i < $Buckets; $i++) {
974
-            $SeedingTorrents[$i] = array();
974
+            $SeedingTorrents[$i] = [];
975
           }
975
           }
976
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
976
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
977
           G::$DB->query("
977
           G::$DB->query("
1001
             if ($SeedingTorrents[$CurBucketID] === false) {
1001
             if ($SeedingTorrents[$CurBucketID] === false) {
1002
               $SeedingTorrents[$CurBucketID] = G::$Cache->get_value("users_seeding_{$UserID}_$CurBucketID", true);
1002
               $SeedingTorrents[$CurBucketID] = G::$Cache->get_value("users_seeding_{$UserID}_$CurBucketID", true);
1003
               if ($SeedingTorrents[$CurBucketID] === false) {
1003
               if ($SeedingTorrents[$CurBucketID] === false) {
1004
-                $SeedingTorrents[$CurBucketID] = array();
1004
+                $SeedingTorrents[$CurBucketID] = [];
1005
               }
1005
               }
1006
             }
1006
             }
1007
             $SeedingTorrents[$CurBucketID][(int)$ID] = true;
1007
             $SeedingTorrents[$CurBucketID][(int)$ID] = true;
1032
     $Buckets = 64;
1032
     $Buckets = 64;
1033
     $LastBucket = $Buckets - 1;
1033
     $LastBucket = $Buckets - 1;
1034
     $BucketID = $TorrentID & $LastBucket;
1034
     $BucketID = $TorrentID & $LastBucket;
1035
-    static $LeechingTorrents = array(), $UpdateTime = array();
1035
+    static $LeechingTorrents = [], $UpdateTime = [];
1036
 
1036
 
1037
     if (empty($LeechingTorrents)) {
1037
     if (empty($LeechingTorrents)) {
1038
       $LeechingTorrents = array_fill(0, $Buckets, false);
1038
       $LeechingTorrents = array_fill(0, $Buckets, false);
1053
       // This bucket hasn't been checked before
1053
       // This bucket hasn't been checked before
1054
       $CurLeechingTorrents = G::$Cache->get_value("users_leeching_{$UserID}_$BucketID", true);
1054
       $CurLeechingTorrents = G::$Cache->get_value("users_leeching_{$UserID}_$BucketID", true);
1055
       if ($CurLeechingTorrents === false || $CurTime > $UpdateTime['next']) {
1055
       if ($CurLeechingTorrents === false || $CurTime > $UpdateTime['next']) {
1056
-        $Updated = array();
1056
+        $Updated = [];
1057
         $QueryID = G::$DB->get_query_id();
1057
         $QueryID = G::$DB->get_query_id();
1058
         if ($CurLeechingTorrents === false || $UpdateTime['last'] == 0) {
1058
         if ($CurLeechingTorrents === false || $UpdateTime['last'] == 0) {
1059
           for ($i = 0; $i < $Buckets; $i++) {
1059
           for ($i = 0; $i < $Buckets; $i++) {
1060
-            $LeechingTorrents[$i] = array();
1060
+            $LeechingTorrents[$i] = [];
1061
           }
1061
           }
1062
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
1062
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
1063
           G::$DB->query("
1063
           G::$DB->query("
1087
             if ($LeechingTorrents[$CurBucketID] === false) {
1087
             if ($LeechingTorrents[$CurBucketID] === false) {
1088
               $LeechingTorrents[$CurBucketID] = G::$Cache->get_value("users_leeching_{$UserID}_$CurBucketID", true);
1088
               $LeechingTorrents[$CurBucketID] = G::$Cache->get_value("users_leeching_{$UserID}_$CurBucketID", true);
1089
               if ($LeechingTorrents[$CurBucketID] === false) {
1089
               if ($LeechingTorrents[$CurBucketID] === false) {
1090
-                $LeechingTorrents[$CurBucketID] = array();
1090
+                $LeechingTorrents[$CurBucketID] = [];
1091
               }
1091
               }
1092
             }
1092
             }
1093
             $LeechingTorrents[$CurBucketID][(int)$ID] = true;
1093
             $LeechingTorrents[$CurBucketID][(int)$ID] = true;
1238
       G::$Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0);
1238
       G::$Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0);
1239
     }
1239
     }
1240
     if (!check_perms('admin_reports')) {
1240
     if (!check_perms('admin_reports')) {
1241
-      $Return = array();
1241
+      $Return = [];
1242
       foreach ($Reports as $Report) {
1242
       foreach ($Reports as $Report) {
1243
         if ($Report['Type'] !== 'edited') {
1243
         if ($Report['Type'] !== 'edited') {
1244
           $Return[] = $Report;
1244
           $Return[] = $Report;

+ 5
- 5
classes/torrentsdl.class.php View File

9
   private $QueryRowNum = 0;
9
   private $QueryRowNum = 0;
10
   private $Zip;
10
   private $Zip;
11
   private $IDBoundaries;
11
   private $IDBoundaries;
12
-  private $FailedFiles = array();
12
+  private $FailedFiles = [];
13
   private $NumAdded = 0;
13
   private $NumAdded = 0;
14
   private $NumFound = 0;
14
   private $NumFound = 0;
15
   private $Size = 0;
15
   private $Size = 0;
35
     function add_passkey($Ann) {
35
     function add_passkey($Ann) {
36
       return (is_array($Ann)) ? array_map('add_passkey', $Ann) : $Ann."/".G::$LoggedUser['torrent_pass']."/announce";
36
       return (is_array($Ann)) ? array_map('add_passkey', $Ann) : $Ann."/".G::$LoggedUser['torrent_pass']."/announce";
37
     }
37
     }
38
-    $this->AnnounceList = (sizeof(ANNOUNCE_URLS) == 1 && sizeof(ANNOUNCE_URLS[0]) == 1) ? array() : array_map('add_passkey', ANNOUNCE_URLS);
38
+    $this->AnnounceList = (sizeof(ANNOUNCE_URLS) == 1 && sizeof(ANNOUNCE_URLS[0]) == 1) ? [] : array_map('add_passkey', ANNOUNCE_URLS);
39
     $this->Zip = new Zip(Misc::file_string($Title));
39
     $this->Zip = new Zip(Misc::file_string($Title));
40
   }
40
   }
41
 
41
 
46
    * @return array with results and torrent group IDs or false if there are no results left
46
    * @return array with results and torrent group IDs or false if there are no results left
47
    */
47
    */
48
   public function get_downloads($Key) {
48
   public function get_downloads($Key) {
49
-    $GroupIDs = $Downloads = array();
49
+    $GroupIDs = $Downloads = [];
50
     $OldQuery = G::$DB->get_query_id();
50
     $OldQuery = G::$DB->get_query_id();
51
     G::$DB->set_query_id($this->QueryResult);
51
     G::$DB->set_query_id($this->QueryResult);
52
     if (!isset($this->IDBoundaries)) {
52
     if (!isset($this->IDBoundaries)) {
189
     if ($Year > 0) {
189
     if ($Year > 0) {
190
       $TorrentName .= " - $Year";
190
       $TorrentName .= " - $Year";
191
     }
191
     }
192
-    $TorrentInfo = array();
192
+    $TorrentInfo = [];
193
     if ($Media != '') {
193
     if ($Media != '') {
194
       $TorrentInfo[] = $Media;
194
       $TorrentInfo[] = $Media;
195
     }
195
     }
224
    * @param mixed $TorrentData bencoded torrent without announce URL (new format) or TORRENT object (old format)
224
    * @param mixed $TorrentData bencoded torrent without announce URL (new format) or TORRENT object (old format)
225
    * @return bencoded string
225
    * @return bencoded string
226
    */
226
    */
227
-  public static function get_file(&$TorrentData, $AnnounceURL, $AnnounceList = array()) {
227
+  public static function get_file(&$TorrentData, $AnnounceURL, $AnnounceList = []) {
228
     if (Misc::is_new_torrent($TorrentData)) {
228
     if (Misc::is_new_torrent($TorrentData)) {
229
       $Bencode = BencodeTorrent::add_announce_url($TorrentData, $AnnounceURL);
229
       $Bencode = BencodeTorrent::add_announce_url($TorrentData, $AnnounceURL);
230
       if (!empty($AnnounceList)) {
230
       if (!empty($AnnounceList)) {

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

4
   const STATS_MAIN = 0;
4
   const STATS_MAIN = 0;
5
   const STATS_USER = 1;
5
   const STATS_USER = 1;
6
 
6
 
7
-  public static $Requests = array();
7
+  public static $Requests = [];
8
 
8
 
9
   /**
9
   /**
10
    * Send a GET request over a socket directly to the tracker
10
    * Send a GET request over a socket directly to the tracker
109
     if ($Response === false) {
109
     if ($Response === false) {
110
       return false;
110
       return false;
111
     }
111
     }
112
-    $Stats = array();
112
+    $Stats = [];
113
     foreach (explode("\n", $Response) as $Stat) {
113
     foreach (explode("\n", $Response) as $Stat) {
114
       list($Val, $Key) = explode(" ", $Stat, 2);
114
       list($Val, $Key) = explode(" ", $Stat, 2);
115
       $Stats[$Key] = $Val;
115
       $Stats[$Key] = $Val;

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

7
   private $issuer;
7
   private $issuer;
8
   private static $_base32dict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=';
8
   private static $_base32dict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=';
9
   private static $_base32;
9
   private static $_base32;
10
-  private static $_base32lookup = array();
10
+  private static $_base32lookup = [];
11
   private static $_supportedalgos = array('sha1', 'sha256', 'sha512', 'md5');
11
   private static $_supportedalgos = array('sha1', 'sha256', 'sha512', 'md5');
12
 
12
 
13
   function __construct($issuer = null, $digits = 6, $period = 30, $algorithm = 'sha1') {
13
   function __construct($issuer = null, $digits = 6, $period = 30, $algorithm = 'sha1') {

+ 1
- 1
classes/util.php View File

191
   } elseif ($Message) {
191
   } elseif ($Message) {
192
     print json_encode(array('status' => $Status, 'error' => $Message));
192
     print json_encode(array('status' => $Status, 'error' => $Message));
193
   } else {
193
   } else {
194
-    print json_encode(array('status' => $Status, 'response' => array()));
194
+    print json_encode(array('status' => $Status, 'response' => []));
195
   }
195
   }
196
 }
196
 }
197
 
197
 

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

6
 //-----------------------------------*/
6
 //-----------------------------------*/
7
 
7
 
8
 class VALIDATE {
8
 class VALIDATE {
9
-  var $Fields = array();
9
+  var $Fields = [];
10
 
10
 
11
-  function SetFields($FieldName, $Required, $FieldType, $ErrorMessage, $Options = array()) {
11
+  function SetFields($FieldName, $Required, $FieldType, $ErrorMessage, $Options = []) {
12
     $this->Fields[$FieldName]['Type'] = strtolower($FieldType);
12
     $this->Fields[$FieldName]['Type'] = strtolower($FieldType);
13
     $this->Fields[$FieldName]['Required'] = $Required;
13
     $this->Fields[$FieldName]['Required'] = $Required;
14
     $this->Fields[$FieldName]['ErrorMessage'] = $ErrorMessage;
14
     $this->Fields[$FieldName]['ErrorMessage'] = $ErrorMessage;

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

53
    *                 Here is a list of parameters that work in the $Options array:
53
    *                 Here is a list of parameters that work in the $Options array:
54
    *                 ['disclaimer'] = [boolean] (False) Displays the disclaimer in the footer
54
    *                 ['disclaimer'] = [boolean] (False) Displays the disclaimer in the footer
55
    */
55
    */
56
-  public static function show_footer($Options = array()) {
56
+  public static function show_footer($Options = []) {
57
     global $ScriptStartTime, $SessionID, $UserSessions, $Debug, $Time, $Mobile;
57
     global $ScriptStartTime, $SessionID, $UserSessions, $Debug, $Time, $Mobile;
58
     if (!is_array(G::$LoggedUser) || (isset($Options['recover']) && $Options['recover'] === true)) {
58
     if (!is_array(G::$LoggedUser) || (isset($Options['recover']) && $Options['recover'] === true)) {
59
       require(SERVER_ROOT.'/design/publicfooter.php');
59
       require(SERVER_ROOT.'/design/publicfooter.php');
125
    *  echo $SavedTemplate; // Output the buffer
125
    *  echo $SavedTemplate; // Output the buffer
126
    * </pre>
126
    * </pre>
127
    */
127
    */
128
-  public static function parse($TemplateFile, array $Variables = array(), $Buffer = false) {
128
+  public static function parse($TemplateFile, array $Variables = [], $Buffer = false) {
129
     $Template = self::IncludePath . $TemplateFile;
129
     $Template = self::IncludePath . $TemplateFile;
130
     if (file_exists($Template)) {
130
     if (file_exists($Template)) {
131
       extract($Variables);
131
       extract($Variables);

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

31
    */
31
    */
32
   public static function get_user_votes($UserID) {
32
   public static function get_user_votes($UserID) {
33
     if ((int)$UserID == 0) {
33
     if ((int)$UserID == 0) {
34
-      return array();
34
+      return [];
35
     }
35
     }
36
 
36
 
37
     $UserVotes = G::$Cache->get_value("voted_albums_$UserID");
37
     $UserVotes = G::$Cache->get_value("voted_albums_$UserID");
295
    * @return array (<GroupID> => <Rank>)
295
    * @return array (<GroupID> => <Rank>)
296
    */
296
    */
297
   public static function calc_ranks($GroupScores) {
297
   public static function calc_ranks($GroupScores) {
298
-    $Rankings = array();
298
+    $Rankings = [];
299
     $PrevScore = $PrevRank = false;
299
     $PrevScore = $PrevRank = false;
300
     $Rank = 1;
300
     $Rank = 1;
301
     foreach ($GroupScores as $GroupID => $Score) {
301
     foreach ($GroupScores as $GroupID => $Score) {

+ 3
- 3
design/privateheader.php View File

117
 $Notifications = $NotificationsManager->get_notifications();
117
 $Notifications = $NotificationsManager->get_notifications();
118
 $UseNoty = $NotificationsManager->use_noty();
118
 $UseNoty = $NotificationsManager->use_noty();
119
 $NewSubscriptions = false;
119
 $NewSubscriptions = false;
120
-$NotificationSpans = array();
120
+$NotificationSpans = [];
121
 foreach ($Notifications as $Type => $Notification) {
121
 foreach ($Notifications as $Type => $Notification) {
122
   if ($Type === NotificationsManager::SUBSCRIPTIONS) {
122
   if ($Type === NotificationsManager::SUBSCRIPTIONS) {
123
     $NewSubscriptions = true;
123
     $NewSubscriptions = true;
339
     </div>
339
     </div>
340
 <?
340
 <?
341
 //Start handling alert bars
341
 //Start handling alert bars
342
-$Alerts = array();
343
-$ModBar = array();
342
+$Alerts = [];
343
+$ModBar = [];
344
 
344
 
345
 // Staff blog
345
 // Staff blog
346
 if (check_perms('users_mod')) {
346
 if (check_perms('users_mod')) {

+ 1
- 1
feeds.php View File

91
   );
91
   );
92
 }
92
 }
93
 
93
 
94
-function display_array($Array, $Escape = array()) {
94
+function display_array($Array, $Escape = []) {
95
   foreach ($Array as $Key => $Val) {
95
   foreach ($Array as $Key => $Val) {
96
     if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
96
     if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
97
       $Array[$Key] = display_str($Val);
97
       $Array[$Key] = display_str($Val);

+ 2
- 2
sections/ajax/announcements.php View File

42
   $Blog = $DB->to_array();
42
   $Blog = $DB->to_array();
43
   $Cache->cache_value('blog', $Blog, 1209600);
43
   $Cache->cache_value('blog', $Blog, 1209600);
44
 }
44
 }
45
-$JsonBlog = array();
45
+$JsonBlog = [];
46
 for ($i = 0; $i < 5; $i++) {
46
 for ($i = 0; $i < 5; $i++) {
47
   list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i];
47
   list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i];
48
   $JsonBlog[] = array(
48
   $JsonBlog[] = array(
56
   );
56
   );
57
 }
57
 }
58
 
58
 
59
-$JsonAnnouncements = array();
59
+$JsonAnnouncements = [];
60
 $Count = 0;
60
 $Count = 0;
61
 foreach ($News as $NewsItem) {
61
 foreach ($News as $NewsItem) {
62
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
62
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;

+ 11
- 11
sections/ajax/artist.php View File

98
 }
98
 }
99
 
99
 
100
 // Requests
100
 // Requests
101
-$Requests = array();
101
+$Requests = [];
102
 if (empty($LoggedUser['DisableRequests'])) {
102
 if (empty($LoggedUser['DisableRequests'])) {
103
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
103
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
104
   if (!is_array($Requests)) {
104
   if (!is_array($Requests)) {
122
     if ($DB->has_results()) {
122
     if ($DB->has_results()) {
123
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
123
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
124
     } else {
124
     } else {
125
-      $Requests = array();
125
+      $Requests = [];
126
     }
126
     }
127
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
127
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
128
   }
128
   }
150
   $Importances = $DB->to_array(false, MYSQLI_BOTH, false);
150
   $Importances = $DB->to_array(false, MYSQLI_BOTH, false);
151
   $Cache->cache_value("artist_groups_$ArtistID", $Importances, 0);
151
   $Cache->cache_value("artist_groups_$ArtistID", $Importances, 0);
152
 } else {
152
 } else {
153
-  $GroupIDs = array();
153
+  $GroupIDs = [];
154
   foreach ($Importances as $Group) {
154
   foreach ($Importances as $Group) {
155
     $GroupIDs[] = $Group['GroupID'];
155
     $GroupIDs[] = $Group['GroupID'];
156
   }
156
   }
158
 if (count($GroupIDs) > 0) {
158
 if (count($GroupIDs) > 0) {
159
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
159
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
160
 } else {
160
 } else {
161
-  $TorrentList = array();
161
+  $TorrentList = [];
162
 }
162
 }
163
 $NumGroups = count($TorrentList);
163
 $NumGroups = count($TorrentList);
164
 
164
 
165
 //Get list of used release types
165
 //Get list of used release types
166
-$UsedReleases = array();
166
+$UsedReleases = [];
167
 foreach ($TorrentList as $GroupID=>$Group) {
167
 foreach ($TorrentList as $GroupID=>$Group) {
168
   if ($Importances[$GroupID]['Importance'] == '2') {
168
   if ($Importances[$GroupID]['Importance'] == '2') {
169
     $TorrentList[$GroupID]['ReleaseType'] = 1024;
169
     $TorrentList[$GroupID]['ReleaseType'] = 1024;
201
 
201
 
202
 reset($TorrentList);
202
 reset($TorrentList);
203
 
203
 
204
-$JsonTorrents = array();
205
-$Tags = array();
204
+$JsonTorrents = [];
205
+$Tags = [];
206
 $NumTorrents = $NumSeeders = $NumLeechers = $NumSnatches = 0;
206
 $NumTorrents = $NumSeeders = $NumLeechers = $NumSnatches = 0;
207
 foreach ($GroupIDs as $GroupID) {
207
 foreach ($GroupIDs as $GroupID) {
208
   if (!isset($TorrentList[$GroupID])) {
208
   if (!isset($TorrentList[$GroupID])) {
240
       $Tags[$Tag]['count']++;
240
       $Tags[$Tag]['count']++;
241
     }
241
     }
242
   }
242
   }
243
-  $InnerTorrents = array();
243
+  $InnerTorrents = [];
244
   foreach ($Torrents as $Torrent) {
244
   foreach ($Torrents as $Torrent) {
245
     $NumTorrents++;
245
     $NumTorrents++;
246
     $NumSeeders += $Torrent['Seeders'];
246
     $NumSeeders += $Torrent['Seeders'];
290
   );
290
   );
291
 }
291
 }
292
 
292
 
293
-$JsonSimilar = array();
293
+$JsonSimilar = [];
294
 if (empty($SimilarArray)) {
294
 if (empty($SimilarArray)) {
295
   $DB->query("
295
   $DB->query("
296
     SELECT
296
     SELECT
328
   }
328
   }
329
 }
329
 }
330
 
330
 
331
-$JsonRequests = array();
331
+$JsonRequests = [];
332
 foreach ($Requests as $RequestID => $Request) {
332
 foreach ($Requests as $RequestID => $Request) {
333
   $JsonRequests[] = array(
333
   $JsonRequests[] = array(
334
     'requestId' => (int)$RequestID,
334
     'requestId' => (int)$RequestID,
369
   $Key = "artist_$ArtistID";
369
   $Key = "artist_$ArtistID";
370
 }
370
 }
371
 
371
 
372
-$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist));
372
+$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, [], [], $VanityHouseArtist));
373
 
373
 
374
 $Cache->cache_value($Key, $Data, 3600);
374
 $Cache->cache_value($Key, $Data, 3600);
375
 
375
 

+ 2
- 2
sections/ajax/better/single.php View File

18
 
18
 
19
 $Groups = Torrents::get_groups(array_keys($Results));
19
 $Groups = Torrents::get_groups(array_keys($Results));
20
 
20
 
21
-$JsonResults = array();
21
+$JsonResults = [];
22
 foreach ($Results as $GroupID => $FlacID) {
22
 foreach ($Results as $GroupID => $FlacID) {
23
   if (!isset($Groups[$GroupID])) {
23
   if (!isset($Groups[$GroupID])) {
24
     continue;
24
     continue;
26
   $Group = $Groups[$GroupID];
26
   $Group = $Groups[$GroupID];
27
   extract(Torrents::array_group($Group));
27
   extract(Torrents::array_group($Group));
28
 
28
 
29
-  $JsonArtists = array();
29
+  $JsonArtists = [];
30
   if (count($Artists) > 0) {
30
   if (count($Artists) > 0) {
31
     foreach ($Artists as $Artist) {
31
     foreach ($Artists as $Artist) {
32
       $JsonArtists[] = array(
32
       $JsonArtists[] = array(

+ 6
- 6
sections/ajax/better/transcode.php View File

37
 $Results = $SphQLResult->to_array('groupid');
37
 $Results = $SphQLResult->to_array('groupid');
38
 $Groups = Torrents::get_groups(array_keys($Results));
38
 $Groups = Torrents::get_groups(array_keys($Results));
39
 
39
 
40
-$TorrentGroups = array();
40
+$TorrentGroups = [];
41
 foreach ($Groups as $GroupID => $Group) {
41
 foreach ($Groups as $GroupID => $Group) {
42
   if (empty($Group['Torrents'])) {
42
   if (empty($Group['Torrents'])) {
43
     unset($Groups[$GroupID]);
43
     unset($Groups[$GroupID]);
49
       $TorrentGroups[$Group['ID']] = array(
49
       $TorrentGroups[$Group['ID']] = array(
50
         $TorRemIdent => array(
50
         $TorRemIdent => array(
51
           'FlacID' => 0,
51
           'FlacID' => 0,
52
-          'Formats' => array(),
52
+          'Formats' => [],
53
           'RemasterTitle' => $Torrent['RemasterTitle'],
53
           'RemasterTitle' => $Torrent['RemasterTitle'],
54
           'RemasterYear' => $Torrent['RemasterYear'],
54
           'RemasterYear' => $Torrent['RemasterYear'],
55
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
55
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
60
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
60
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
61
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
61
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
62
         'FlacID' => 0,
62
         'FlacID' => 0,
63
-        'Formats' => array(),
63
+        'Formats' => [],
64
         'RemasterTitle' => $Torrent['RemasterTitle'],
64
         'RemasterTitle' => $Torrent['RemasterTitle'],
65
         'RemasterYear' => $Torrent['RemasterYear'],
65
         'RemasterYear' => $Torrent['RemasterYear'],
66
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
66
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
77
   }
77
   }
78
 }
78
 }
79
 
79
 
80
-$JsonResults = array();
80
+$JsonResults = [];
81
 foreach ($TorrentGroups as $GroupID => $Editions) {
81
 foreach ($TorrentGroups as $GroupID => $Editions) {
82
   $GroupInfo = $Groups[$GroupID];
82
   $GroupInfo = $Groups[$GroupID];
83
   $GroupYear = $GroupInfo['Year'];
83
   $GroupYear = $GroupInfo['Year'];
95
     $ArtistNames = '';
95
     $ArtistNames = '';
96
   }
96
   }
97
 
97
 
98
-  $TagList = array();
98
+  $TagList = [];
99
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
99
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
100
-  $TorrentTags = array();
100
+  $TorrentTags = [];
101
   foreach ($TagList as $Tag) {
101
   foreach ($TagList as $Tag) {
102
     $TorrentTags[] = "<a href=\"torrents.php?taglist=$Tag\">$Tag</a>";
102
     $TorrentTags[] = "<a href=\"torrents.php?taglist=$Tag\">$Tag</a>";
103
   }
103
   }

+ 1
- 1
sections/ajax/bookmarks/artists.php View File

42
 
42
 
43
 $ArtistList = $DB->to_array();
43
 $ArtistList = $DB->to_array();
44
 
44
 
45
-$JsonArtists = array();
45
+$JsonArtists = [];
46
 foreach ($ArtistList as $Artist) {
46
 foreach ($ArtistList as $Artist) {
47
   list($ArtistID, $Name) = $Artist;
47
   list($ArtistID, $Name) = $Artist;
48
   $JsonArtists[] = array(
48
   $JsonArtists[] = array(

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

27
 
27
 
28
 $Sneaky = ($UserID != $LoggedUser['ID']);
28
 $Sneaky = ($UserID != $LoggedUser['ID']);
29
 
29
 
30
-$JsonBookmarks = array();
30
+$JsonBookmarks = [];
31
 
31
 
32
 list($GroupIDs, $CollageDataList, $GroupList) = Users::get_bookmarks($UserID);
32
 list($GroupIDs, $CollageDataList, $GroupList) = Users::get_bookmarks($UserID);
33
 foreach($GroupIDs as $GroupID) {
33
 foreach($GroupIDs as $GroupID) {
35
     continue;
35
     continue;
36
   }
36
   }
37
   $Group = $GroupList[$GroupID];
37
   $Group = $GroupList[$GroupID];
38
-  $JsonTorrents = array();
38
+  $JsonTorrents = [];
39
   foreach ($Group['Torrents'] as $Torrent) {
39
   foreach ($Group['Torrents'] as $Torrent) {
40
     $JsonTorrents[] = array(
40
     $JsonTorrents[] = array(
41
       'id' => (int)$Torrent['ID'],
41
       'id' => (int)$Torrent['ID'],

+ 4
- 4
sections/ajax/browse.php View File

26
 
26
 
27
 if ($NumResults == 0) {
27
 if ($NumResults == 0) {
28
   json_die("success", array(
28
   json_die("success", array(
29
-    'results' => array()
29
+    'results' => []
30
   ));
30
   ));
31
 }
31
 }
32
 
32
 
33
 $Bookmarks = Bookmarks::all_bookmarks('torrent');
33
 $Bookmarks = Bookmarks::all_bookmarks('torrent');
34
 
34
 
35
-$JsonGroups = array();
35
+$JsonGroups = [];
36
 foreach ($Results as $Key => $GroupID) {
36
 foreach ($Results as $Key => $GroupID) {
37
   $GroupInfo = $Groups[$GroupID];
37
   $GroupInfo = $Groups[$GroupID];
38
   if (empty($GroupInfo['Torrents'])) {
38
   if (empty($GroupInfo['Torrents'])) {
59
   }
59
   }
60
 
60
 
61
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
61
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
62
-  $JsonArtists = array();
62
+  $JsonArtists = [];
63
   if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
63
   if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
64
     unset($ExtendedArtists[2]);
64
     unset($ExtendedArtists[2]);
65
     unset($ExtendedArtists[3]);
65
     unset($ExtendedArtists[3]);
75
     $DisplayName = '';
75
     $DisplayName = '';
76
   }
76
   }
77
 
77
 
78
-  $JsonTorrents = array();
78
+  $JsonTorrents = [];
79
   foreach ($Torrents as $TorrentID => $Data) {
79
   foreach ($Torrents as $TorrentID => $Data) {
80
     // All of the individual torrents in the group
80
     // All of the individual torrents in the group
81
 
81
 

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

57
 
57
 
58
 if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
58
 if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
59
   // torrent collage
59
   // torrent collage
60
-  $TorrentGroups = array();
60
+  $TorrentGroups = [];
61
   $DB->query("
61
   $DB->query("
62
     SELECT
62
     SELECT
63
       ct.GroupID
63
       ct.GroupID
73
       if ($GroupDetails['GroupCategoryID'] > 0 && $Categories[$GroupDetails['GroupCategoryID'] - 1] == 'Music') {
73
       if ($GroupDetails['GroupCategoryID'] > 0 && $Categories[$GroupDetails['GroupCategoryID'] - 1] == 'Music') {
74
         $ArtistForm = $GroupDetails['ExtendedArtists'];
74
         $ArtistForm = $GroupDetails['ExtendedArtists'];
75
         $JsonMusicInfo = array(
75
         $JsonMusicInfo = array(
76
-          'composers' => isset($ArtistForm[4]) ? pullmediainfo($ArtistForm[4]) : array(),
77
-          'dj'        => isset($ArtistForm[6]) ? pullmediainfo($ArtistForm[6]) : array(),
78
-          'artists'   => isset($ArtistForm[1]) ? pullmediainfo($ArtistForm[1]) : array(),
79
-          'with'      => isset($ArtistForm[2]) ? pullmediainfo($ArtistForm[2]) : array(),
80
-          'conductor' => isset($ArtistForm[5]) ? pullmediainfo($ArtistForm[5]) : array(),
81
-          'remixedBy' => isset($ArtistForm[3]) ? pullmediainfo($ArtistForm[3]) : array(),
82
-          'producer'  => isset($ArtistForm[7]) ? pullmediainfo($ArtistForm[7]) : array()
76
+          'composers' => isset($ArtistForm[4]) ? pullmediainfo($ArtistForm[4]) : [],
77
+          'dj'        => isset($ArtistForm[6]) ? pullmediainfo($ArtistForm[6]) : [],
78
+          'artists'   => isset($ArtistForm[1]) ? pullmediainfo($ArtistForm[1]) : [],
79
+          'with'      => isset($ArtistForm[2]) ? pullmediainfo($ArtistForm[2]) : [],
80
+          'conductor' => isset($ArtistForm[5]) ? pullmediainfo($ArtistForm[5]) : [],
81
+          'remixedBy' => isset($ArtistForm[3]) ? pullmediainfo($ArtistForm[3]) : [],
82
+          'producer'  => isset($ArtistForm[7]) ? pullmediainfo($ArtistForm[7]) : []
83
         );
83
         );
84
       } else {
84
       } else {
85
         $JsonMusicInfo = null;
85
         $JsonMusicInfo = null;
86
       }
86
       }
87
-      $TorrentList = array();
87
+      $TorrentList = [];
88
       foreach ($GroupDetails['Torrents'] as $Torrent) {
88
       foreach ($GroupDetails['Torrents'] as $Torrent) {
89
         $TorrentList[] = array(
89
         $TorrentList[] = array(
90
           'torrentid'               => (int)$Torrent['ID'],
90
           'torrentid'               => (int)$Torrent['ID'],
139
       LEFT JOIN wiki_artists AS aw ON aw.RevisionID = ag.RevisionID
139
       LEFT JOIN wiki_artists AS aw ON aw.RevisionID = ag.RevisionID
140
     WHERE ca.CollageID='$CollageID'
140
     WHERE ca.CollageID='$CollageID'
141
     ORDER BY ca.Sort");
141
     ORDER BY ca.Sort");
142
-  $Artists = array();
142
+  $Artists = [];
143
   while (list($ArtistID, $ArtistName, $ArtistImage) = $DB->next_record()) {
143
   while (list($ArtistID, $ArtistName, $ArtistImage) = $DB->next_record()) {
144
     $Artists[] = array(
144
     $Artists[] = array(
145
       'id'    => (int)$ArtistID,
145
       'id'    => (int)$ArtistID,

+ 3
- 3
sections/ajax/doujin.php View File

6
 
6
 
7
 $url = str_replace('exhentai','e-hentai',$_GET['url']);
7
 $url = str_replace('exhentai','e-hentai',$_GET['url']);
8
 
8
 
9
-$matches = array();
9
+$matches = [];
10
 preg_match('/^https?:\/\/g?\.?e.hentai\.org\/g\/(\d+)\/([\w\d]+)\/?$/', $url, $matches);
10
 preg_match('/^https?:\/\/g?\.?e.hentai\.org\/g\/(\d+)\/([\w\d]+)\/?$/', $url, $matches);
11
 
11
 
12
 $gid = $matches[1] ?? '';
12
 $gid = $matches[1] ?? '';
35
 
35
 
36
   $json = json_decode($json, true)["gmetadata"][0];
36
   $json = json_decode($json, true)["gmetadata"][0];
37
 
37
 
38
-  $artists = array();
39
-  $tags = array();
38
+  $artists = [];
39
+  $tags = [];
40
   $lang = NULL;
40
   $lang = NULL;
41
   $circle = NULL;
41
   $circle = NULL;
42
   $censored = true;
42
   $censored = true;

+ 3
- 3
sections/ajax/forum/forum.php View File

78
 }
78
 }
79
 
79
 
80
 $ForumName = display_str($Forums[$ForumID]['Name']);
80
 $ForumName = display_str($Forums[$ForumID]['Name']);
81
-$JsonSpecificRules = array();
81
+$JsonSpecificRules = [];
82
 foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
82
 foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
83
   $Thread = Forums::get_thread_info($ThreadIDs);
83
   $Thread = Forums::get_thread_info($ThreadIDs);
84
   $JsonSpecificRules[] = array(
84
   $JsonSpecificRules[] = array(
95
       array(
95
       array(
96
         'status' => 'success',
96
         'status' => 'success',
97
         'forumName' => $ForumName,
97
         'forumName' => $ForumName,
98
-        'threads' => array()
98
+        'threads' => []
99
       )
99
       )
100
     );
100
     );
101
 } else {
101
 } else {
122
   // don't have to make a database query for each topic on the page
122
   // don't have to make a database query for each topic on the page
123
   $LastRead = $DB->to_array('TopicID');
123
   $LastRead = $DB->to_array('TopicID');
124
 
124
 
125
-  $JsonTopics = array();
125
+  $JsonTopics = [];
126
   foreach ($Forum as $Topic) {
126
   foreach ($Forum as $Topic) {
127
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
127
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
128
 
128
 

+ 6
- 6
sections/ajax/forum/main.php View File

7
 }
7
 }
8
 
8
 
9
 //We have to iterate here because if one is empty it breaks the query
9
 //We have to iterate here because if one is empty it breaks the query
10
-$TopicIDs = array();
10
+$TopicIDs = [];
11
 foreach ($Forums as $Forum) {
11
 foreach ($Forums as $Forum) {
12
   if (!empty($Forum['LastPostTopicID'])) {
12
   if (!empty($Forum['LastPostTopicID'])) {
13
     $TopicIDs[] = $Forum['LastPostTopicID'];
13
     $TopicIDs[] = $Forum['LastPostTopicID'];
33
       AND l.UserID = '$LoggedUser[ID]'");
33
       AND l.UserID = '$LoggedUser[ID]'");
34
   $LastRead = $DB->to_array('TopicID', MYSQLI_ASSOC);
34
   $LastRead = $DB->to_array('TopicID', MYSQLI_ASSOC);
35
 } else {
35
 } else {
36
-  $LastRead = array();
36
+  $LastRead = [];
37
 }
37
 }
38
 
38
 
39
 $DB->query("
39
 $DB->query("
44
 $RestrictedForums = explode(',', $RestrictedForums);
44
 $RestrictedForums = explode(',', $RestrictedForums);
45
 $PermittedForums = array_keys($LoggedUser['PermittedForums']);
45
 $PermittedForums = array_keys($LoggedUser['PermittedForums']);
46
 
46
 
47
-$JsonCategories = array();
48
-$JsonCategory = array();
49
-$JsonForums = array();
47
+$JsonCategories = [];
48
+$JsonCategory = [];
49
+$JsonForums = [];
50
 foreach ($Forums as $Forum) {
50
 foreach ($Forums as $Forum) {
51
   list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
51
   list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
52
   if ($LoggedUser['CustomForums'][$ForumID] != 1
52
   if ($LoggedUser['CustomForums'][$ForumID] != 1
67
       'categoryID' => (int)$CategoryID,
67
       'categoryID' => (int)$CategoryID,
68
       'categoryName' => $ForumCats[$CategoryID]
68
       'categoryName' => $ForumCats[$CategoryID]
69
     );
69
     );
70
-    $JsonForums = array();
70
+    $JsonForums = [];
71
   }
71
   }
72
 
72
 
73
   if ((!$Locked || $Sticky)
73
   if ((!$Locked || $Sticky)

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

137
 $UserSubscriptions = Subscriptions::get_subscriptions();
137
 $UserSubscriptions = Subscriptions::get_subscriptions();
138
 
138
 
139
 if (empty($UserSubscriptions)) {
139
 if (empty($UserSubscriptions)) {
140
-  $UserSubscriptions = array();
140
+  $UserSubscriptions = [];
141
 }
141
 }
142
 
142
 
143
 if (in_array($ThreadID, $UserSubscriptions)) {
143
 if (in_array($ThreadID, $UserSubscriptions)) {
144
   $Cache->delete_value('subscriptions_user_new_'.$LoggedUser['ID']);
144
   $Cache->delete_value('subscriptions_user_new_'.$LoggedUser['ID']);
145
 }
145
 }
146
 
146
 
147
-$JsonPoll = array();
147
+$JsonPoll = [];
148
 if ($ThreadInfo['NoPoll'] == 0) {
148
 if ($ThreadInfo['NoPoll'] == 0) {
149
   if (!list($Question, $Answers, $Votes, $Featured, $Closed) = $Cache->get_value("polls_$ThreadID")) {
149
   if (!list($Question, $Answers, $Votes, $Featured, $Closed) = $Cache->get_value("polls_$ThreadID")) {
150
     $DB->query("
150
     $DB->query("
160
       GROUP BY Vote");
160
       GROUP BY Vote");
161
     $VoteArray = $DB->to_array(false, MYSQLI_NUM);
161
     $VoteArray = $DB->to_array(false, MYSQLI_NUM);
162
 
162
 
163
-    $Votes = array();
163
+    $Votes = [];
164
     foreach ($VoteArray as $VoteSet) {
164
     foreach ($VoteArray as $VoteSet) {
165
       list($Key, $Value) = $VoteSet;
165
       list($Key, $Value) = $VoteSet;
166
       $Votes[$Key] = $Value;
166
       $Votes[$Key] = $Value;
203
   $JsonPoll['question'] = $Question;
203
   $JsonPoll['question'] = $Question;
204
   $JsonPoll['maxVotes'] = (int)$MaxVotes;
204
   $JsonPoll['maxVotes'] = (int)$MaxVotes;
205
   $JsonPoll['totalVotes'] = $TotalVotes;
205
   $JsonPoll['totalVotes'] = $TotalVotes;
206
-  $JsonPollAnswers = array();
206
+  $JsonPollAnswers = [];
207
 
207
 
208
   foreach ($Answers as $i => $Answer) {
208
   foreach ($Answers as $i => $Answer) {
209
     if (!empty($Votes[$i]) && $TotalVotes > 0) {
209
     if (!empty($Votes[$i]) && $TotalVotes > 0) {
239
   }
239
   }
240
 }
240
 }
241
 
241
 
242
-$JsonPosts = array();
242
+$JsonPosts = [];
243
 foreach ($Thread as $Key => $Post) {
243
 foreach ($Thread as $Key => $Post) {
244
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime) = array_values($Post);
244
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime) = array_values($Post);
245
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
245
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));

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

1
 <?
1
 <?
2
 
2
 
3
-$Skip = array();
3
+$Skip = [];
4
 $Skip[] = db_string($_GET['skip']);
4
 $Skip[] = db_string($_GET['skip']);
5
 $NotificationsManager = new NotificationsManager($LoggedUser['ID'], $Skip);
5
 $NotificationsManager = new NotificationsManager($LoggedUser['ID'], $Skip);
6
 
6
 

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

83
 
83
 
84
 $Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
84
 $Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
85
 
85
 
86
-$JsonMessages = array();
86
+$JsonMessages = [];
87
 while (list($ConvID, $Subject, $Unread, $Sticky, $ForwardedID, $ForwardedName, $SenderID, $Username, $Donor, $Warned, $Enabled, $Avatar, $Date) = $DB->next_record()) {
87
 while (list($ConvID, $Subject, $Unread, $Sticky, $ForwardedID, $ForwardedName, $SenderID, $Username, $Donor, $Warned, $Enabled, $Avatar, $Date) = $DB->next_record()) {
88
   $JsonMessage = array(
88
   $JsonMessage = array(
89
     'convId' => (int)$ConvID,
89
     'convId' => (int)$ConvID,

+ 1
- 1
sections/ajax/inbox/viewconv.php View File

76
   WHERE ConvID = '$ConvID'
76
   WHERE ConvID = '$ConvID'
77
   ORDER BY ID");
77
   ORDER BY ID");
78
 
78
 
79
-$JsonMessages = array();
79
+$JsonMessages = [];
80
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
80
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
81
   $Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
81
   $Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
82
   $JsonMessage = array(
82
   $JsonMessage = array(

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

175
 }
175
 }
176
 
176
 
177
 function pullmediainfo($Array) {
177
 function pullmediainfo($Array) {
178
-  $NewArray = array();
178
+  $NewArray = [];
179
   foreach ($Array as $Item) {
179
   foreach ($Array as $Item) {
180
     $NewArray[] = array(
180
     $NewArray[] = array(
181
       'id' => (int)$Item['id'],
181
       'id' => (int)$Item['id'],

+ 4
- 3
sections/ajax/javfill.php View File

70
   if ($jlib_page_en && $jlib_en->query('//*[@id="video_title"]')['length']) {
70
   if ($jlib_page_en && $jlib_en->query('//*[@id="video_title"]')['length']) {
71
     $title = $jlib_en->query('//*[@id="video_title"]/h3/a')->item(0)->nodeValue;
71
     $title = $jlib_en->query('//*[@id="video_title"]/h3/a')->item(0)->nodeValue;
72
     $title = substr($title, strlen($cn) + 1);
72
     $title = substr($title, strlen($cn) + 1);
73
-    $idols = array();
73
+    $idols = [];
74
     foreach ($jlib_en->query('//*[starts-with(@id, "cast")]/span[1]/a') as $idol) {
74
     foreach ($jlib_en->query('//*[starts-with(@id, "cast")]/span[1]/a') as $idol) {
75
       $idols[] = $idol->nodeValue;
75
       $idols[] = $idol->nodeValue;
76
     }
76
     }
94
       $twist = new DOMDocument();
94
       $twist = new DOMDocument();
95
       $twist->loadHTML($twist_t);
95
       $twist->loadHTML($twist_t);
96
       $twist = new DOMXPath($twist);
96
       $twist = new DOMXPath($twist);
97
-      if ($twist->query('//img[@class="pic"]')->item(0))
97
+      if ($twist->query('//img[@class="pic"]')->item(0)) {
98
         $screens[] =  $twist->query('//img[@class="pic"]')->item(0)->getAttribute('src');
98
         $screens[] =  $twist->query('//img[@class="pic"]')->item(0)->getAttribute('src');
99
+      }
99
     }
100
     }
100
     $desc = '';
101
     $desc = '';
101
-    $genres = array();
102
+    $genres = [];
102
     foreach ($jlib_en->query('//*[starts-with(@id, "genre")]/a') as $genre) {
103
     foreach ($jlib_en->query('//*[starts-with(@id, "genre")]/a') as $genre) {
103
       $genres[] =  str_replace(' ', '.', strtolower($genre->nodeValue));
104
       $genres[] =  str_replace(' ', '.', strtolower($genre->nodeValue));
104
     }
105
     }

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

23
     LIMIT $Offset, $Count");
23
     LIMIT $Offset, $Count");
24
 $News = $DB->to_array(false, MYSQLI_NUM, false);
24
 $News = $DB->to_array(false, MYSQLI_NUM, false);
25
 
25
 
26
-$NewsResponse = array();
26
+$NewsResponse = [];
27
 foreach ($News as $NewsItem) {
27
 foreach ($News as $NewsItem) {
28
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
28
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
29
   array_push(
29
   array_push(

+ 3
- 3
sections/ajax/notifications.php View File

39
 
39
 
40
 $DB->set_query_id($Results);
40
 $DB->set_query_id($Results);
41
 
41
 
42
-$JsonNotifications = array();
42
+$JsonNotifications = [];
43
 $NumNew = 0;
43
 $NumNew = 0;
44
 
44
 
45
-$FilterGroups = array();
45
+$FilterGroups = [];
46
 while ($Result = $DB->next_record(MYSQLI_ASSOC)) {
46
 while ($Result = $DB->next_record(MYSQLI_ASSOC)) {
47
   if (!$Result['FilterID']) {
47
   if (!$Result['FilterID']) {
48
     $Result['FilterID'] = 0;
48
     $Result['FilterID'] = 0;
49
   }
49
   }
50
   if (!isset($FilterGroups[$Result['FilterID']])) {
50
   if (!isset($FilterGroups[$Result['FilterID']])) {
51
-    $FilterGroups[$Result['FilterID']] = array();
51
+    $FilterGroups[$Result['FilterID']] = [];
52
     $FilterGroups[$Result['FilterID']]['FilterLabel'] = ($Result['Label'] ? $Result['Label'] : false);
52
     $FilterGroups[$Result['FilterID']]['FilterLabel'] = ($Result['Label'] ? $Result['Label'] : false);
53
   }
53
   }
54
   array_push($FilterGroups[$Result['FilterID']], $Result);
54
   array_push($FilterGroups[$Result['FilterID']], $Result);

+ 3
- 3
sections/ajax/request.php View File

44
 $UserCanEdit = (!$IsFilled && $LoggedUser['ID'] == $Request['UserID'] && $VoteCount < 2);
44
 $UserCanEdit = (!$IsFilled && $LoggedUser['ID'] == $Request['UserID'] && $VoteCount < 2);
45
 $CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
45
 $CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
46
 
46
 
47
-$JsonTopContributors = array();
47
+$JsonTopContributors = [];
48
 $VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
48
 $VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
49
 for ($i = 0; $i < $VoteMax; $i++) {
49
 for ($i = 0; $i < $VoteMax; $i++) {
50
   $User = array_shift($RequestVotes['Voters']);
50
   $User = array_shift($RequestVotes['Voters']);
58
 
58
 
59
 list($NumComments, $Page, $Thread) = Comments::load('requests', $RequestID, false);
59
 list($NumComments, $Page, $Thread) = Comments::load('requests', $RequestID, false);
60
 
60
 
61
-$JsonRequestComments = array();
61
+$JsonRequestComments = [];
62
 foreach ($Thread as $Key => $Post) {
62
 foreach ($Thread as $Key => $Post) {
63
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
63
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
64
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
64
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
79
   );
79
   );
80
 }
80
 }
81
 
81
 
82
-$JsonTags = array();
82
+$JsonTags = [];
83
 foreach ($Request['Tags'] as $Tag) {
83
 foreach ($Request['Tags'] as $Tag) {
84
   $JsonTags[] = $Tag;
84
   $JsonTags[] = $Tag;
85
 }
85
 }

+ 8
- 8
sections/ajax/requests.php View File

107
 if (!empty($_GET['formats'])) {
107
 if (!empty($_GET['formats'])) {
108
   $FormatArray = $_GET['formats'];
108
   $FormatArray = $_GET['formats'];
109
   if (count($FormatArray) !== count($Formats)) {
109
   if (count($FormatArray) !== count($Formats)) {
110
-    $FormatNameArray = array();
110
+    $FormatNameArray = [];
111
     foreach ($FormatArray as $Index => $MasterIndex) {
111
     foreach ($FormatArray as $Index => $MasterIndex) {
112
       if (isset($Formats[$MasterIndex])) {
112
       if (isset($Formats[$MasterIndex])) {
113
         $FormatNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Formats[$MasterIndex]), '-.', '  ') . '"';
113
         $FormatNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Formats[$MasterIndex]), '-.', '  ') . '"';
127
 if (!empty($_GET['media'])) {
127
 if (!empty($_GET['media'])) {
128
   $MediaArray = $_GET['media'];
128
   $MediaArray = $_GET['media'];
129
   if (count($MediaArray) !== count($Media)) {
129
   if (count($MediaArray) !== count($Media)) {
130
-    $MediaNameArray = array();
130
+    $MediaNameArray = [];
131
     foreach ($MediaArray as $Index => $MasterIndex) {
131
     foreach ($MediaArray as $Index => $MasterIndex) {
132
       if (isset($Media[$MasterIndex])) {
132
       if (isset($Media[$MasterIndex])) {
133
         $MediaNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Media[$MasterIndex]), '-.', '  ') . '"';
133
         $MediaNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Media[$MasterIndex]), '-.', '  ') . '"';
148
 if (!empty($_GET['bitrates'])) {
148
 if (!empty($_GET['bitrates'])) {
149
   $BitrateArray = $_GET['bitrates'];
149
   $BitrateArray = $_GET['bitrates'];
150
   if (count($BitrateArray) !== count($Bitrates)) {
150
   if (count($BitrateArray) !== count($Bitrates)) {
151
-    $BitrateNameArray = array();
151
+    $BitrateNameArray = [];
152
     foreach ($BitrateArray as $Index => $MasterIndex) {
152
     foreach ($BitrateArray as $Index => $MasterIndex) {
153
       if (isset($Bitrates[$MasterIndex])) {
153
       if (isset($Bitrates[$MasterIndex])) {
154
         $BitrateNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Bitrates[$MasterIndex]), '-.', '  ') . '"';
154
         $BitrateNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Bitrates[$MasterIndex]), '-.', '  ') . '"';
169
 if (!empty($_GET['search'])) {
169
 if (!empty($_GET['search'])) {
170
   $SearchString = trim($_GET['search']);
170
   $SearchString = trim($_GET['search']);
171
   if ($SearchString !== '') {
171
   if ($SearchString !== '') {
172
-    $SearchWords = array('include' => array(), 'exclude' => array());
172
+    $SearchWords = array('include' => [], 'exclude' => []);
173
     $Words = explode(' ', $SearchString);
173
     $Words = explode(' ', $SearchString);
174
     foreach ($Words as $Word) {
174
     foreach ($Words as $Word) {
175
       $Word = trim($Word);
175
       $Word = trim($Word);
198
   $_GET['tags_type'] = '0';
198
   $_GET['tags_type'] = '0';
199
 }
199
 }
200
 if (!empty($_GET['tags'])) {
200
 if (!empty($_GET['tags'])) {
201
-  $SearchTags = array('include' => array(), 'exclude' => array());
201
+  $SearchTags = array('include' => [], 'exclude' => []);
202
   $Tags = explode(',', $_GET['tags']);
202
   $Tags = explode(',', $_GET['tags']);
203
   foreach ($Tags as $Tag) {
203
   foreach ($Tags as $Tag) {
204
     $Tag = trim($Tag);
204
     $Tag = trim($Tag);
225
 }
225
 }
226
 
226
 
227
 if (isset($SearchWords)) {
227
 if (isset($SearchWords)) {
228
-  $QueryParts = array();
228
+  $QueryParts = [];
229
   foreach ($SearchWords['include'] as $Word) {
229
   foreach ($SearchWords['include'] as $Word) {
230
     $QueryParts[] = Sphinxql::sph_escape_string($Word);
230
     $QueryParts[] = Sphinxql::sph_escape_string($Word);
231
   }
231
   }
311
   json_die("success", array(
311
   json_die("success", array(
312
     'currentPage' => 1,
312
     'currentPage' => 1,
313
     'pages'       => 1,
313
     'pages'       => 1,
314
-    'results'     => array()
314
+    'results'     => []
315
   ));
315
   ));
316
 } else {
316
 } else {
317
-  $JsonResults = array();
317
+  $JsonResults = [];
318
   $Requests = Requests::get_requests(array_keys($SphRequests));
318
   $Requests = Requests::get_requests(array_keys($SphRequests));
319
   foreach ($SphRequests as $RequestID => $SphRequest) {
319
   foreach ($SphRequests as $RequestID => $SphRequest) {
320
     $Request = $Requests[$RequestID];
320
     $Request = $Requests[$RequestID];

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

71
   $DB->query($sql);
71
   $DB->query($sql);
72
 }
72
 }
73
 
73
 
74
-$JsonPosts = array();
74
+$JsonPosts = [];
75
 while (list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()) {
75
 while (list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()) {
76
   $JsonPost = array(
76
   $JsonPost = array(
77
     'forumId' => (int)$ForumID,
77
     'forumId' => (int)$ForumID,

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

6
 list($NumComments, $Page, $Thread) = Comments::load('torrents', (int)$_GET['id'], false);
6
 list($NumComments, $Page, $Thread) = Comments::load('torrents', (int)$_GET['id'], false);
7
 
7
 
8
 //---------- Begin printing
8
 //---------- Begin printing
9
-$JsonComments = array();
9
+$JsonComments = [];
10
 foreach ($Thread as $Key => $Post) {
10
 foreach ($Thread as $Key => $Post) {
11
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
11
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
12
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
12
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));

+ 2
- 2
sections/ajax/top10/tags.php View File

16
 // defaults to 10 (duh)
16
 // defaults to 10 (duh)
17
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
17
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
18
 $Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
18
 $Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
19
-$OuterResults = array();
19
+$OuterResults = [];
20
 
20
 
21
 if ($Details == 'all' || $Details == 'ut') {
21
 if ($Details == 'all' || $Details == 'ut') {
22
   if (!$TopUsedTags = $Cache->get_value("topusedtag_$Limit")) {
22
   if (!$TopUsedTags = $Cache->get_value("topusedtag_$Limit")) {
89
   );
89
   );
90
 
90
 
91
 function generate_tag_json($Caption, $Tag, $Details, $Limit) {
91
 function generate_tag_json($Caption, $Tag, $Details, $Limit) {
92
-  $results = array();
92
+  $results = [];
93
   foreach ($Details as $Detail) {
93
   foreach ($Details as $Detail) {
94
     $results[] = array(
94
     $results[] = array(
95
       'name' => $Detail['Name'],
95
       'name' => $Detail['Name'],

+ 3
- 3
sections/ajax/top10/torrents.php View File

34
   FROM torrents AS t
34
   FROM torrents AS t
35
     LEFT JOIN torrents_group AS g ON g.ID = t.GroupID';
35
     LEFT JOIN torrents_group AS g ON g.ID = t.GroupID';
36
 
36
 
37
-$OuterResults = array();
37
+$OuterResults = [];
38
 
38
 
39
 if ($Details == 'all' || $Details == 'day') {
39
 if ($Details == 'all' || $Details == 'day') {
40
   if (!$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum)) {
40
   if (!$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum)) {
126
 
126
 
127
 function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
127
 function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
128
   global $LoggedUser, $Categories;
128
   global $LoggedUser, $Categories;
129
-  $results = array();
129
+  $results = [];
130
   foreach ($Details as $Detail) {
130
   foreach ($Details as $Detail) {
131
     list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TorrentTags,
131
     list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TorrentTags,
132
       $Media, $GroupYear,
132
       $Media, $GroupYear,
134
 
134
 
135
     $Artist = Artists::display_artists(Artists::get_artist($GroupID), false, false);
135
     $Artist = Artists::display_artists(Artists::get_artist($GroupID), false, false);
136
 
136
 
137
-    $TagList = array();
137
+    $TagList = [];
138
 
138
 
139
     if ($TorrentTags != '') {
139
     if ($TorrentTags != '') {
140
       $TorrentTags = explode(' ', $TorrentTags);
140
       $TorrentTags = explode(' ', $TorrentTags);

+ 2
- 2
sections/ajax/top10/users.php View File

33
     AND (Paranoia IS NULL OR (Paranoia NOT LIKE '%\"uploaded\"%' AND Paranoia NOT LIKE '%\"downloaded\"%'))
33
     AND (Paranoia IS NULL OR (Paranoia NOT LIKE '%\"uploaded\"%' AND Paranoia NOT LIKE '%\"downloaded\"%'))
34
   GROUP BY u.ID";
34
   GROUP BY u.ID";
35
 
35
 
36
-$OuterResults = array();
36
+$OuterResults = [];
37
 
37
 
38
 if ($Details == 'all' || $Details == 'ul') {
38
 if ($Details == 'all' || $Details == 'ul') {
39
   if (!$TopUserUploads = $Cache->get_value("topuser_ul_$Limit")) {
39
   if (!$TopUserUploads = $Cache->get_value("topuser_ul_$Limit")) {
104
   );
104
   );
105
 
105
 
106
 function generate_user_json($Caption, $Tag, $Details, $Limit) {
106
 function generate_user_json($Caption, $Tag, $Details, $Limit) {
107
-  $results = array();
107
+  $results = [];
108
   foreach ($Details as $Detail) {
108
   foreach ($Details as $Detail) {
109
     $results[] = array(
109
     $results[] = array(
110
       'id' => (int)$Detail['ID'],
110
       'id' => (int)$Detail['ID'],

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

64
   'tags'            => $TagList
64
   'tags'            => $TagList
65
 );
65
 );
66
 
66
 
67
-$JsonTorrentList = array();
67
+$JsonTorrentList = [];
68
 foreach ($TorrentList as $Torrent) {
68
 foreach ($TorrentList as $Torrent) {
69
   // Convert file list back to the old format
69
   // Convert file list back to the old format
70
   $FileList = explode("\n", $Torrent['FileList']);
70
   $FileList = explode("\n", $Torrent['FileList']);

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

53
 
53
 
54
 $Paranoia = unserialize($Paranoia);
54
 $Paranoia = unserialize($Paranoia);
55
 if (!is_array($Paranoia)) {
55
 if (!is_array($Paranoia)) {
56
-  $Paranoia = array();
56
+  $Paranoia = [];
57
 }
57
 }
58
 $ParanoiaLevel = 0;
58
 $ParanoiaLevel = 0;
59
 foreach ($Paranoia as $P) {
59
 foreach ($Paranoia as $P) {

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

8
 if (empty($Limit)) {
8
 if (empty($Limit)) {
9
   $Limit = 15;
9
   $Limit = 15;
10
 }
10
 }
11
-$Results = array();
11
+$Results = [];
12
 if (check_paranoia_here('snatched')) {
12
 if (check_paranoia_here('snatched')) {
13
   $DB->query("
13
   $DB->query("
14
     SELECT
14
     SELECT

+ 1
- 1
sections/ajax/userhistory/post_history.php View File

154
   $DB->set_query_id($Posts);
154
   $DB->set_query_id($Posts);
155
 }
155
 }
156
 
156
 
157
-$JsonResults = array();
157
+$JsonResults = [];
158
 while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) {
158
 while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) {
159
   $JsonResults[] = array(
159
   $JsonResults[] = array(
160
     'postId' => (int)$PostID,
160
     'postId' => (int)$PostID,

+ 5
- 5
sections/artist/artist.php View File

68
 ob_start();
68
 ob_start();
69
 
69
 
70
 // Requests
70
 // Requests
71
-$Requests = array();
71
+$Requests = [];
72
 if (empty($LoggedUser['DisableRequests'])) {
72
 if (empty($LoggedUser['DisableRequests'])) {
73
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
73
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
74
   if (!is_array($Requests)) {
74
   if (!is_array($Requests)) {
95
     if ($DB->has_results()) {
95
     if ($DB->has_results()) {
96
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
96
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
97
     } else {
97
     } else {
98
-      $Requests = array();
98
+      $Requests = [];
99
     }
99
     }
100
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
100
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
101
   }
101
   }
116
 if (count($GroupIDs) > 0) {
116
 if (count($GroupIDs) > 0) {
117
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
117
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
118
 } else {
118
 } else {
119
-  $TorrentList = array();
119
+  $TorrentList = [];
120
 }
120
 }
121
 $NumGroups = count($TorrentList);
121
 $NumGroups = count($TorrentList);
122
 
122
 
739
       }
739
       }
740
 
740
 
741
       if (!empty($Tags[$RequestID])) {
741
       if (!empty($Tags[$RequestID])) {
742
-        $ReqTagList = array();
742
+        $ReqTagList = [];
743
         foreach ($Tags[$RequestID] as $TagID => $TagName) {
743
         foreach ($Tags[$RequestID] as $TagID => $TagName) {
744
           $ReqTagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
744
           $ReqTagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
745
         }
745
         }
911
   $Key = "artist_$ArtistID";
911
   $Key = "artist_$ArtistID";
912
 }
912
 }
913
 
913
 
914
-$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist));
914
+$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, [], [], $VanityHouseArtist));
915
 
915
 
916
 $Cache->cache_value($Key, $Data, 3600);
916
 $Cache->cache_value($Key, $Data, 3600);
917
 ?>
917
 ?>

+ 2
- 2
sections/artist/autocomplete.php View File

33
 }
33
 }
34
 
34
 
35
 $Matched = 0;
35
 $Matched = 0;
36
-$ArtistIDs = array();
36
+$ArtistIDs = [];
37
 $Response = array(
37
 $Response = array(
38
   'query' => $FullName,
38
   'query' => $FullName,
39
-  'suggestions' => array()
39
+  'suggestions' => []
40
 );
40
 );
41
 foreach ($AutoSuggest as $Suggestion) {
41
 foreach ($AutoSuggest as $Suggestion) {
42
   list($ID, $Name) = $Suggestion;
42
   list($ID, $Name) = $Suggestion;

+ 4
- 4
sections/better/snatch.php View File

71
 }
71
 }
72
 
72
 
73
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
73
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
74
-$TorrentGroups = array();
74
+$TorrentGroups = [];
75
 foreach ($Groups as $GroupID => $Group) {
75
 foreach ($Groups as $GroupID => $Group) {
76
   if (empty($Group['Torrents'])) {
76
   if (empty($Group['Torrents'])) {
77
     unset($Groups[$GroupID]);
77
     unset($Groups[$GroupID]);
83
       $TorrentGroups[$Group['ID']] = array(
83
       $TorrentGroups[$Group['ID']] = array(
84
         $TorRemIdent => array(
84
         $TorRemIdent => array(
85
           'FlacID' => 0,
85
           'FlacID' => 0,
86
-          'Formats' => array(),
86
+          'Formats' => [],
87
           'IsSnatched' => $Torrent['IsSnatched'],
87
           'IsSnatched' => $Torrent['IsSnatched'],
88
           'Medium' => $Torrent['Media'],
88
           'Medium' => $Torrent['Media'],
89
           'RemasterTitle' => $Torrent['RemasterTitle'],
89
           'RemasterTitle' => $Torrent['RemasterTitle'],
95
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
95
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
96
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
96
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
97
         'FlacID' => 0,
97
         'FlacID' => 0,
98
-        'Formats' => array(),
98
+        'Formats' => [],
99
         'IsSnatched' => $Torrent['IsSnatched'],
99
         'IsSnatched' => $Torrent['IsSnatched'],
100
         'Medium' => $Torrent['Media'],
100
         'Medium' => $Torrent['Media'],
101
         'RemasterTitle' => $Torrent['RemasterTitle'],
101
         'RemasterTitle' => $Torrent['RemasterTitle'],
194
     }
194
     }
195
     $DisplayName .= ' ['.$Edition['Medium'].']';
195
     $DisplayName .= ' ['.$Edition['Medium'].']';
196
 
196
 
197
-    $EditionInfo = array();
197
+    $EditionInfo = [];
198
     if (!empty($Edition['RemasterYear'])) {
198
     if (!empty($Edition['RemasterYear'])) {
199
       $ExtraInfo = $Edition['RemasterYear'];
199
       $ExtraInfo = $Edition['RemasterYear'];
200
     } else {
200
     } else {

+ 4
- 4
sections/better/transcode.php View File

36
 
36
 
37
 $Results = $SphQLResult->to_array('groupid');
37
 $Results = $SphQLResult->to_array('groupid');
38
 $Groups = Torrents::get_groups(array_keys($Results));
38
 $Groups = Torrents::get_groups(array_keys($Results));
39
-$TorrentGroups = array();
39
+$TorrentGroups = [];
40
 foreach ($Groups as $GroupID => $Group) {
40
 foreach ($Groups as $GroupID => $Group) {
41
   if (empty($Group['Torrents'])) {
41
   if (empty($Group['Torrents'])) {
42
     unset($Groups[$GroupID]);
42
     unset($Groups[$GroupID]);
48
       $TorrentGroups[$Group['ID']] = array(
48
       $TorrentGroups[$Group['ID']] = array(
49
         $TorRemIdent => array(
49
         $TorRemIdent => array(
50
           'FlacID' => 0,
50
           'FlacID' => 0,
51
-          'Formats' => array(),
51
+          'Formats' => [],
52
           'RemasterTitle' => $Torrent['RemasterTitle'],
52
           'RemasterTitle' => $Torrent['RemasterTitle'],
53
           'RemasterYear' => $Torrent['RemasterYear'],
53
           'RemasterYear' => $Torrent['RemasterYear'],
54
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
54
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
59
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
59
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
60
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
60
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
61
         'FlacID' => 0,
61
         'FlacID' => 0,
62
-        'Formats' => array(),
62
+        'Formats' => [],
63
         'RemasterTitle' => $Torrent['RemasterTitle'],
63
         'RemasterTitle' => $Torrent['RemasterTitle'],
64
         'RemasterYear' => $Torrent['RemasterYear'],
64
         'RemasterYear' => $Torrent['RemasterYear'],
65
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
65
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
142
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
142
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
143
     }
143
     }
144
 
144
 
145
-    $EditionInfo = array();
145
+    $EditionInfo = [];
146
     if (!empty($Edition['RemasterYear'])) {
146
     if (!empty($Edition['RemasterYear'])) {
147
       $ExtraInfo = $Edition['RemasterYear'];
147
       $ExtraInfo = $Edition['RemasterYear'];
148
     } else {
148
     } else {

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

53
 }
53
 }
54
 
54
 
55
 function transcode_parse_groups($Groups) {
55
 function transcode_parse_groups($Groups) {
56
-  $TorrentGroups = array();
56
+  $TorrentGroups = [];
57
   foreach ($Groups as $GroupID => $Group) {
57
   foreach ($Groups as $GroupID => $Group) {
58
     if (empty($Group['Torrents'])) {
58
     if (empty($Group['Torrents'])) {
59
       continue;
59
       continue;
67
           'Name' => $Group['Name'],
67
           'Name' => $Group['Name'],
68
           'ReleaseType' => $Group['ReleaseType'],
68
           'ReleaseType' => $Group['ReleaseType'],
69
           'TagList' => $Group['TagList'],
69
           'TagList' => $Group['TagList'],
70
-          'Editions' => array()
70
+          'Editions' => []
71
         );
71
         );
72
       }
72
       }
73
       if (!isset($TorrentGroups[$GroupID]['Editions'][$RemIdent])) {
73
       if (!isset($TorrentGroups[$GroupID]['Editions'][$RemIdent])) {
105
           $EditionName .= $AddExtra.display_str($Torrent['Media']);
105
           $EditionName .= $AddExtra.display_str($Torrent['Media']);
106
         }
106
         }
107
         $TorrentGroups[$GroupID]['Editions'][$RemIdent] = array(
107
         $TorrentGroups[$GroupID]['Editions'][$RemIdent] = array(
108
-          'FlacIDs' => array(),
109
-          'MP3s' => array(),
108
+          'FlacIDs' => [],
109
+          'MP3s' => [],
110
           'Media' => $Torrent['Media'],
110
           'Media' => $Torrent['Media'],
111
           'EditionName' => $EditionName,
111
           'EditionName' => $EditionName,
112
           'FLACIsSnatched' => false
112
           'FLACIsSnatched' => false
125
   return $TorrentGroups;
125
   return $TorrentGroups;
126
 }
126
 }
127
 
127
 
128
-$Groups = array();
128
+$Groups = [];
129
 $ResultCount = 0;
129
 $ResultCount = 0;
130
 if (in_array($_GET['filter'], array('all', 'uploaded'))) {
130
 if (in_array($_GET['filter'], array('all', 'uploaded'))) {
131
   $SphQL = transcode_init_sphql();
131
   $SphQL = transcode_init_sphql();

+ 4
- 4
sections/better/upload.php View File

59
 }
59
 }
60
 
60
 
61
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
61
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
62
-$TorrentGroups = array();
62
+$TorrentGroups = [];
63
 foreach ($Groups as $GroupID => $Group) {
63
 foreach ($Groups as $GroupID => $Group) {
64
   if (empty($Group['Torrents'])) {
64
   if (empty($Group['Torrents'])) {
65
     unset($Groups[$GroupID]);
65
     unset($Groups[$GroupID]);
71
       $TorrentGroups[$Group['ID']] = array(
71
       $TorrentGroups[$Group['ID']] = array(
72
         $TorRemIdent => array(
72
         $TorRemIdent => array(
73
           'FlacID' => 0,
73
           'FlacID' => 0,
74
-          'Formats' => array(),
74
+          'Formats' => [],
75
           'IsSnatched' => $Torrent['IsSnatched'],
75
           'IsSnatched' => $Torrent['IsSnatched'],
76
           'Medium' => $Torrent['Media'],
76
           'Medium' => $Torrent['Media'],
77
           'RemasterTitle' => $Torrent['RemasterTitle'],
77
           'RemasterTitle' => $Torrent['RemasterTitle'],
83
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
83
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
84
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
84
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
85
         'FlacID' => 0,
85
         'FlacID' => 0,
86
-        'Formats' => array(),
86
+        'Formats' => [],
87
         'IsSnatched' => $Torrent['IsSnatched'],
87
         'IsSnatched' => $Torrent['IsSnatched'],
88
         'Medium' => $Torrent['Media'],
88
         'Medium' => $Torrent['Media'],
89
         'RemasterTitle' => $Torrent['RemasterTitle'],
89
         'RemasterTitle' => $Torrent['RemasterTitle'],
173
     }
173
     }
174
     $DisplayName .= ' ['.$Edition['Medium'].']';
174
     $DisplayName .= ' ['.$Edition['Medium'].']';
175
 
175
 
176
-    $EditionInfo = array();
176
+    $EditionInfo = [];
177
     if (!empty($Edition['RemasterYear'])) {
177
     if (!empty($Edition['RemasterYear'])) {
178
       $ExtraInfo = $Edition['RemasterYear'];
178
       $ExtraInfo = $Edition['RemasterYear'];
179
     } else {
179
     } else {

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

30
 
30
 
31
 // Loop through the result set, building up $Collage and $TorrentTable
31
 // Loop through the result set, building up $Collage and $TorrentTable
32
 // Then we print them.
32
 // Then we print them.
33
-$Collage = array();
33
+$Collage = [];
34
 $TorrentTable = '';
34
 $TorrentTable = '';
35
 
35
 
36
 $NumGroups = 0;
36
 $NumGroups = 0;
37
-$ArtistCount = array();
37
+$ArtistCount = [];
38
 
38
 
39
 list($GroupIDs, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
39
 list($GroupIDs, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
40
 foreach ($GroupIDs as $GroupID) {
40
 foreach ($GroupIDs as $GroupID) {
269
 }
269
 }
270
 
270
 
271
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? (int)$LoggedUser['CollageCovers'] : 10;
271
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? (int)$LoggedUser['CollageCovers'] : 10;
272
-$CollagePages = array();
272
+$CollagePages = [];
273
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
273
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
274
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
274
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
275
   $CollagePage = '';
275
   $CollagePage = '';

+ 2
- 2
sections/collages/add_artist.php View File

114
   add_artist($CollageID, $ArtistID);
114
   add_artist($CollageID, $ArtistID);
115
 } else {
115
 } else {
116
   $URLs = explode("\n", $_REQUEST['urls']);
116
   $URLs = explode("\n", $_REQUEST['urls']);
117
-  $ArtistIDs = array();
117
+  $ArtistIDs = [];
118
   $Err = '';
118
   $Err = '';
119
   foreach ($URLs as $Key => &$URL) {
119
   foreach ($URLs as $Key => &$URL) {
120
     $URL = trim($URL);
120
     $URL = trim($URL);
134
   }
134
   }
135
 
135
 
136
   foreach ($URLs as $URL) {
136
   foreach ($URLs as $URL) {
137
-    $Matches = array();
137
+    $Matches = [];
138
     if (preg_match('/^'.ARTIST_REGEX.'/i', $URL, $Matches)) {
138
     if (preg_match('/^'.ARTIST_REGEX.'/i', $URL, $Matches)) {
139
       $ArtistIDs[] = $Matches[4];
139
       $ArtistIDs[] = $Matches[4];
140
       $ArtistID = $Matches[4];
140
       $ArtistID = $Matches[4];

+ 2
- 2
sections/collages/add_torrent.php View File

114
   add_torrent($CollageID, $GroupID);
114
   add_torrent($CollageID, $GroupID);
115
 } else {
115
 } else {
116
   $URLs = explode("\n", $_REQUEST['urls']);
116
   $URLs = explode("\n", $_REQUEST['urls']);
117
-  $GroupIDs = array();
117
+  $GroupIDs = [];
118
   $Err = '';
118
   $Err = '';
119
   foreach ($URLs as $Key => &$URL) {
119
   foreach ($URLs as $Key => &$URL) {
120
     $URL = trim($URL);
120
     $URL = trim($URL);
134
   }
134
   }
135
 
135
 
136
   foreach ($URLs as $URL) {
136
   foreach ($URLs as $URL) {
137
-    $Matches = array();
137
+    $Matches = [];
138
     if (preg_match('/^'.TORRENT_GROUP_REGEX.'/i', $URL, $Matches)) {
138
     if (preg_match('/^'.TORRENT_GROUP_REGEX.'/i', $URL, $Matches)) {
139
       $GroupIDs[] = $Matches[4];
139
       $GroupIDs[] = $Matches[4];
140
       $GroupID = $Matches[4];
140
       $GroupID = $Matches[4];

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

16
 
16
 
17
 // Loop through the result set, building up $Collage and $TorrentTable
17
 // Loop through the result set, building up $Collage and $TorrentTable
18
 // Then we print them.
18
 // Then we print them.
19
-$Collage = array();
19
+$Collage = [];
20
 $ArtistTable = '';
20
 $ArtistTable = '';
21
 
21
 
22
 $NumGroups = count($Artists);
22
 $NumGroups = count($Artists);
23
 $NumGroupsByUser = 0;
23
 $NumGroupsByUser = 0;
24
-$UserAdditions = array();
24
+$UserAdditions = [];
25
 
25
 
26
 foreach ($Artists as $Artist) {
26
 foreach ($Artists as $Artist) {
27
   $UserID = $Artist['UserID'];
27
   $UserID = $Artist['UserID'];
64
 
64
 
65
 // Silly hack for people who are on the old setting
65
 // Silly hack for people who are on the old setting
66
 $CollageCovers = (isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1)));
66
 $CollageCovers = (isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1)));
67
-$CollagePages = array();
67
+$CollagePages = [];
68
 
68
 
69
 // Pad it out
69
 // Pad it out
70
 if ($NumGroups > $CollageCovers) {
70
 if ($NumGroups > $CollageCovers) {

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

35
 if (count($GroupIDs) > 0) {
35
 if (count($GroupIDs) > 0) {
36
   $TorrentList = Torrents::get_groups($GroupIDs);
36
   $TorrentList = Torrents::get_groups($GroupIDs);
37
 } else {
37
 } else {
38
-  $TorrentList = array();
38
+  $TorrentList = [];
39
 }
39
 }
40
 
40
 
41
 View::show_header("Manage collection: $Name", 'jquery-ui,jquery.tablesorter,sort');
41
 View::show_header("Manage collection: $Name", 'jquery-ui,jquery.tablesorter,sort');

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

41
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
41
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
42
   $Series = @array_shift($Series);
42
   $Series = @array_shift($Series);
43
   if (is_array($Series)) {
43
   if (is_array($Series)) {
44
-    $SQL = array();
44
+    $SQL = [];
45
     foreach ($Series as $Sort => $ArtistID) {
45
     foreach ($Series as $Sort => $ArtistID) {
46
       if (is_number($Sort) && is_number($ArtistID)) {
46
       if (is_number($Sort) && is_number($ArtistID)) {
47
         $Sort = ($Sort + 1) * 10;
47
         $Sort = ($Sort + 1) * 10;

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

40
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
40
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
41
   $Series = @array_shift($Series);
41
   $Series = @array_shift($Series);
42
   if (is_array($Series)) {
42
   if (is_array($Series)) {
43
-    $SQL = array();
43
+    $SQL = [];
44
     foreach ($Series as $Sort => $GroupID) {
44
     foreach ($Series as $Sort => $GroupID) {
45
       if (is_number($Sort) && is_number($GroupID)) {
45
       if (is_number($Sort) && is_number($GroupID)) {
46
         $Sort = ($Sort + 1) * 10;
46
         $Sort = ($Sort + 1) * 10;

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

4
 include(SERVER_ROOT.'/classes/validate.class.php');
4
 include(SERVER_ROOT.'/classes/validate.class.php');
5
 $Val = new VALIDATE;
5
 $Val = new VALIDATE;
6
 
6
 
7
-$P = array();
7
+$P = [];
8
 $P = db_array($_POST);
8
 $P = db_array($_POST);
9
 
9
 
10
 if ($P['category'] > 0 || check_perms('site_collages_renamepersonal')) {
10
 if ($P['category'] > 0 || check_perms('site_collages_renamepersonal')) {

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

20
   $TorrentList = Torrents::get_groups($GroupIDs);
20
   $TorrentList = Torrents::get_groups($GroupIDs);
21
   $UserVotes = Votes::get_user_votes($LoggedUser['ID']);
21
   $UserVotes = Votes::get_user_votes($LoggedUser['ID']);
22
 } else {
22
 } else {
23
-  $TorrentList = array();
23
+  $TorrentList = [];
24
 }
24
 }
25
 
25
 
26
 // Loop through the result set, building up $Collage and $TorrentTable
26
 // Loop through the result set, building up $Collage and $TorrentTable
27
 // Then we print them.
27
 // Then we print them.
28
-$Collage = array();
28
+$Collage = [];
29
 $TorrentTable = '';
29
 $TorrentTable = '';
30
 
30
 
31
 $NumGroups = count($TorrentList);
31
 $NumGroups = count($TorrentList);
32
 $NumGroupsByUser = 0;
32
 $NumGroupsByUser = 0;
33
-$TopArtists = array();
34
-$UserAdditions = array();
33
+$TopArtists = [];
34
+$UserAdditions = [];
35
 $Number = 0;
35
 $Number = 0;
36
 
36
 
37
 foreach ($GroupIDs as $GroupID) {
37
 foreach ($GroupIDs as $GroupID) {
272
 
272
 
273
 // Silly hack for people who are on the old setting
273
 // Silly hack for people who are on the old setting
274
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1));
274
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1));
275
-$CollagePages = array();
275
+$CollagePages = [];
276
 
276
 
277
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
277
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
278
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
278
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);

+ 3
- 3
sections/comments/comments.php View File

56
 }
56
 }
57
 
57
 
58
 // Construct the SQL query
58
 // Construct the SQL query
59
-$Conditions = $Join = array();
59
+$Conditions = $Join = [];
60
 switch ($Action) {
60
 switch ($Action) {
61
   case 'artist':
61
   case 'artist':
62
     $Field1 = 'artists_group.ArtistID';
62
     $Field1 = 'artists_group.ArtistID';
167
 $DB->set_query_id($Comments);
167
 $DB->set_query_id($Comments);
168
 if ($Action == 'requests') {
168
 if ($Action == 'requests') {
169
   $RequestIDs = array_flip(array_flip($DB->collect('PageID')));
169
   $RequestIDs = array_flip(array_flip($DB->collect('PageID')));
170
-  $Artists = array();
170
+  $Artists = [];
171
   foreach ($RequestIDs as $RequestID) {
171
   foreach ($RequestIDs as $RequestID) {
172
     $Artists[$RequestID] = Requests::get_artists($RequestID);
172
     $Artists[$RequestID] = Requests::get_artists($RequestID);
173
   }
173
   }
179
 }
179
 }
180
 
180
 
181
 $LinkID = (!$Self ? '&amp;id=' . $UserID : '');
181
 $LinkID = (!$Self ? '&amp;id=' . $UserID : '');
182
-$ActionLinks = $TypeLinks = array();
182
+$ActionLinks = $TypeLinks = [];
183
 if ($Action != 'artist') {
183
 if ($Action != 'artist') {
184
   $ActionLinks[] = '<a href="comments.php?action=artist' . $LinkID . '" class="brackets">Artist comments</a>';
184
   $ActionLinks[] = '<a href="comments.php?action=artist' . $LinkID . '" class="brackets">Artist comments</a>';
185
 }
185
 }

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

198
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
198
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
199
     // Build list of page links
199
     // Build list of page links
200
     // Only do this if there is more than one page
200
     // Only do this if there is more than one page
201
-    $PageLinks = array();
201
+    $PageLinks = [];
202
     $ShownEllipses = false;
202
     $ShownEllipses = false;
203
     $PagesText = '';
203
     $PagesText = '';
204
     $TopicPages = ceil($PostCount / $PerPage);
204
     $TopicPages = ceil($PostCount / $PerPage);

+ 0
- 0
sections/forums/poll_mod.php View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save