Completed
Push — trunk ( d06df9...f48ee3 )
by SuperNova.WS
11:23
created
fleet.php 1 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.
time_probe.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 $time_server = $time_local  - $time_diff
13 13
 */
14 14
 
15
-if($font_size = sys_get_param_str('font_size')) {
16
-  if(strpos($font_size, '%') !== false) {
15
+if ($font_size = sys_get_param_str('font_size')) {
16
+  if (strpos($font_size, '%') !== false) {
17 17
     // Размер шрифта в процентах
18 18
     $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX) . '%';
19
-  } elseif(strpos($font_size, 'px') !== false) {
19
+  } elseif (strpos($font_size, 'px') !== false) {
20 20
     // Размер шрифта в пикселях
21 21
     $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX) . 'px';
22 22
   } else {
Please login to merge, or discard this patch.
admin/add_moon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
 $template = SnTemplate::gettemplate("admin/add_moon", true);
24 24
 
25
-if(sys_get_param_str('mode') == 'addit')
25
+if (sys_get_param_str('mode') == 'addit')
26 26
 {
27 27
   $PlanetID = sys_get_param_id('user');
28 28
   $MoonName = sys_get_param_str('name');
Please login to merge, or discard this patch.
admin/adm_log_main.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 
19 19
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
20 20
 
21
-if($delete = sys_get_param_id('delete'))
21
+if ($delete = sys_get_param_id('delete'))
22 22
 {
23 23
   doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;");
24 24
 }
25
-elseif(sys_get_param_str('delete_update_info'))
25
+elseif (sys_get_param_str('delete_update_info'))
26 26
 {
27 27
   doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);");
28 28
 }
29
-elseif(sys_get_param_str('deleteall') == 'yes')
29
+elseif (sys_get_param_str('deleteall') == 'yes')
30 30
 {
31 31
 //  doquery("TRUNCATE TABLE `{{logs}}`");
32 32
 }
33 33
 
34
-if($detail = sys_get_param_id('detail'))
34
+if ($detail = sys_get_param_id('detail'))
35 35
 {
36 36
   $template = SnTemplate::gettemplate('admin/adm_log_main_detail', true);
37 37
 
38 38
   $errorInfo = doquery("SELECT * FROM `{{logs}}` WHERE `log_id` = {$detail} LIMIT 1;", true);
39 39
   $error_dump = unserialize($errorInfo['log_dump']);
40
-  if(is_array($error_dump))
40
+  if (is_array($error_dump))
41 41
   {
42 42
     foreach ($error_dump as $key => $value)
43 43
     {
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 
58 58
   $i = 0;
59 59
   $query = doquery("SELECT * FROM `{{logs}}` ORDER BY log_id DESC LIMIT 100;");
60
-  while($u = db_fetch($query))
60
+  while ($u = db_fetch($query))
61 61
   {
62 62
     $i++;
63 63
     $v = array();
64
-    foreach($u as $key => $value)
64
+    foreach ($u as $key => $value)
65 65
     {
66 66
       $v[strtoupper($key)] = $value;
67 67
     }
Please login to merge, or discard this patch.
admin/planet_edit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
       if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) {
71 71
         $query_string[] = $unit_query_string;
72 72
       }
73
-    } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR,]) ) {
73
+    } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR, ])) {
74 74
       if (!floatval($unit_amount)) {
75 75
         continue;
76 76
       }
Please login to merge, or discard this patch.
admin/statbuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  * @copyright 2008 by Chlorel for XNova
10 10
  */
11 11
 
12
-define('INSIDE'  , true);
13
-define('INSTALL' , false);
12
+define('INSIDE', true);
13
+define('INSTALL', false);
14 14
 define('IN_ADMIN', true);
15 15
 require_once('../common.' . substr(strrchr(__FILE__, '.'), 1));
16 16
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
20 20
 
21
-if(SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end)
21
+if (SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end)
22 22
 {
23 23
   SN::$config->pass()->var_stat_update_admin_forced = SN_TIME_NOW + 120;
24 24
 
Please login to merge, or discard this patch.
admin/settings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
 use Unit\DBStaticUnit;
12 12
 
13
-define('INSIDE'  , true);
14
-define('INSTALL' , false);
13
+define('INSIDE', true);
14
+define('INSTALL', false);
15 15
 define('IN_ADMIN', true);
16 16
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 $template = SnTemplate::gettemplate('admin/settings', true);
23 23
 
24
-if(sys_get_param('save')) {
24
+if (sys_get_param('save')) {
25 25
   SN::$config->game_name               = sys_get_param_str_unsafe('game_name');
26 26
   SN::$config->game_mode               = sys_get_param_int('game_mode');
27 27
   SN::$config->game_speed              = sys_get_param_float('game_speed', 1);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   SN::$config->url_faq                 = sys_get_param_str_unsafe('url_faq');
32 32
   SN::$config->url_forum               = sys_get_param_str_unsafe('url_forum');
33 33
   SN::$config->url_rules               = sys_get_param_str_unsafe('url_rules');
34
-  SN::$config->url_purchase_metamatter         = sys_get_param_str_unsafe('url_purchase_metamatter');
34
+  SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter');
35 35
   SN::$config->game_disable            = sys_get_param_int('game_disable');
36 36
   SN::$config->game_disable_reason     = sys_get_param_str_unsafe('game_disable_reason');
37 37
   SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto');
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
   SN::$config->stats_schedule          = sys_get_param_str('stats_schedule');
102 102
 
103 103
   SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period');
104
-  if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
-    if(SN::$config->empire_mercenary_temporary) {
104
+  if (SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
+    if (SN::$config->empire_mercenary_temporary) {
106 106
       DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished();
107 107
     } else {
108 108
       DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 SnTemplate::tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME');
153 153
 
154 154
 $lang_list = lng_get_list();
155
-foreach($lang_list as $lang_id => $lang_data) {
155
+foreach ($lang_list as $lang_id => $lang_data) {
156 156
   $template->assign_block_vars('game_languages', array(
157 157
     'ID'   => $lang_id,
158 158
     'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})",
Please login to merge, or discard this patch.
admin/ajax_maintenance.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1));
6 6
 
7
-if($user['authlevel'] < 3)
7
+if ($user['authlevel'] < 3)
8 8
 {
9 9
   SnTemplate::messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']);
10 10
   die();
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 // [#] info_best_battles 1b0
21 21
 $best_reports = array();
22
-if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
22
+if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
23 23
   $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY);
24
-  while($row = db_fetch($query)) {
24
+  while ($row = db_fetch($query)) {
25 25
     $best_reports[] = $row['ube_report_id'];
26 26
   }
27 27
 }
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
 
189 189
 function sn_maintenance_pack_user_list($user_list) {
190 190
   $user_list = explode(',', $user_list);
191
-  foreach($user_list as $key => $user_id) {
192
-    if(!is_numeric($user_id)) {
191
+  foreach ($user_list as $key => $user_id) {
192
+    if (!is_numeric($user_id)) {
193 193
       unset($user_list[$key]);
194 194
     }
195 195
   }
196 196
 
197 197
   $result = array();
198
-  if(!empty($user_list)) {
198
+  if (!empty($user_list)) {
199 199
     $query = doquery("SELECT `id` FROM `{{users}}` WHERE `id` in (" . implode(',', $user_list) . ")");
200
-    while($row = db_fetch($query)) {
200
+    while ($row = db_fetch($query)) {
201 201
       $result[] = $row['id'];
202 202
     }
203 203
   }
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 $old_server_status == GAME_DISABLE_NONE ? SN::$config->pass()->game_disable = GAME_DISABLE_MAINTENANCE : false;
213 213
 sn_db_transaction_commit();
214 214
 
215
-foreach($ques as $que_transaction) {
215
+foreach ($ques as $que_transaction) {
216 216
   sn_db_transaction_start();
217 217
 
218 218
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
219
-  foreach($que_transaction as $que) {
219
+  foreach ($que_transaction as $que) {
220 220
     set_time_limit(120);
221 221
     $QryResult = doquery($que);
222 222
     //$msg .= '<hr>' . $que . '<hr>';
Please login to merge, or discard this patch.
admin/adm_planet_list.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('INSIDE'  , true);
4
-define('INSTALL' , false);
3
+define('INSIDE', true);
4
+define('INSTALL', false);
5 5
 define('IN_ADMIN', true);
6 6
 
7 7
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
12 12
 
13 13
 $planet_active = sys_get_param_int('planet_active');
14
-if(!$planet_active) {
14
+if (!$planet_active) {
15 15
   $planet_type = sys_get_param_int('planet_type', 1);
16 16
   $planet_type = $planet_type == 3 ? 3 : 1;
17 17
 } else {
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 $page_title = 
42 42
   $lang['adm_planet_list_title'] . ': ' . 
43
-  ($planet_active ? $lang['adm_planet_active'] :
44
-    ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
43
+  ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
45 44
   );
46 45
 $template->assign_vars(array(
47 46
   'PAGE_TITLE' => $page_title,
Please login to merge, or discard this patch.