Test Failed
Push — trunk ( e02d87...314b8c )
by SuperNova.WS
07:20
created
admin/admin_analyze_matter.php 1 patch
Spacing   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 $constants = get_defined_constants(true);
17 17
 $rpgConstants = array();
18
-foreach($constants['user'] as $constantName => $constantValue) {
19
-  if(substr($constantName, 0, 4) == 'RPG_') {
18
+foreach ($constants['user'] as $constantName => $constantValue) {
19
+  if (substr($constantName, 0, 4) == 'RPG_') {
20 20
     $rpgConstants[$constantValue] = $constantName;
21 21
   }
22 22
 }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
   GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC;"
35 35
 );
36 36
 
37
-while($row = SN::$db->db_fetch($result)) {
37
+while ($row = SN::$db->db_fetch($result)) {
38 38
   $row['CONSTANT'] = $rpgConstants[$row['REASON']];
39 39
 
40 40
   $row['DM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['DM_AMOUNT']);
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
   GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC;"
58 58
 );
59 59
 
60
-while($row = SN::$db->db_fetch($result)) {
61
-  if(empty($spent[$row['BALANCE']])) {
60
+while ($row = SN::$db->db_fetch($result)) {
61
+  if (empty($spent[$row['BALANCE']])) {
62 62
     $spent[$row['BALANCE']] = array();
63 63
   }
64 64
 
@@ -68,16 +68,15 @@  discard block
 block discarded – undo
68 68
   $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row);
69 69
 }
70 70
 
71
-foreach($spent as &$row) {
71
+foreach ($spent as &$row) {
72 72
   @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT'];
73 73
   @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT'];
74 74
   @$row['TOTAL_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_AMOUNT']);
75 75
   @$row['TOTAL_COUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_COUNT']);
76 76
 }
77 77
 
78
-usort($spent, function ($a, $b) {
79
-  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 :
80
-    ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
78
+usort($spent, function($a, $b) {
79
+  return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0);
81 80
 });
82 81
 
83 82
 
Please login to merge, or discard this patch.
admin/admin_user_activity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
         $length          = 0;
74 74
       } else {
75 75
         $spendOnThisHour = $leftOfThisHour;
76
-        $length          -= $leftOfThisHour;
76
+        $length -= $leftOfThisHour;
77 77
       }
78 78
       $perHour[$hourStart] += $spendOnThisHour;
79 79
 
Please login to merge, or discard this patch.
classes/RequestInfo.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,15 +120,15 @@
 block discarded – undo
120 120
     sn_db_transaction_commit();
121 121
 
122 122
     $this->user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
123
-    $this->browser_id = db_get_set_unique_id_value('security_browser', 'browser_id', ['browser_user_agent' => $this->user_agent,]);
123
+    $this->browser_id = db_get_set_unique_id_value('security_browser', 'browser_id', ['browser_user_agent' => $this->user_agent, ]);
124 124
 
125 125
     $this->page_address    = substr($_SERVER['PHP_SELF'], strlen(SN_ROOT_RELATIVE));
126
-    $this->page_address_id = db_get_set_unique_id_value('security_url', 'url_id', ['url_string' => $this->page_address,]);
126
+    $this->page_address_id = db_get_set_unique_id_value('security_url', 'url_id', ['url_string' => $this->page_address, ]);
127 127
 
128 128
     // Not a simulator - because it can have loooooong string
129 129
     if (strpos($_SERVER['REQUEST_URI'], '/simulator.php') !== 0 && !$skip_log_query) {
130 130
       $this->queryString = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
131
-      $this->queryStringId = db_get_set_unique_id_value('security_query_strings', 'id', ['query_string' => $this->queryString,]);
131
+      $this->queryStringId = db_get_set_unique_id_value('security_query_strings', 'id', ['query_string' => $this->queryString, ]);
132 132
     }
133 133
 
134 134
     $ip                      = sec_player_ip();
Please login to merge, or discard this patch.
classes/General/Helpers/PagingRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
       $this->addFirstLast();
116 116
     }
117 117
 
118
-    if(!empty($this->result)) {
118
+    if (!empty($this->result)) {
119 119
       $template = SnTemplate::gettemplate('_paging');
120 120
       $template->assign_recursive([
121 121
         'PAGING_ROOT' => $this->rootUrl,
Please login to merge, or discard this patch.
classes/Unit/DBStaticUnit.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
   }
41 41
 
42 42
   public static function db_unit_count_by_user_and_type_and_snid($user_id, $unit_type = 0, $unit_snid = 0) {
43
-    $query  = doquery(
43
+    $query = doquery(
44 44
       "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} " .
45 45
       ($unit_type ? "AND `unit_type` = {$unit_type} " : '') .
46 46
       ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '') .
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
    * @return bool
190 190
    */
191 191
   protected static function dbAdd($playerId, $planetId, $unitSnId, $amount) {
192
-    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR,]))) {
192
+    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR, ]))) {
193 193
       return false;
194 194
     }
195 195
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 //        'unit_level'         => $level,
223 223
 //      ]);
224 224
 
225
-      $fields     += [
225
+      $fields += [
226 226
         'unit_type'  => get_unit_param($unitSnId, P_UNIT_TYPE),
227 227
         'unit_level' => $amount,
228 228
       ];
Please login to merge, or discard this patch.
classes/Pages/Deprecated/PageAdminUserView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@
 block discarded – undo
281 281
 //    var_dump($pl);
282 282
 //    var_dump(uni_render_planet_full($pl, '', false, true));
283 283
 
284
-    foreach(DBStaticPlanet::db_planet_list_sorted($user_row) as $planetRow) {
284
+    foreach (DBStaticPlanet::db_planet_list_sorted($user_row) as $planetRow) {
285 285
       $result['.']['planet'][] = [
286 286
         'ID' => $planetRow['id'],
287 287
         'NAME' => $planetRow['name'],
Please login to merge, or discard this patch.
classes/Pages/Deprecated/PageMessage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -345,7 +345,7 @@
 block discarded – undo
345 345
     $wasIgnored = 0;
346 346
     $template = SnTemplate::gettemplate('msg_message_list', true);
347 347
     foreach ($message_query as $message_row) {
348
-      if(
348
+      if (
349 349
         $message_row['message_type'] == MSG_TYPE_PLAYER
350 350
         &&
351 351
         SN::$gc->ignores->isIgnored(floatval($message_row['message_owner']), floatval($message_row['message_sender']))
Please login to merge, or discard this patch.
classes/HelperArray.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
    * @return array
241 241
    */
242 242
   public static function parseParamStrings($array, $delimiter = '=') {
243
-    !is_array($array) ? $array = array((string)$array) : false;
243
+    !is_array($array) ? $array = array((string) $array) : false;
244 244
 
245 245
     $result = array();
246 246
     foreach ($array as $param) {
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
    * @return float|null
263 263
    */
264 264
   public static function maxValueByField(&$array, $fieldName) {
265
-    return array_reduce($array, function ($carry, $item) use ($fieldName) {
266
-      if(is_array($item) && isset($item[$fieldName]) && (!isset($carry) || $carry < $item[$fieldName])) {
265
+    return array_reduce($array, function($carry, $item) use ($fieldName) {
266
+      if (is_array($item) && isset($item[$fieldName]) && (!isset($carry) || $carry < $item[$fieldName])) {
267 267
         $carry = $item[$fieldName];
268 268
       }
269 269
 
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 
281 281
     return
282 282
       array_reduce($array,
283
-        function ($carry, $item) use (&$fieldName, $maxValue) {
284
-          if(is_array($item) && isset($item[$fieldName]) && $item[$fieldName] == $maxValue) {
283
+        function($carry, $item) use (&$fieldName, $maxValue) {
284
+          if (is_array($item) && isset($item[$fieldName]) && $item[$fieldName] == $maxValue) {
285 285
             $carry[] = $item;
286 286
           }
287 287
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
   }
293 293
 
294 294
   public static function intersectByKeys(array &$array1, array &$array2) {
295
-    return array_uintersect_assoc($array1, $array2, function ($a, $b) {return 0;});
295
+    return array_uintersect_assoc($array1, $array2, function($a, $b) {return 0; });
296 296
   }
297 297
 
298 298
   /**
Please login to merge, or discard this patch.
fleet.php 2 patches
Switch Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -78,121 +78,121 @@  discard block
 block discarded – undo
78 78
 }
79 79
 
80 80
 switch ($fleet_page) {
81
-  case 3:
81
+    case 3:
82 82
 
83
-  case 2:
84
-    $fleet_group_mr = sys_get_param_id('fleet_group');
85
-    $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
86
-    $fleetarray = is_array($fleetarray) ? $fleetarray : array();
83
+    case 2:
84
+      $fleet_group_mr = sys_get_param_id('fleet_group');
85
+      $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
86
+      $fleetarray = is_array($fleetarray) ? $fleetarray : array();
87 87
 
88
-    foreach($fleetarray as $ship_id => &$ship_amount) {
89
-      if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
90
-        $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
91
-        die();
92
-      }
93
-      $ship_amount = floatval($ship_amount);
94
-    }
95
-
96
-    $UsedPlanet = false;
97
-    $YourPlanet = false;
98
-    $missiontype = array();
99
-    if ($planet > SN::$config->game_maxPlanet) {
100
-      $target_mission = MT_EXPLORE;
101
-      $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
102
-    } elseif ($galaxy && $system && $planet) {
103
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
104
-
105
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
106
-
107
-      if ($TargetPlanet['id_owner']) {
108
-        $UsedPlanet = true;
109
-        if ($TargetPlanet['id_owner'] == $user['id']) {
110
-          $YourPlanet = true;
88
+      foreach($fleetarray as $ship_id => &$ship_amount) {
89
+        if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
90
+          $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
91
+          die();
111 92
         }
93
+        $ship_amount = floatval($ship_amount);
112 94
       }
113 95
 
114
-      if (!$UsedPlanet) {
115
-        if ($fleetarray[SHIP_COLONIZER]) {
116
-          $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
117
-          $target_mission = MT_COLONIZE;
118
-          $planet_type = PT_PLANET;
119
-        } else {
120
-          SnTemplate::messageBox("<font color=\"red\"><b>" . $lang['fl_no_planet_type'] . "</b></font>", $lang['fl_error']);
121
-        }
122
-      } else {
123
-        $recyclers = 0;
124
-        foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
125
-          $recyclers += $fleetarray[$recycler_id];
96
+      $UsedPlanet = false;
97
+      $YourPlanet = false;
98
+      $missiontype = array();
99
+      if ($planet > SN::$config->game_maxPlanet) {
100
+        $target_mission = MT_EXPLORE;
101
+        $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
102
+      } elseif ($galaxy && $system && $planet) {
103
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
104
+
105
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
106
+
107
+        if ($TargetPlanet['id_owner']) {
108
+          $UsedPlanet = true;
109
+          if ($TargetPlanet['id_owner'] == $user['id']) {
110
+            $YourPlanet = true;
111
+          }
126 112
         }
127
-        if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
128
-          $target_mission = MT_RECYCLE;
129
-          $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
130
-        } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
131
-          if ($YourPlanet) {
132
-            $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
133
-            $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
113
+
114
+        if (!$UsedPlanet) {
115
+          if ($fleetarray[SHIP_COLONIZER]) {
116
+            $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
117
+            $target_mission = MT_COLONIZE;
118
+            $planet_type = PT_PLANET;
134 119
           } else {
135
-            // Not Your Planet
136
-            if ($fleetarray[SHIP_SPY]) {
137
-              // Only spy missions if any spy
138
-              $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
120
+            SnTemplate::messageBox("<font color=\"red\"><b>" . $lang['fl_no_planet_type'] . "</b></font>", $lang['fl_error']);
121
+          }
122
+        } else {
123
+          $recyclers = 0;
124
+          foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
125
+            $recyclers += $fleetarray[$recycler_id];
126
+          }
127
+          if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
128
+            $target_mission = MT_RECYCLE;
129
+            $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
130
+          } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
131
+            if ($YourPlanet) {
132
+              $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
133
+              $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
139 134
             } else {
140
-              // If no spies...
141
-              if ($fleet_group_mr) {
142
-                $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
135
+              // Not Your Planet
136
+              if ($fleetarray[SHIP_SPY]) {
137
+                // Only spy missions if any spy
138
+                $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
143 139
               } else {
144
-                $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
145
-                $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
146
-
147
-                $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
148
-
149
-                if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
150
-                  $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
140
+                // If no spies...
141
+                if ($fleet_group_mr) {
142
+                  $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
143
+                } else {
144
+                  $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
145
+                  $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
146
+
147
+                  $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
148
+
149
+                  if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
150
+                    $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
151
+                  }
151 152
                 }
152 153
               }
153 154
             }
154 155
           }
155 156
         }
156 157
       }
157
-    }
158
-
159
-    if (!$target_mission && is_array($missiontype)) {
160
-      $target_mission = MT_ATTACK;
161
-    }
162
-
163
-//    $sn_group_missions = sn_get_groups('missions');
164
-//    foreach($sn_group_missions as $mission_id => $cork) {
165
-//      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
166
-//    }
167
-//
168
-//
169
-    ksort($missiontype);
170
-
171
-    $speed_percent = sys_get_param_int('speed', 10);
172
-    $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
173
-
174
-//    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
175
-    $fleet_speed   = $travel_data['fleet_speed'];
176
-    $distance      = $travel_data['distance'];
177
-    $duration      = $travel_data['duration'];
178
-    $consumption   = $travel_data['consumption'];
179
-  // No Break
180
-
181
-  case 1:
182
-    if ($galaxy && $system && $planet) {
183
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
184
-
185
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
186
-    }
187
-
188
-  case 0:
189
-    $template_result += array(
190
-      'thisgalaxy'      => $planetrow['galaxy'],
191
-      'thissystem'      => $planetrow['system'],
192
-      'thisplanet'      => $planetrow['planet'],
193
-      'thisplanet_type' => $planetrow['planet_type'],
194
-    );
195
-  // no break
158
+
159
+      if (!$target_mission && is_array($missiontype)) {
160
+        $target_mission = MT_ATTACK;
161
+      }
162
+
163
+  //    $sn_group_missions = sn_get_groups('missions');
164
+  //    foreach($sn_group_missions as $mission_id => $cork) {
165
+  //      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
166
+  //    }
167
+  //
168
+  //
169
+      ksort($missiontype);
170
+
171
+      $speed_percent = sys_get_param_int('speed', 10);
172
+      $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
173
+
174
+  //    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
175
+      $fleet_speed   = $travel_data['fleet_speed'];
176
+      $distance      = $travel_data['distance'];
177
+      $duration      = $travel_data['duration'];
178
+      $consumption   = $travel_data['consumption'];
179
+    // No Break
180
+
181
+    case 1:
182
+      if ($galaxy && $system && $planet) {
183
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
184
+
185
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
186
+      }
187
+
188
+    case 0:
189
+      $template_result += array(
190
+        'thisgalaxy'      => $planetrow['galaxy'],
191
+        'thissystem'      => $planetrow['system'],
192
+        'thisplanet'      => $planetrow['planet'],
193
+        'thisplanet_type' => $planetrow['planet_type'],
194
+      );
195
+    // no break
196 196
 
197 197
 }
198 198
 
@@ -214,35 +214,35 @@  discard block
 block discarded – undo
214 214
 }
215 215
 
216 216
 switch($fleet_page) {
217
-  case 1:
218
-    require('includes/includes/flt_page1.inc');
219
-  break;
220
-
221
-  case 2:
222
-    require_once('includes/includes/flt_page2.inc');
223
-    sn_fleet_page2();
224
-  break;
225
-
226
-  case 3:
227
-    require_once('includes/includes/flt_page3.inc');
228
-    sn_fleet_page3();
229
-  break;
230
-
231
-  case 4:
232
-    require('includes/includes/flt_page4.inc');
233
-  break;
234
-
235
-  case 5:
236
-    $template = SnTemplate::gettemplate('fleet5', true);
237
-    $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering();
238
-    $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
239
-    // Building list of own planets & moons
240
-    $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
241
-  break;
242
-
243
-  default:
244
-    define('SN_RENDER_NAVBAR_PLANET', true);
245
-
246
-    require('includes/includes/flt_page0.inc');
247
-  break;
217
+    case 1:
218
+      require('includes/includes/flt_page1.inc');
219
+    break;
220
+
221
+    case 2:
222
+      require_once('includes/includes/flt_page2.inc');
223
+      sn_fleet_page2();
224
+    break;
225
+
226
+    case 3:
227
+      require_once('includes/includes/flt_page3.inc');
228
+      sn_fleet_page3();
229
+    break;
230
+
231
+    case 4:
232
+      require('includes/includes/flt_page4.inc');
233
+    break;
234
+
235
+    case 5:
236
+      $template = SnTemplate::gettemplate('fleet5', true);
237
+      $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering();
238
+      $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
239
+      // Building list of own planets & moons
240
+      $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
241
+    break;
242
+
243
+    default:
244
+      define('SN_RENDER_NAVBAR_PLANET', true);
245
+
246
+      require('includes/includes/flt_page0.inc');
247
+    break;
248 248
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 $planet = sys_get_param_int('planet', $planetrow['planet']);
45 45
 
46 46
 $target_mission = sys_get_param_int('target_mission');
47
-if($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) {
47
+if ($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) {
48 48
   $planet_type = PT_PLANET;
49
-} elseif($target_mission == MT_RECYCLE) {
49
+} elseif ($target_mission == MT_RECYCLE) {
50 50
   $planet_type = PT_DEBRIS;
51
-} elseif($target_mission == MT_DESTROY) {
51
+} elseif ($target_mission == MT_DESTROY) {
52 52
   $planet_type = PT_MOON;
53 53
 } else {
54 54
   $planet_type = sys_get_param_int('planet_type');
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 //$FlyingFleets = doquery("SELECT COUNT(fleet_id) as Number FROM {{fleets}} WHERE `fleet_owner`='{$user['id']}'", true);
65 65
 //$FlyingFleets = $FlyingFleets['Number'];
66 66
 $FlyingFleets = DbFleetStatic::fleet_count_flying($user['id']);
67
-if($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) {
67
+if ($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) {
68 68
   SnTemplate::messageBox($lang['fl_noslotfree'], $lang['fl_error'], "fleet." . PHP_EX, 5);
69 69
 }
70 70
 
71 71
 $MaxExpeditions = get_player_max_expeditons($user);
72
-if($MaxExpeditions) {
72
+if ($MaxExpeditions) {
73 73
 //  $FlyingExpeditions  = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{fleets}} WHERE `fleet_owner` = {$user['id']} AND `fleet_mission` = '" . MT_EXPLORE . "';", '', true);
74 74
 //  $FlyingExpeditions  = $FlyingExpeditions['expedi'];
75
-  $FlyingExpeditions  = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE);
75
+  $FlyingExpeditions = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE);
76 76
 } else {
77 77
   $FlyingExpeditions = 0;
78 78
 }
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
     $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
86 86
     $fleetarray = is_array($fleetarray) ? $fleetarray : array();
87 87
 
88
-    foreach($fleetarray as $ship_id => &$ship_amount) {
89
-      if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
88
+    foreach ($fleetarray as $ship_id => &$ship_amount) {
89
+      if (!in_array($ship_id, sn_get_groups('fleet')) || (string) floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
90 90
         $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
91 91
         die();
92 92
       }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         }
122 122
       } else {
123 123
         $recyclers = 0;
124
-        foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
124
+        foreach (sn_get_groups('flt_recyclers') as $recycler_id) {
125 125
           $recyclers += $fleetarray[$recycler_id];
126 126
         }
127 127
         if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
                 $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
148 148
 
149
-                if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
149
+                if ($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
150 150
                   $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
151 151
                 }
152 152
               }
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
 );
207 207
 
208 208
 $is_transport_missions = false;
209
-if($missiontype) {
209
+if ($missiontype) {
210 210
   $sn_group_missions = sn_get_groups('missions');
211
-  foreach($missiontype as $mission_data_id => $mission_data) {
211
+  foreach ($missiontype as $mission_data_id => $mission_data) {
212 212
     $is_transport_missions = $is_transport_missions || (isset($sn_group_missions[$mission_data_id]['transport']) && $sn_group_missions[$mission_data_id]['transport']);
213 213
   }
214 214
 }
215 215
 
216
-switch($fleet_page) {
216
+switch ($fleet_page) {
217 217
   case 1:
218 218
     require('includes/includes/flt_page1.inc');
219 219
   break;
Please login to merge, or discard this patch.