Passed
Push — work-fleets ( 6f822b...6dcfe4 )
by SuperNova.WS
06:31 queued 16s
created
includes/functions/tpl_helpers.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -185,6 +185,9 @@
 block discarded – undo
185 185
   return $result;
186 186
 }
187 187
 
188
+/**
189
+ * @param integer $que_id
190
+ */
188 191
 function tpl_parse_planet_que($que, $planet, $que_id) {
189 192
   $hangar_que = array();
190 193
   $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']];
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 use DBStatic\DBStaticFleetACS;
5 5
 
6 6
 function tpl_assign_fleet_compare($a, $b) {
7
-  if($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
8
-    if($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
7
+  if ($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
8
+    if ($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
9 9
       return 0;
10 10
     }
11 11
 
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
  * @param string   $js_name
22 22
  */
23 23
 function tpl_assign_fleet(&$template, $fleets, $js_name = 'fleets') {
24
-  if(!$fleets) {
24
+  if (!$fleets) {
25 25
     return;
26 26
   }
27 27
 
28 28
   usort($fleets, 'tpl_assign_fleet_compare');
29 29
 
30
-  foreach($fleets as $fleet_data) {
30
+  foreach ($fleets as $fleet_data) {
31 31
     $template->assign_block_vars($js_name, $fleet_data['fleet']);
32 32
 
33
-    if($fleet_data['ships']) {
34
-      foreach($fleet_data['ships'] as $ship_data) {
33
+    if ($fleet_data['ships']) {
34
+      foreach ($fleet_data['ships'] as $ship_data) {
35 35
         $template->assign_block_vars("{$js_name}.ships", $ship_data);
36 36
       }
37 37
     }
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     'DEUTERIUM' => $fleet[RES_DEUTERIUM],
53 53
   );
54 54
 
55
-  foreach($fleet as $ship_id => $ship_amount) {
56
-    if(in_array($ship_id, classSupernova::$gc->groupFleet)) {
55
+  foreach ($fleet as $ship_id => $ship_amount) {
56
+    if (in_array($ship_id, classSupernova::$gc->groupFleet)) {
57 57
       $single_ship_data = get_ship_data($ship_id, $user_data);
58 58
       $return['ships'][$ship_id] = array(
59 59
         'ID'          => $ship_id,
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 
93 93
   $result = array();
94 94
 
95
-  if(!$user_data) {
95
+  if (!$user_data) {
96 96
     $user_data = $user;
97 97
   }
98 98
 
99
-  if(!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) {
99
+  if (!$objFleet->isReturning() && $objFleet->mission_type == MT_ACS) {
100 100
     $aks = DBStaticFleetACS::db_acs_get_by_group_id($objFleet->group_id);
101 101
   }
102 102
 
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
     'STAY_LEFT' => floor($objFleet->time_mission_job_complete + 1 - SN_TIME_NOW),
138 138
   );
139 139
 
140
-  if(property_exists($objFleet, 'fleet_start_name')) {
140
+  if (property_exists($objFleet, 'fleet_start_name')) {
141 141
     $result['START_NAME'] = $objFleet->fleet_start_name;
142 142
   }
143
-  if(property_exists($objFleet, 'fleet_end_name')) {
143
+  if (property_exists($objFleet, 'fleet_end_name')) {
144 144
     $result['END_NAME'] = $objFleet->fleet_end_name;
145 145
   }
146 146
 
147
-  if(property_exists($objFleet, 'event_time')) {
147
+  if (property_exists($objFleet, 'event_time')) {
148 148
     $result['fleet'] = array_merge($result['fleet'], array(
149 149
       'OV_LABEL'        => $objFleet->ov_label,
150 150
       'EVENT_TIME_TEXT' => property_exists($objFleet, 'event_time') ? date(FMT_DATE_TIME, $objFleet->event_time + SN_CLIENT_TIME_DIFF) : '',
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 
156 156
   $ship_id = 0;
157 157
   $result['ships'] = array();
158
-  if($spy_level >= 6) {
159
-    foreach($objFleet->shipsIterator() as $ship_sn_id => $ship) {
160
-      if($spy_level >= 10) {
158
+  if ($spy_level >= 6) {
159
+    foreach ($objFleet->shipsIterator() as $ship_sn_id => $ship) {
160
+      if ($spy_level >= 10) {
161 161
         $single_ship_data = get_ship_data($ship_sn_id, $user_data);
162 162
         $result['ships'][$ship_sn_id] = array(
163 163
           'ID'          => $ship_sn_id,
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
 function tpl_parse_planet_que($que, $planet, $que_id) {
191 191
   $hangar_que = array();
192 192
   $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']];
193
-  if(!empty($que_hangar)) {
194
-    foreach($que_hangar as $que_item) {
193
+  if (!empty($que_hangar)) {
194
+    foreach ($que_hangar as $que_item) {
195 195
       $hangar_que['que'][] = array('id' => $que_item['que_unit_id'], 'count' => $que_item['que_unit_amount']);
196 196
       $hangar_que[$que_item['que_unit_id']] += $que_item['que_unit_amount'];
197 197
     }
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
     'PLANET_GOVERNOR_LEVEL_MAX' => get_unit_param($planet['PLANET_GOVERNOR_ID'], P_MAX_STACK),
252 252
   );
253 253
 
254
-  if(!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
254
+  if (!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
255 255
     $result['building_que'] = array();
256 256
     $building_que = &$que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']];
257
-    foreach($building_que as $que_element) {
257
+    foreach ($building_que as $que_element) {
258 258
       $result['building_que'][] = que_tpl_parse_element($que_element);
259 259
     }
260 260
   }
@@ -273,19 +273,19 @@  discard block
 block discarded – undo
273 273
   static $snGroupFleet;
274 274
   !$snGroupFleet ? $snGroupFleet = classSupernova::$gc->groupFleet : false;
275 275
 
276
-  if(empty($array_of_Fleet)) {
276
+  if (empty($array_of_Fleet)) {
277 277
     return false;
278 278
   }
279 279
 
280 280
   $fleet_list = array();
281
-  foreach($array_of_Fleet as $fleet) {
282
-    if($fleet->playerOwnerId == $user['id']) {
283
-      if($fleet->mission_type == MT_MISSILE) {
281
+  foreach ($array_of_Fleet as $fleet) {
282
+    if ($fleet->playerOwnerId == $user['id']) {
283
+      if ($fleet->mission_type == MT_MISSILE) {
284 284
         continue;
285 285
       }
286 286
       $fleet_ownage = 'own';
287 287
     } else {
288
-      switch($fleet->mission_type) {
288
+      switch ($fleet->mission_type) {
289 289
         case MT_ATTACK:
290 290
         case MT_ACS:
291 291
         case MT_DESTROY:
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 
303 303
     $fleet_list[$fleet_ownage]['fleets'][$fleet->dbId] = $fleet;
304 304
 
305
-    if($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
306
-      foreach($fleet->shipsIterator() as $ship_id => $ship) {
307
-        if(!empty($snGroupFleet[$ship_id])) {
305
+    if ($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
306
+      foreach ($fleet->shipsIterator() as $ship_id => $ship) {
307
+        if (!empty($snGroupFleet[$ship_id])) {
308 308
           $fleet_list[$fleet_ownage]['total'][$ship_id] += $ship->count;
309 309
         }
310 310
       }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
   return $fleet_list;
322 322
 }
323 323
 
324
-function tpl_set_resource_info(template &$template, $planet_row, $fleets_to_planet = array(), $round = 0) {
324
+function tpl_set_resource_info(template & $template, $planet_row, $fleets_to_planet = array(), $round = 0) {
325 325
   $template->assign_vars(array(
326 326
     'RESOURCE_ROUNDING' => $round,
327 327
 
Please login to merge, or discard this patch.
includes/includes/coe_simulator_helpers.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
+/**
4
+ * @param string $type
5
+ */
3 6
 function sn_ube_simulator_encode_replay($combat, $type)
4 7
 {
5 8
   $strPacked = "{$type}!";
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 {
5 5
   $strPacked = "{$type}!";
6 6
 
7
-  foreach($combat as $fleetID => $fleetCompress)
7
+  foreach ($combat as $fleetID => $fleetCompress)
8 8
   {
9
-    foreach($fleetCompress as $key => $value)
9
+    foreach ($fleetCompress as $key => $value)
10 10
     {
11 11
       $value = intval($value);
12 12
       $strPacked .= "{$key},{$value};";
@@ -22,29 +22,29 @@  discard block
 block discarded – undo
22 22
   $fleet_id = 0;
23 23
 
24 24
   $arr_data_unpacked = explode('!', $str_data);
25
-  foreach($arr_data_unpacked as $data_piece)
25
+  foreach ($arr_data_unpacked as $data_piece)
26 26
   {
27
-    if(!$data_piece)
27
+    if (!$data_piece)
28 28
     {
29 29
       continue;
30 30
     }
31 31
 
32
-    if($data_piece == 'A' || $data_piece == 'D')
32
+    if ($data_piece == 'A' || $data_piece == 'D')
33 33
     {
34 34
       $fleet_type = $data_piece;
35 35
       continue;
36 36
     }
37 37
 
38 38
     $arr_unit_strings = explode(';', $data_piece);
39
-    foreach($arr_unit_strings as $str_unit_string)
39
+    foreach ($arr_unit_strings as $str_unit_string)
40 40
     {
41
-      if(!$str_unit_string)
41
+      if (!$str_unit_string)
42 42
       {
43 43
         continue;
44 44
       }
45 45
 
46 46
       $arr_unit_data = explode(',', $str_unit_string);
47
-      if($arr_unit_data[1])
47
+      if ($arr_unit_data[1])
48 48
       {
49 49
         $unpacked[$fleet_type][$fleet_id][$arr_unit_data[0]] = intval($arr_unit_data[1]);
50 50
       }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function sn_ube_simulator_encode_replay($combat, $type)
4
-{
3
+function sn_ube_simulator_encode_replay($combat, $type) {
5 4
   $strPacked = "{$type}!";
6 5
 
7 6
   foreach($combat as $fleetID => $fleetCompress)
@@ -17,8 +16,7 @@  discard block
 block discarded – undo
17 16
   return $strPacked;
18 17
 }
19 18
 
20
-function sn_ube_simulator_decode_replay($str_data)
21
-{
19
+function sn_ube_simulator_decode_replay($str_data) {
22 20
   $fleet_id = 0;
23 21
 
24 22
   $arr_data_unpacked = explode('!', $str_data);
Please login to merge, or discard this patch.
banned.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
 $query = db_banned_list_select();
22 22
 $i = 0;
23
-while($ban_row = db_fetch($query)) {
23
+while ($ban_row = db_fetch($query)) {
24 24
   $template->assign_block_vars('banlist', array(
25 25
     'USER_NAME'   => $ban_row['ban_user_name'],
26 26
     'REASON'      => $ban_row['ban_reason'],
Please login to merge, or discard this patch.
includes/functions/geoip.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-function geoip_status(){return sn_function_call(__FUNCTION__, array(&$result));}
3
+function geoip_status() {return sn_function_call(__FUNCTION__, array(&$result)); }
4 4
 function sn_geoip_status(&$result) {
5 5
   return $result = false;
6 6
 }
7 7
 
8
-function geoip_ip_info($ip){return sn_function_call(__FUNCTION__, array($ip, &$result));}
8
+function geoip_ip_info($ip) {return sn_function_call(__FUNCTION__, array($ip, &$result)); }
9 9
 function sn_geoip_ip_info($ip, &$result) {
10 10
   return $result = false;
11 11
 }
Please login to merge, or discard this patch.
includes/db/db_helpers.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
  */
28 28
 function db_set_make_safe_string($set, $delta = false) {
29 29
   $set_safe = array();
30
-  foreach($set as $field => $value) {
31
-    if(empty($field)) {
30
+  foreach ($set as $field => $value) {
31
+    if (empty($field)) {
32 32
       continue;
33 33
     }
34 34
 
35 35
     $field = '`' . db_escape($field) . '`';
36 36
     $new_value = $value;
37
-    if($value === null) {
37
+    if ($value === null) {
38 38
       $new_value = 'NULL';
39
-    } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) {
39
+    } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) {
40 40
       // non-float
41 41
       $new_value = '"' . db_escape($value) . '"';
42
-    } elseif($delta) {
42
+    } elseif ($delta) {
43 43
       // float and DELTA-set
44 44
       $new_value = "{$field} + ({$new_value})";
45 45
     }
Please login to merge, or discard this patch.
buildings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
 $mode = sys_get_param_escaped('mode');
22 22
 $mode = (!$mode || $mode == 'buildings') ? QUE_STRUCTURES : ($mode == 'fleet' ? SUBQUE_FLEET : ($mode == 'defense' ? SUBQUE_DEFENSE : ($mode == 'research' ? QUE_RESEARCH : $mode)));
23 23
 
24
-if($building_sort = sys_get_param_id('sort_elements')) {
25
-  if(!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) {
24
+if ($building_sort = sys_get_param_id('sort_elements')) {
25
+  if (!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) {
26 26
     classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort;
27 27
     classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT_INVERSE, $mode)] = sys_get_param_id('sort_elements_inverse', 0);
28 28
   }
Please login to merge, or discard this patch.
admin/includes/admin_planet_edit.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 
22 22
 function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode) {
23 23
   $unit_list = sn_get_groups($mode);
24
-  if(empty($unit_list)) {
24
+  if (empty($unit_list)) {
25 25
     return;
26 26
   }
27 27
   $name_list = classLocale::$lang['tech'];
28 28
 
29
-  foreach($unit_list as $unit_id) {
29
+  foreach ($unit_list as $unit_id) {
30 30
     $template->assign_block_vars('unit', array(
31 31
       'ID'    => $unit_id,
32 32
       'NAME'  => $name_list[$unit_id],
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 function admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { return sn_function_call(__FUNCTION__, array($unit_id, $unit_amount, $mode)); }
40 40
 
41 41
 function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) {
42
-  if($unit_amount && in_array($unit_id, sn_get_groups($mode))) {
42
+  if ($unit_amount && in_array($unit_id, sn_get_groups($mode))) {
43 43
     $unit_amount = round($unit_amount);
44 44
     $unit_name = get_unit_param($unit_id, P_NAME);
45 45
     $result = "{$unit_name} = GREATEST(0, {$unit_name} + ({$unit_amount}))";
Please login to merge, or discard this patch.
infos.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
   ));
48 48
 
49 49
   $ActualProd = floor($Prod[$BuildID]);
50
-  if($BuildID != STRUC_MINE_FUSION) {
50
+  if ($BuildID != STRUC_MINE_FUSION) {
51 51
     $ActualNeed = floor($Prod[STRUC_MINE_SOLAR]);
52 52
   } else {
53 53
     $ActualNeed = floor($Prod[STRUC_MINE_DEUTERIUM]);
54 54
   }
55 55
 
56 56
   $BuildStartLvl = $CurrentBuildtLvl - 2;
57
-  if($BuildStartLvl < 1) {
57
+  if ($BuildStartLvl < 1) {
58 58
     $BuildStartLvl = 1;
59 59
   }
60 60
   $Table = '';
61 61
   $ProdFirst = 0;
62
-  for($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) {
63
-    if($BuildID != STRUC_MOON_PHALANX) {
62
+  for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) {
63
+    if ($BuildID != STRUC_MOON_PHALANX) {
64 64
       $Prod[STRUC_MINE_METAL] = floor(mrc_modify_value(
65 65
         $CurrentUser,
66 66
         $CurrentPlanet,
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
       ));
88 88
 
89 89
       $bloc['build_lvl'] = ($CurrentBuildtLvl == $BuildLevel) ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel;
90
-      if($ProdFirst > 0) {
91
-        if($BuildID != STRUC_MINE_FUSION) {
90
+      if ($ProdFirst > 0) {
91
+        if ($BuildID != STRUC_MINE_FUSION) {
92 92
           $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[$BuildID] - $ProdFirst)) . ")</font>";
93 93
         } else {
94 94
           $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[STRUC_MINE_SOLAR] - $ProdFirst)) . ")</font>";
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
       } else {
97 97
         $bloc['build_gain'] = '';
98 98
       }
99
-      if($BuildID != STRUC_MINE_FUSION) {
99
+      if ($BuildID != STRUC_MINE_FUSION) {
100 100
         $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID]));
101 101
         $bloc['build_prod_diff'] = pretty_number(floor($Prod[$BuildID] - $ActualProd), true, true);
102 102
         $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_SOLAR]), true, true);
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
         $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM]), true, true);
108 108
         $bloc['build_need_diff'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM] - $ActualNeed), true, true);
109 109
       }
110
-      if($ProdFirst == 0) {
111
-        if($BuildID != STRUC_MINE_FUSION) {
110
+      if ($ProdFirst == 0) {
111
+        if ($BuildID != STRUC_MINE_FUSION) {
112 112
           $ProdFirst = floor($Prod[$BuildID]);
113 113
         } else {
114 114
           $ProdFirst = floor($Prod[STRUC_MINE_SOLAR]);
@@ -133,22 +133,22 @@  discard block
 block discarded – undo
133 133
 
134 134
   $str_rapid_from = '';
135 135
   $str_rapid_to = '';
136
-  foreach(sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) {
136
+  foreach (sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) {
137 137
     $enemy_data = get_unit_param($enemy_id);
138 138
     $enemy_durability = $enemy_data['shield'] + $enemy_data['armor'];
139 139
 
140 140
     $rapid = floor($unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability);
141
-    if($rapid >= 1) {
141
+    if ($rapid >= 1) {
142 142
       $str_rapid_to .= "{$classLocale['nfo_rf_again']} {$classLocale['tech'][$enemy_id]} <font color=\"#00ff00\">{$rapid}</font><br>";
143 143
     }
144 144
 
145 145
     $rapid = floor($enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability);
146
-    if($rapid >= 1) {
146
+    if ($rapid >= 1) {
147 147
       $str_rapid_from .= "{$classLocale['tech'][$enemy_id]} {$classLocale['nfo_rf_from']} <font color=\"#ff0000\">{$rapid}</font><br>";
148 148
     }
149 149
   }
150 150
 
151
-  if($str_rapid_to && $str_rapid_from) {
151
+  if ($str_rapid_to && $str_rapid_from) {
152 152
     $str_rapid_to .= '<hr>';
153 153
   }
154 154
 
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
 }
157 157
 
158 158
 $unit_id = sys_get_param_id('gid');
159
-if($unit_id == RES_DARK_MATTER) {
159
+if ($unit_id == RES_DARK_MATTER) {
160 160
   sys_redirect('dark_matter.php');
161 161
 }
162 162
 
163
-if($unit_id == RES_METAMATTER) {
163
+if ($unit_id == RES_METAMATTER) {
164 164
   sys_redirect('metamatter.php');
165 165
 }
166 166
 
167 167
 lng_include('infos');
168
-if(!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) {
168
+if (!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) {
169 169
   sys_redirect('index.php?page=techtree');
170 170
 }
171 171
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 $unit_data = get_unit_param($unit_id);
175 175
 $unit_type = $unit_data['type'];
176 176
 
177
-if($unit_type == UNIT_SHIPS) {
177
+if ($unit_type == UNIT_SHIPS) {
178 178
   $template_result['UNIT_IS_SHIP'] = true;
179 179
 
180 180
   $ship_data = get_ship_data($unit_id, $user);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
   );
191 191
 
192 192
   $engine_template_info = array();
193
-  foreach($unit_data['engine'] as $unit_engine_data) {
193
+  foreach ($unit_data['engine'] as $unit_engine_data) {
194 194
     $unit_engine_data = get_engine_data($user, $unit_engine_data);
195 195
 
196 196
     $engine_template_info[] = array(
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
 
211 211
 $sn_data_group_combat = sn_get_groups('combat');
212
-if(in_array($unit_id, $sn_data_group_combat)) {
212
+if (in_array($unit_id, $sn_data_group_combat)) {
213 213
   $template_result['UNIT_IS_COMBAT'] = true;
214 214
 
215 215
   $unit_durability = $unit_data['shield'] + $unit_data['armor'];
@@ -217,21 +217,21 @@  discard block
 block discarded – undo
217 217
   $volley_arr = $rapid_to = $rapid_from = array();
218 218
   $str_rapid_from = '';
219 219
   $str_rapid_to = '';
220
-  foreach($sn_data_group_combat as $enemy_id) {
220
+  foreach ($sn_data_group_combat as $enemy_id) {
221 221
     $enemy_data = get_unit_param($enemy_id);
222 222
     $enemy_durability = $enemy_data['shield'] + $enemy_data['armor'];
223 223
 
224 224
     $rapid = $unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability;
225
-    if($rapid >= 1) {
225
+    if ($rapid >= 1) {
226 226
       $volley_arr[$enemy_id]['TO'] = floor($rapid);
227 227
     }
228 228
 
229 229
     $rapid = $enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability;
230
-    if($rapid >= 1) {
230
+    if ($rapid >= 1) {
231 231
       $volley_arr[$enemy_id]['FROM'] = floor($rapid);
232 232
     }
233 233
   }
234
-  foreach($volley_arr as $enemy_id => &$rapid) {
234
+  foreach ($volley_arr as $enemy_id => &$rapid) {
235 235
     $rapid['ENEMY_ID'] = $enemy_id;
236 236
     $rapid['ENEMY_NAME'] = classLocale::$lang['tech'][$enemy_id];
237 237
   }
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
 
250 250
 }
251 251
 
252
-if(classLocale::$lang['info'][$unit_id]['effect']) {
252
+if (classLocale::$lang['info'][$unit_id]['effect']) {
253 253
   $template_result['UNIT_EFFECT'] = classLocale::$lang['info'][$unit_id]['effect'];
254 254
 }
255 255
 
256
-if($unit_data['bonus']) {
256
+if ($unit_data['bonus']) {
257 257
   $unit_bonus = !$unit_data['bonus'] || $unit_data['bonus_type'] == BONUS_ABILITY ? '' : (
258 258
     ($unit_data['bonus'] >= 0 ? '+' : '') . $unit_data['bonus'] . ($unit_data['bonus_type'] == BONUS_PERCENT ? '%' : '')
259 259
   );
Please login to merge, or discard this patch.
search.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if(classSupernova::$config->game_mode == GAME_BLITZ) {
15
+if (classSupernova::$config->game_mode == GAME_BLITZ) {
16 16
   message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10);
17 17
   die();
18 18
 }
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 
26 26
 $template = gettemplate('search', true);
27 27
 
28
-if($searchtext && $type) {
29
-  switch($type) {
28
+if ($searchtext && $type) {
29
+  switch ($type) {
30 30
     case "planetname":
31 31
       // $search = db_planet_list_search($searchtext);
32 32
     break;
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     break;
42 42
   }
43 43
 
44
-  while($row = db_fetch($search)) {
45
-    if($type == 'playername' || $type == 'planetname') {
44
+  while ($row = db_fetch($search)) {
45
+    if ($type == 'playername' || $type == 'planetname') {
46 46
       $template->assign_block_vars('search_result', array(
47 47
         'PLAYER_ID'       => $row['uid'],
48 48
         'PLAYER_NAME'     => htmlentities($row['username'], ENT_COMPAT, 'UTF-8'),
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         'ALLY_NAME'       => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
58 58
         'ALLY_TAG'        => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
59 59
       ));
60
-    } elseif($type == 'ally') {
60
+    } elseif ($type == 'ally') {
61 61
       $template->assign_block_vars('search_result', array(
62 62
         'ALLY_NAME'     => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
63 63
         'ALLY_TAG'      => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
   'ally'       => 'sys_alliance',
76 76
 );
77 77
 
78
-foreach($search_type as $type_id => $type_lang) {
78
+foreach ($search_type as $type_id => $type_lang) {
79 79
   $template->assign_block_vars('type', array(
80 80
     'ID'       => $type_id,
81 81
     'TEXT'     => classLocale::$lang[$type_lang],
Please login to merge, or discard this patch.