Test Failed
Branch trunk (d809b8)
by SuperNova.WS
05:48
created
messages.php 1 patch
Switch Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -48,112 +48,112 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 switch ($mode) {
51
-  case 'write':
52
-    $error_list = array();
53
-    $template = gettemplate('msg_message_compose', true);
51
+    case 'write':
52
+      $error_list = array();
53
+      $template = gettemplate('msg_message_compose', true);
54 54
 
55
-    $recipient_name = sys_get_param_str_unsafe('recipient_name');
56
-    if($recipient_name) {
57
-      $recipient_row = db_user_by_username($recipient_name);
58
-    }
55
+      $recipient_name = sys_get_param_str_unsafe('recipient_name');
56
+      if($recipient_name) {
57
+        $recipient_row = db_user_by_username($recipient_name);
58
+      }
59 59
 
60
-    if(!$recipient_row) {
61
-      $recipient_id = sys_get_param_id('id');
62
-      $recipient_row = db_user_by_id($recipient_id);
63 60
       if(!$recipient_row) {
64
-        $recipient_id = 0;
61
+        $recipient_id = sys_get_param_id('id');
62
+        $recipient_row = db_user_by_id($recipient_id);
63
+        if(!$recipient_row) {
64
+          $recipient_id = 0;
65
+        }
65 66
       }
66
-    }
67 67
 
68
-    if($recipient_row) {
69
-      $recipient_id = $recipient_row['id'];
70
-      $recipient_name = $recipient_row['username'];
71
-    }
68
+      if($recipient_row) {
69
+        $recipient_id = $recipient_row['id'];
70
+        $recipient_name = $recipient_row['username'];
71
+      }
72 72
 
73
-    if($recipient_id == $user['id']) {
74
-      $error_list[] = array('MESSAGE' => $lang['msg_err_self_send'], 'STATUS' => ERR_ERROR);
75
-    }
73
+      if($recipient_id == $user['id']) {
74
+        $error_list[] = array('MESSAGE' => $lang['msg_err_self_send'], 'STATUS' => ERR_ERROR);
75
+      }
76 76
 
77
-    $re = 0;
78
-    $subject = sys_get_param_str('subject');
79
-    while(strpos($subject, $lang['msg_answer_prefix']) !== false) {
80
-      $subject = substr($subject, strlen($lang['msg_answer_prefix']));
81
-      $re++;
82
-    }
83
-    $re ? $subject = $lang['msg_answer_prefix'] . $subject : false;
77
+      $re = 0;
78
+      $subject = sys_get_param_str('subject');
79
+      while(strpos($subject, $lang['msg_answer_prefix']) !== false) {
80
+        $subject = substr($subject, strlen($lang['msg_answer_prefix']));
81
+        $re++;
82
+      }
83
+      $re ? $subject = $lang['msg_answer_prefix'] . $subject : false;
84 84
 
85
-    if(sys_get_param_str('msg_send')) {
86
-      $subject = $subject ? $subject : $lang['msg_subject_default'];
85
+      if(sys_get_param_str('msg_send')) {
86
+        $subject = $subject ? $subject : $lang['msg_subject_default'];
87 87
 
88
-      if(!$recipient_id) {
89
-        $error_list[] = array('MESSAGE' => $lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR);
90
-      }
88
+        if(!$recipient_id) {
89
+          $error_list[] = array('MESSAGE' => $lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR);
90
+        }
91 91
 
92
-      $text = sys_get_param_str('text');
93
-      if(!$text) {
94
-        $error_list[] = array('MESSAGE' => $lang['msg_err_no_text'], 'STATUS' => ERR_ERROR);
95
-      }
92
+        $text = sys_get_param_str('text');
93
+        if(!$text) {
94
+          $error_list[] = array('MESSAGE' => $lang['msg_err_no_text'], 'STATUS' => ERR_ERROR);
95
+        }
96 96
 
97
-      if(empty($error_list)) {
98
-        $error_list[] = array('MESSAGE' => $lang['msg_not_message_sent'], 'STATUS' => ERR_NONE);
97
+        if(empty($error_list)) {
98
+          $error_list[] = array('MESSAGE' => $lang['msg_not_message_sent'], 'STATUS' => ERR_NONE);
99 99
 
100
-        $user_safe_name = db_escape($user['username']);
101
-        $recipient_name = db_escape($recipient_name);
102
-        msg_send_simple_message($recipient_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, "{$user_safe_name} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]", $subject, $text, true);
100
+          $user_safe_name = db_escape($user['username']);
101
+          $recipient_name = db_escape($recipient_name);
102
+          msg_send_simple_message($recipient_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, "{$user_safe_name} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]", $subject, $text, true);
103 103
 
104
-        //$recipient_id = 0;
105
-        //$recipient_name = '';
106
-        //$subject = '';
107
-        $text    = '';
104
+          //$recipient_id = 0;
105
+          //$recipient_name = '';
106
+          //$subject = '';
107
+          $text    = '';
108 108
 
109
-        $msg_sent = true;
110
-      } else {
111
-        $subject = sys_get_param_str_unsafe('subject');
112
-        $text = sys_get_param_str_unsafe('text');
109
+          $msg_sent = true;
110
+        } else {
111
+          $subject = sys_get_param_str_unsafe('subject');
112
+          $text = sys_get_param_str_unsafe('text');
113
+        }
114
+        $recipient_name = sys_get_param_str_unsafe('recipient_name');
113 115
       }
114
-      $recipient_name = sys_get_param_str_unsafe('recipient_name');
115
-    }
116 116
 
117
-    $subject = $subject ? $subject : $lang['msg_subject_default'];
117
+      $subject = $subject ? $subject : $lang['msg_subject_default'];
118 118
 
119
-    $template->assign_vars(array(
120
-      'RECIPIENT_ID'   => $recipient_id,
121
-      'RECIPIENT_NAME' => htmlspecialchars($recipient_name),
122
-      'SUBJECT'        => htmlspecialchars($subject),
123
-      'TEXT'           => htmlspecialchars($text),
124
-    ));
119
+      $template->assign_vars(array(
120
+        'RECIPIENT_ID'   => $recipient_id,
121
+        'RECIPIENT_NAME' => htmlspecialchars($recipient_name),
122
+        'SUBJECT'        => htmlspecialchars($subject),
123
+        'TEXT'           => htmlspecialchars($text),
124
+      ));
125 125
 
126
-    foreach($error_list as $error_message) {
127
-      $template->assign_block_vars('result', $error_message);
128
-    }
126
+      foreach($error_list as $error_message) {
127
+        $template->assign_block_vars('result', $error_message);
128
+      }
129 129
 
130
-    $message_query = doquery(
131
-      "SELECT * FROM {{messages}}
130
+      $message_query = doquery(
131
+        "SELECT * FROM {{messages}}
132 132
         WHERE
133 133
           `message_type` = '" . MSG_TYPE_PLAYER . "' AND
134 134
           ((`message_owner` = '{$user['id']}' AND `message_sender` = '{$recipient_id}')
135 135
           OR
136 136
           (`message_sender` = '{$user['id']}' AND `message_owner` = '{$recipient_id}')) ORDER BY `message_time` DESC LIMIT 20;");
137
-    while ($message_row = db_fetch($message_query)) {
138
-      $template->assign_block_vars('messages', array(
139
-        'ID'             => $message_row['message_id'],
140
-        'DATE'           => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF),
141
-        'FROM'           => htmlspecialchars($message_row['message_from']),
142
-        'SUBJ'           => htmlspecialchars($message_row['message_subject']),
143
-        'TEXT'           => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']),
144
-
145
-        'FROM_ID'        => $message_row['message_sender'],
146
-      ));
147
-    }
137
+      while ($message_row = db_fetch($message_query)) {
138
+        $template->assign_block_vars('messages', array(
139
+          'ID'             => $message_row['message_id'],
140
+          'DATE'           => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF),
141
+          'FROM'           => htmlspecialchars($message_row['message_from']),
142
+          'SUBJ'           => htmlspecialchars($message_row['message_subject']),
143
+          'TEXT'           => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']),
144
+
145
+          'FROM_ID'        => $message_row['message_sender'],
146
+        ));
147
+      }
148 148
 
149
-  break;
149
+    break;
150 150
 
151
-  case 'delete':
152
-    $query_add = '';
151
+    case 'delete':
152
+      $query_add = '';
153 153
 
154
-    $message_range = sys_get_param_str('message_range');
154
+      $message_range = sys_get_param_str('message_range');
155 155
 
156
-    switch($message_range) {
156
+      switch($message_range) {
157 157
       case 'unchecked':
158 158
       case 'checked':
159 159
         $marked_message_list = sys_get_param('mark', array());
@@ -177,65 +177,65 @@  discard block
 block discarded – undo
177 177
       case 'all':
178 178
         $query_add = $query_add ? $query_add : true;
179 179
       break;
180
-    }
180
+      }
181 181
 
182 182
     if($query_add) {
183 183
       $query_add = $query_add === true ? '' : $query_add;
184 184
       doquery("DELETE FROM `{{messages}}` WHERE `message_owner` = '{$user['id']}'{$query_add};");
185 185
     }
186 186
 
187
-  case 'show':
188
-    if($current_class == MSG_TYPE_OUTBOX) {
189
-      $message_query = db_message_list_outbox_by_user_id($user['id']);
190
-    } else {
191
-      if ($current_class == MSG_TYPE_NEW) {
192
-        $SubUpdateQry = array();
193
-        foreach($sn_message_class_list as $message_class_id => $message_class) {
194
-          if($message_class_id != MSG_TYPE_OUTBOX) {
195
-            $SubUpdateQry[] = "`{$message_class['name']}` = '0'";
196
-            $user[$message_class['name']] = 0;
187
+    case 'show':
188
+      if($current_class == MSG_TYPE_OUTBOX) {
189
+        $message_query = db_message_list_outbox_by_user_id($user['id']);
190
+      } else {
191
+        if ($current_class == MSG_TYPE_NEW) {
192
+          $SubUpdateQry = array();
193
+          foreach($sn_message_class_list as $message_class_id => $message_class) {
194
+            if($message_class_id != MSG_TYPE_OUTBOX) {
195
+              $SubUpdateQry[] = "`{$message_class['name']}` = '0'";
196
+              $user[$message_class['name']] = 0;
197
+            }
197 198
           }
199
+          $SubUpdateQry = implode(',', $SubUpdateQry);
200
+        } else {
201
+          $SubUpdateQry = "`{$sn_message_class_list[$current_class]['name']}` = '0', `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` = `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` - '{$user[$sn_message_class_list[$current_class]['name']]}'";
202
+          $SubSelectQry = "AND `message_type` = '{$current_class}'";
203
+
204
+          $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']];
205
+          $user[$sn_message_class_list[$current_class]['name']] = 0;
198 206
         }
199
-        $SubUpdateQry = implode(',', $SubUpdateQry);
200
-      } else {
201
-        $SubUpdateQry = "`{$sn_message_class_list[$current_class]['name']}` = '0', `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` = `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` - '{$user[$sn_message_class_list[$current_class]['name']]}'";
202
-        $SubSelectQry = "AND `message_type` = '{$current_class}'";
203 207
 
204
-        $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']];
205
-        $user[$sn_message_class_list[$current_class]['name']] = 0;
208
+        db_user_set_by_id($user['id'], $SubUpdateQry);
209
+        $message_query = "SELECT * FROM {{messages}} WHERE `message_owner` = '{$user['id']}' {$SubSelectQry} ORDER BY `message_time` DESC;";
210
+        $message_query = doquery($message_query);
206 211
       }
207 212
 
208
-      db_user_set_by_id($user['id'], $SubUpdateQry);
209
-      $message_query = "SELECT * FROM {{messages}} WHERE `message_owner` = '{$user['id']}' {$SubSelectQry} ORDER BY `message_time` DESC;";
210
-      $message_query = doquery($message_query);
211
-    }
212
-
213
-    if(sys_get_param_int('return')) {
214
-      sys_redirect('messages.php');
215
-    }
213
+      if(sys_get_param_int('return')) {
214
+        sys_redirect('messages.php');
215
+      }
216 216
 
217
-    $template = gettemplate('msg_message_list', true);
218
-    while ($message_row = db_fetch($message_query)) {
219
-      $template->assign_block_vars('messages', array(
220
-        'ID'             => $message_row['message_id'],
221
-        'DATE'           => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF),
222
-        'FROM'           => htmlspecialchars($message_row['message_from']),
223
-        'SUBJ'           => htmlspecialchars($message_row['message_subject']),
224
-        'TEXT'           => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']),
225
-
226
-        'FROM_ID'        => $message_row['message_sender'],
227
-        'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']),
228
-        'STYLE'          => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'],
229
-      ));
230
-    }
217
+      $template = gettemplate('msg_message_list', true);
218
+      while ($message_row = db_fetch($message_query)) {
219
+        $template->assign_block_vars('messages', array(
220
+          'ID'             => $message_row['message_id'],
221
+          'DATE'           => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF),
222
+          'FROM'           => htmlspecialchars($message_row['message_from']),
223
+          'SUBJ'           => htmlspecialchars($message_row['message_subject']),
224
+          'TEXT'           => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']),
225
+
226
+          'FROM_ID'        => $message_row['message_sender'],
227
+          'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']),
228
+          'STYLE'          => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'],
229
+        ));
230
+      }
231 231
 
232
-    $current_class_text = $lang['msg_class'][$current_class];
232
+      $current_class_text = $lang['msg_class'][$current_class];
233 233
 
234
-    $template->assign_vars(array(
235
-      "MESSAGE_CLASS"      => $current_class,
236
-      "MESSAGE_CLASS_TEXT" => $current_class_text,
237
-    ));
238
-  break;
234
+      $template->assign_vars(array(
235
+        "MESSAGE_CLASS"      => $current_class,
236
+        "MESSAGE_CLASS_TEXT" => $current_class_text,
237
+      ));
238
+    break;
239 239
 }
240 240
 
241 241
 if(!$template) {
Please login to merge, or discard this patch.
fleet.php 1 patch
Switch Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -75,121 +75,121 @@  discard block
 block discarded – undo
75 75
 }
76 76
 
77 77
 switch ($fleet_page) {
78
-  case 3:
78
+    case 3:
79 79
 
80
-  case 2:
81
-    $fleet_group_mr = sys_get_param_id('fleet_group');
82
-    $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
83
-    $fleetarray = is_array($fleetarray) ? $fleetarray : array();
80
+    case 2:
81
+      $fleet_group_mr = sys_get_param_id('fleet_group');
82
+      $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
83
+      $fleetarray = is_array($fleetarray) ? $fleetarray : array();
84 84
 
85
-    foreach($fleetarray as $ship_id => &$ship_amount) {
86
-      if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
87
-        $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
88
-        die();
89
-      }
90
-      $ship_amount = floatval($ship_amount);
91
-    }
92
-
93
-    $UsedPlanet = false;
94
-    $YourPlanet = false;
95
-    $missiontype = array();
96
-    if ($planet > classSupernova::$config->game_maxPlanet) {
97
-      $target_mission = MT_EXPLORE;
98
-      $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
99
-    } elseif ($galaxy && $system && $planet) {
100
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
101
-
102
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
103
-
104
-      if ($TargetPlanet['id_owner']) {
105
-        $UsedPlanet = true;
106
-        if ($TargetPlanet['id_owner'] == $user['id']) {
107
-          $YourPlanet = true;
85
+      foreach($fleetarray as $ship_id => &$ship_amount) {
86
+        if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
87
+          $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
88
+          die();
108 89
         }
90
+        $ship_amount = floatval($ship_amount);
109 91
       }
110 92
 
111
-      if (!$UsedPlanet) {
112
-        if ($fleetarray[SHIP_COLONIZER]) {
113
-          $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
114
-          $target_mission = MT_COLONIZE;
115
-          $planet_type = PT_PLANET;
116
-        } else {
117
-          messageBox ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error']);
118
-        }
119
-      } else {
120
-        $recyclers = 0;
121
-        foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
122
-          $recyclers += $fleetarray[$recycler_id];
93
+      $UsedPlanet = false;
94
+      $YourPlanet = false;
95
+      $missiontype = array();
96
+      if ($planet > classSupernova::$config->game_maxPlanet) {
97
+        $target_mission = MT_EXPLORE;
98
+        $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE];
99
+      } elseif ($galaxy && $system && $planet) {
100
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
101
+
102
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
103
+
104
+        if ($TargetPlanet['id_owner']) {
105
+          $UsedPlanet = true;
106
+          if ($TargetPlanet['id_owner'] == $user['id']) {
107
+            $YourPlanet = true;
108
+          }
123 109
         }
124
-        if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
125
-          $target_mission = MT_RECYCLE;
126
-          $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
127
-        } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
128
-          if ($YourPlanet) {
129
-            $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
130
-            $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
110
+
111
+        if (!$UsedPlanet) {
112
+          if ($fleetarray[SHIP_COLONIZER]) {
113
+            $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE];
114
+            $target_mission = MT_COLONIZE;
115
+            $planet_type = PT_PLANET;
131 116
           } else {
132
-            // Not Your Planet
133
-            if ($fleetarray[SHIP_SPY]) {
134
-              // Only spy missions if any spy
135
-              $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
117
+            messageBox ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error']);
118
+          }
119
+        } else {
120
+          $recyclers = 0;
121
+          foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
122
+            $recyclers += $fleetarray[$recycler_id];
123
+          }
124
+          if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
125
+            $target_mission = MT_RECYCLE;
126
+            $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE];
127
+          } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) {
128
+            if ($YourPlanet) {
129
+              $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE];
130
+              $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
136 131
             } else {
137
-              // If no spies...
138
-              if ($fleet_group_mr) {
139
-                $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
132
+              // Not Your Planet
133
+              if ($fleetarray[SHIP_SPY]) {
134
+                // Only spy missions if any spy
135
+                $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY];
140 136
               } else {
141
-                $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
142
-                $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
143
-
144
-                $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
145
-
146
-                if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
147
-                  $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
137
+                // If no spies...
138
+                if ($fleet_group_mr) {
139
+                  $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS];
140
+                } else {
141
+                  $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK];
142
+                  $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT];
143
+
144
+                  $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
145
+
146
+                  if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
147
+                    $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
148
+                  }
148 149
                 }
149 150
               }
150 151
             }
151 152
           }
152 153
         }
153 154
       }
154
-    }
155
-
156
-    if (!$target_mission && is_array($missiontype)) {
157
-      $target_mission = MT_ATTACK;
158
-    }
159
-
160
-//    $sn_group_missions = sn_get_groups('missions');
161
-//    foreach($sn_group_missions as $mission_id => $cork) {
162
-//      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
163
-//    }
164
-//
165
-//
166
-    ksort($missiontype);
167
-
168
-    $speed_percent = sys_get_param_int('speed', 10);
169
-    $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
170
-
171
-//    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
172
-    $fleet_speed   = $travel_data['fleet_speed'];
173
-    $distance      = $travel_data['distance'];
174
-    $duration      = $travel_data['duration'];
175
-    $consumption   = $travel_data['consumption'];
176
-  // No Break
177
-
178
-  case 1:
179
-    if ($galaxy && $system && $planet) {
180
-      $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
181
-
182
-      $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
183
-    }
184
-
185
-  case 0:
186
-    $template_result += array(
187
-      'thisgalaxy'      => $planetrow['galaxy'],
188
-      'thissystem'      => $planetrow['system'],
189
-      'thisplanet'      => $planetrow['planet'],
190
-      'thisplanet_type' => $planetrow['planet_type'],
191
-    );
192
-  // no break
155
+
156
+      if (!$target_mission && is_array($missiontype)) {
157
+        $target_mission = MT_ATTACK;
158
+      }
159
+
160
+  //    $sn_group_missions = sn_get_groups('missions');
161
+  //    foreach($sn_group_missions as $mission_id => $cork) {
162
+  //      $missiontype[$mission_id] = $lang['type_mission'][$mission_id];
163
+  //    }
164
+  //
165
+  //
166
+      ksort($missiontype);
167
+
168
+      $speed_percent = sys_get_param_int('speed', 10);
169
+      $travel_data   = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent);
170
+
171
+  //    $fleet_speed   = flt_fleet_speed($user, $fleetarray);
172
+      $fleet_speed   = $travel_data['fleet_speed'];
173
+      $distance      = $travel_data['distance'];
174
+      $duration      = $travel_data['duration'];
175
+      $consumption   = $travel_data['consumption'];
176
+    // No Break
177
+
178
+    case 1:
179
+      if ($galaxy && $system && $planet) {
180
+        $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET;
181
+
182
+        $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type);
183
+      }
184
+
185
+    case 0:
186
+      $template_result += array(
187
+        'thisgalaxy'      => $planetrow['galaxy'],
188
+        'thissystem'      => $planetrow['system'],
189
+        'thisplanet'      => $planetrow['planet'],
190
+        'thisplanet_type' => $planetrow['planet_type'],
191
+      );
192
+    // no break
193 193
 
194 194
 }
195 195
 
@@ -211,35 +211,35 @@  discard block
 block discarded – undo
211 211
 }
212 212
 
213 213
 switch($fleet_page) {
214
-  case 1:
215
-    require('includes/includes/flt_page1.inc');
216
-  break;
217
-
218
-  case 2:
219
-    require_once('includes/includes/flt_page2.inc');
220
-    sn_fleet_page2();
221
-  break;
222
-
223
-  case 3:
224
-    require_once('includes/includes/flt_page3.inc');
225
-    sn_fleet_page3();
226
-  break;
227
-
228
-  case 4:
229
-    require('includes/includes/flt_page4.inc');
230
-  break;
231
-
232
-  case 5:
233
-    $template = gettemplate('fleet5', true);
234
-    $pageFleet5Gathering = new \Deprecated\PageFleet5Gathering();
235
-    $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
236
-    // Building list of own planets & moons
237
-    $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
238
-  break;
239
-
240
-  default:
241
-    define('SN_RENDER_NAVBAR_PLANET', true);
242
-
243
-    require('includes/includes/flt_page0.inc');
244
-  break;
214
+    case 1:
215
+      require('includes/includes/flt_page1.inc');
216
+    break;
217
+
218
+    case 2:
219
+      require_once('includes/includes/flt_page2.inc');
220
+      sn_fleet_page2();
221
+    break;
222
+
223
+    case 3:
224
+      require_once('includes/includes/flt_page3.inc');
225
+      sn_fleet_page3();
226
+    break;
227
+
228
+    case 4:
229
+      require('includes/includes/flt_page4.inc');
230
+    break;
231
+
232
+    case 5:
233
+      $template = gettemplate('fleet5', true);
234
+      $pageFleet5Gathering = new \Deprecated\PageFleet5Gathering();
235
+      $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template);
236
+      // Building list of own planets & moons
237
+      $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template);
238
+    break;
239
+
240
+    default:
241
+      define('SN_RENDER_NAVBAR_PLANET', true);
242
+
243
+      require('includes/includes/flt_page0.inc');
244
+    break;
245 245
 }
Please login to merge, or discard this patch.