Completed
Push — work-fleets ( 5197c7...069d1a )
by SuperNova.WS
05:03
created
ajax_version_check.php 3 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@
 block discarded – undo
22 22
 */
23 23
 switch($mode)
24 24
 {
25
-  case SNC_MODE_REGISTER:
26
-    if($config->server_updater_key || $config->server_updater_id)
27
-    {
28
-      if($ajax)
25
+    case SNC_MODE_REGISTER:
26
+      if($config->server_updater_key || $config->server_updater_id)
29 27
       {
30
-        print(SNC_VER_REGISTER_ERROR_REGISTERED);
28
+        if($ajax)
29
+        {
30
+          print(SNC_VER_REGISTER_ERROR_REGISTERED);
31
+        }
32
+        die();
31 33
       }
32
-      die();
33
-    }
34
-    $url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
35
-//TODO REMOVE DEBUG!!!
36
-//$url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode('http://supernova.ws/');
37
-  break;
34
+      $url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
35
+  //TODO REMOVE DEBUG!!!
36
+  //$url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode('http://supernova.ws/');
37
+    break;
38 38
 }
39 39
 
40 40
 $check_result = sn_get_url_contents($url);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 . '&key=' . urlencode($config->server_updater_key)
21 21
 . '&id=' . urlencode($config->server_updater_id);
22 22
 */
23
-switch($mode)
23
+switch ($mode)
24 24
 {
25 25
   case SNC_MODE_REGISTER:
26
-    if($config->server_updater_key || $config->server_updater_id)
26
+    if ($config->server_updater_key || $config->server_updater_id)
27 27
     {
28
-      if($ajax)
28
+      if ($ajax)
29 29
       {
30 30
         print(SNC_VER_REGISTER_ERROR_REGISTERED);
31 31
       }
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 }
39 39
 
40 40
 $check_result = sn_get_url_contents($url);
41
-if(!$check_result)
41
+if (!$check_result)
42 42
 {
43 43
   $version_check = SNC_VER_ERROR_CONNECT;
44 44
 }
45
-elseif(($version_check = intval($check_result)) && $version_check == $check_result)
45
+elseif (($version_check = intval($check_result)) && $version_check == $check_result)
46 46
 {
47 47
   $version_check = $check_result;
48 48
 }
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
   $check_result = json_decode($check_result, true);
53 53
   $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check'];
54 54
 
55
-  switch($mode)
55
+  switch ($mode)
56 56
   {
57 57
     case SNC_MODE_REGISTER:
58
-      if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED)
58
+      if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED)
59 59
       {
60 60
         $config->db_saveItem('server_updater_key', $check_result['site']['site_key']);
61 61
         $config->db_saveItem('server_updater_id', $check_result['site']['site_id']);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 $config->db_saveItem('server_updater_check_last', SN_TIME_NOW);
70 70
 $config->db_saveItem('server_updater_check_result', $version_check);
71 71
 
72
-if($ajax)
72
+if ($ajax)
73 73
 {
74 74
   define('IN_AJAX', true);
75 75
   print($version_check);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,12 +41,10 @@
 block discarded – undo
41 41
 if(!$check_result)
42 42
 {
43 43
   $version_check = SNC_VER_ERROR_CONNECT;
44
-}
45
-elseif(($version_check = intval($check_result)) && $version_check == $check_result)
44
+} elseif(($version_check = intval($check_result)) && $version_check == $check_result)
46 45
 {
47 46
   $version_check = $check_result;
48
-}
49
-else
47
+} else
50 48
 {
51 49
   // JSON decode if string
52 50
   $check_result = json_decode($check_result, true);
Please login to merge, or discard this patch.
jumpgate.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -14,39 +14,39 @@  discard block
 block discarded – undo
14 14
 
15 15
 lng_include('fleet');
16 16
 
17
-if($TargetPlanet = sys_get_param_id('jmpto'))
17
+if ($TargetPlanet = sys_get_param_id('jmpto'))
18 18
 {
19 19
   sn_db_transaction_start();
20 20
   db_user_by_id($user['id'], true, 'id');
21 21
   $planetrow = db_planet_by_id($planetrow['id'], true);
22
-  if(!($NextJumpTime = uni_get_time_to_jump($planetrow)))
22
+  if (!($NextJumpTime = uni_get_time_to_jump($planetrow)))
23 23
   {
24 24
     $TargetGate = db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`');
25
-    if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
25
+    if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
26 26
     {
27
-      $NextDestTime = uni_get_time_to_jump ( $TargetGate );
28
-      if(!$NextDestTime)
27
+      $NextDestTime = uni_get_time_to_jump($TargetGate);
28
+      if (!$NextDestTime)
29 29
       {
30 30
         // $SubQueryOri = "";
31 31
         // $SubQueryDes = "";
32 32
         $ship_list = sys_get_param('ships');
33 33
         $db_changeset = array();
34
-        foreach($ship_list as $ship_id => $ship_count)
34
+        foreach ($ship_list as $ship_id => $ship_count)
35 35
         {
36
-          if(!in_array($ship_id, sn_get_groups('fleet')))
36
+          if (!in_array($ship_id, sn_get_groups('fleet')))
37 37
           {
38 38
             continue;
39 39
           }
40 40
 
41 41
           $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id)));
42
-          if($ship_count)
42
+          if ($ship_count)
43 43
           {
44 44
             $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, -$ship_count, $user, $planetrow['id']);
45 45
             $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, $ship_count, $user, $TargetGate['id']);
46 46
           }
47 47
         }
48 48
         // Dit monsieur, y avait quelque chose a envoyer ???
49
-        if(!empty($db_changeset))
49
+        if (!empty($db_changeset))
50 50
         {
51 51
           db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
52 52
           db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
@@ -55,31 +55,31 @@  discard block
 block discarded – undo
55 55
           db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'");
56 56
 
57 57
           $planetrow['last_jump_time'] = SN_TIME_NOW;
58
-          $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow));
58
+          $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow));
59 59
         } else {
60 60
           $RetMessage = $lang['gate_wait_data'];
61 61
         }
62 62
       } else {
63
-        $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime);
63
+        $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime);
64 64
       }
65 65
     } else {
66 66
       $RetMessage = $lang['gate_no_dest_g'];
67 67
     }
68 68
   } else {
69
-    $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime);
69
+    $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime);
70 70
   }
71 71
   sn_db_transaction_commit();
72 72
   message($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10);
73 73
 } else {
74 74
   $template = gettemplate('jumpgate', true);
75
-  if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
75
+  if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
76 76
   {
77 77
     $Combo = '';
78 78
     $MoonList = db_planet_list_moon_other($user['id'], $planetrow['id']);
79 79
     // while($CurMoon = db_fetch($MoonList))
80
-    foreach($MoonList as $CurMoon)
80
+    foreach ($MoonList as $CurMoon)
81 81
     {
82
-      if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
82
+      if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
83 83
       {
84 84
         $NextJumpTime = uni_get_time_to_jump($CurMoon);
85 85
         $template->assign_block_vars('moon', array(
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
       }
94 94
     }
95 95
 
96
-    foreach(sn_get_groups('fleet') as $Ship)
96
+    foreach (sn_get_groups('fleet') as $Ship)
97 97
     {
98
-      if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
98
+      if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
99 99
       {
100 100
         continue;
101 101
       }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
     ));
116 116
 
117 117
     display($template, $lang['tech'][STRUC_MOON_GATE]);
118
-  }
119
-  else
118
+  } else
120 119
   {
121 120
     message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10);
122 121
   }
Please login to merge, or discard this patch.
simulator.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
   $sym_defender = $unpacked['D'];
23 23
   $sym_attacker = $unpacked['A'];
24
-}
25
-else
24
+} else
26 25
 {
27 26
   $sym_defender = array(0 => $sym_defender);
28 27
   $sym_attacker = array(1 => $sym_attacker);
@@ -56,8 +55,7 @@  discard block
 block discarded – undo
56 55
   $template = gettemplate('ube_combat_report', true);
57 56
   $template->assign_recursive($template_result);
58 57
   display($template, '', false, '', false, false, true);
59
-}
60
-else
58
+} else
61 59
 {
62 60
   $template = gettemplate('simulator', true);
63 61
   $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
5
+if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
6 6
 {
7 7
   define('BE_DEBUG', true);
8 8
 }
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $sym_defender = $_POST['defender'] ? $_POST['defender'] : array();
15 15
 $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array();
16 16
 
17
-if($replay)
17
+if ($replay)
18 18
 {
19 19
   $unpacked = sn_ube_simulator_decode_replay($replay);
20 20
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
   $sym_attacker = array(1 => $sym_attacker);
28 28
 }
29 29
 
30
-if($_POST['submit'] || $execute)
30
+if ($_POST['submit'] || $execute)
31 31
 {
32 32
   $replay = sn_ube_simulator_encode_replay($sym_defender, 'D');
33 33
   $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A');
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
   $template = gettemplate('simulator', true);
41 41
   $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
42 42
 
43
-  foreach($techs_and_officers as $tech_id)
43
+  foreach ($techs_and_officers as $tech_id)
44 44
   {
45
-    if(!$sym_attacker[1][$tech_id])
45
+    if (!$sym_attacker[1][$tech_id])
46 46
     {
47 47
       $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id);
48 48
     }
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
     UNIT_GOVERNORS => array(MRC_FORTIFIER),
57 57
     UNIT_DEFENCE => sn_get_groups('defense_active'),
58 58
   );
59
-  foreach($show_groups as $unit_group_id => $unit_group)
59
+  foreach ($show_groups as $unit_group_id => $unit_group)
60 60
   {
61 61
     $template->assign_block_vars('simulator', array(
62 62
       'GROUP' => $unit_group_id,
63 63
       'NAME' => $lang['tech'][$unit_group_id],
64 64
     ));
65 65
 
66
-    foreach($unit_group as $unit_id)
66
+    foreach ($unit_group as $unit_id)
67 67
     {
68 68
       $tab++;
69 69
 
Please login to merge, or discard this patch.
overview.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 $result = array();
38 38
 
39
-switch($mode = sys_get_param_str('mode')) {
39
+switch ($mode = sys_get_param_str('mode')) {
40 40
   case 'manage':
41 41
     sn_sys_sector_buy('overview.php?mode=manage');
42 42
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     $template  = gettemplate('planet_manage', true);
47 47
     $planet_id = sys_get_param_id('planet_id');
48 48
 
49
-    if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) {
49
+    if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) {
50 50
       $planetrow['name'] = $new_name;
51 51
 //      $new_name = db_escape($new_name);
52 52
       db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name}'");
53
-    } elseif(sys_get_param_str('action') == 'make_capital') {
53
+    } elseif (sys_get_param_str('action') == 'make_capital') {
54 54
       try {
55 55
         sn_db_transaction_start();
56 56
         $user = db_user_by_id($user['id'], true, '*');
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 //        $user = $global_data['user'];
60 60
 //        $planetrow = $global_data['planet'];
61 61
 
62
-        if($planetrow['planet_type'] != PT_PLANET) {
62
+        if ($planetrow['planet_type'] != PT_PLANET) {
63 63
           throw new exception($lang['ov_capital_err_not_a_planet'], ERR_ERROR);
64 64
         }
65 65
 
66
-        if($planetrow['id'] == $user['id_planet']) {
66
+        if ($planetrow['id'] == $user['id_planet']) {
67 67
           throw new exception($lang['ov_capital_err_capital_already'], ERR_ERROR);
68 68
         }
69 69
 
70
-        if($user_dark_matter < $config->planet_capital_cost) {
70
+        if ($user_dark_matter < $config->planet_capital_cost) {
71 71
           throw new exception($lang['ov_capital_err_no_dark_matter'], ERR_ERROR);
72 72
         }
73 73
 
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
         );
85 85
         sn_db_transaction_commit();
86 86
         sys_redirect('overview.php?mode=manage');
87
-      } catch(exception $e) {
87
+      } catch (exception $e) {
88 88
         sn_db_transaction_rollback();
89 89
         $result[] = array(
90 90
           'STATUS'  => $e->getCode(),
91 91
           'MESSAGE' => $e->getMessage(),
92 92
         );
93 93
       }
94
-    } elseif(sys_get_param_str('action') == 'planet_teleport') {
94
+    } elseif (sys_get_param_str('action') == 'planet_teleport') {
95 95
       try {
96
-        if(!uni_coordinates_valid($new_coordinates = array(
96
+        if (!uni_coordinates_valid($new_coordinates = array(
97 97
           'galaxy' => sys_get_param_int('new_galaxy'),
98 98
           'system' => sys_get_param_int('new_system'),
99 99
           'planet' => sys_get_param_int('new_planet')))
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 //        $planetrow = $global_data['planet'];
111 111
 
112 112
         $can_teleport = uni_planet_teleport_check($user, $planetrow, $new_coordinates);
113
-        if($can_teleport['result'] != ERR_NONE) {
113
+        if ($can_teleport['result'] != ERR_NONE) {
114 114
           throw new exception($can_teleport['message'], $can_teleport['result']);
115 115
         }
116 116
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         db_planet_set_by_gspt($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], PT_ALL,
122 122
           "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}, planet_teleport_next = {$planet_teleport_next}");
123 123
 
124
-        if($planetrow['id'] == $user['id_planet']) {
124
+        if ($planetrow['id'] == $user['id_planet']) {
125 125
           db_user_set_by_id($user['id'], "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}");
126 126
         }
127 127
 
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
           'MESSAGE' => $lang['ov_teleport_err_none'],
135 135
         );
136 136
         sys_redirect('overview.php?mode=manage');
137
-      } catch(exception $e) {
137
+      } catch (exception $e) {
138 138
         sn_db_transaction_rollback();
139 139
         $result[] = array(
140 140
           'STATUS'  => $e->getCode(),
141 141
           'MESSAGE' => $e->getMessage(),
142 142
         );
143 143
       }
144
-    } elseif(sys_get_param_str('action') == 'planet_abandon') {
144
+    } elseif (sys_get_param_str('action') == 'planet_abandon') {
145 145
       // if(sec_password_check($user['id'], sys_get_param('abandon_confirm'))) {
146
-      if(classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) {
147
-        if($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) {
146
+      if (classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) {
147
+        if ($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) {
148 148
           $destroyed = SN_TIME_NOW + 60 * 60 * 24;
149 149
           db_planet_set_by_id($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0");
150 150
           db_planet_set_by_parent($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0");
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
           message($lang['ov_delete_wrong_planet'], $lang['colony_abandon'], 'overview.php?mode=manage');
155 155
         }
156 156
       } else {
157
-        message($lang['ov_delete_wrong_pass'] , $lang['colony_abandon'], 'overview.php?mode=manage');
157
+        message($lang['ov_delete_wrong_pass'], $lang['colony_abandon'], 'overview.php?mode=manage');
158 158
       }
159
-    } elseif(
159
+    } elseif (
160 160
       ($hire = sys_get_param_int('hire')) && in_array($hire, sn_get_groups('governors'))
161 161
       && (
162 162
         !get_unit_param($hire, P_MAX_STACK) ||
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
       $user = db_user_by_id($user['id'], true);
172 172
       $planetrow = db_planet_by_id($planetrow['id'], true);
173 173
       $build_data = eco_get_build_data($user, $planetrow, $hire, $planetrow['PLANET_GOVERNOR_ID'] == $hire ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0);
174
-      if($build_data['CAN'][BUILD_CREATE]) {
175
-        if($planetrow['PLANET_GOVERNOR_ID'] == $hire) {
174
+      if ($build_data['CAN'][BUILD_CREATE]) {
175
+        if ($planetrow['PLANET_GOVERNOR_ID'] == $hire) {
176 176
           $planetrow['PLANET_GOVERNOR_LEVEL']++;
177 177
           $query = '`PLANET_GOVERNOR_LEVEL` + 1';
178 178
         } else {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
 
199 199
     lng_include('mrc_mercenary');
200 200
     int_planet_pretemplate($planetrow, $template);
201
-    foreach(sn_get_groups('governors') as $governor_id) {
202
-      if($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) {
201
+    foreach (sn_get_groups('governors') as $governor_id) {
202
+      if ($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) {
203 203
         continue;
204 204
       }
205 205
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
       'PAGE_HINT'   => $lang['ov_manage_page_hint'],
252 252
     ));
253 253
 
254
-    foreach($result as &$a_result) {
254
+    foreach ($result as &$a_result) {
255 255
       $template->assign_block_vars('result', $a_result);
256 256
     }
257 257
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
   default:
262 262
     sn_sys_sector_buy();
263 263
 
264
-    if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) {
264
+    if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) {
265 265
       $planetrow['name'] = $new_name;
266 266
       $new_name_safe = db_escape($new_name);
267 267
       db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name_safe}'");
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
     $planet_count = 0;
291 291
     $planets_query = db_planet_list_sorted($user, false, '*');
292
-    foreach($planets_query as $an_id => $UserPlanet) {
292
+    foreach ($planets_query as $an_id => $UserPlanet) {
293 293
       sn_db_transaction_start();
294 294
       $UserPlanet = sys_o_get_updated($user, $UserPlanet['id'], SN_TIME_NOW, false, true);
295 295
       sn_db_transaction_commit();
@@ -300,16 +300,16 @@  discard block
 block discarded – undo
300 300
 
301 301
       $planet_fleet_id = 0;
302 302
       $fleet_list = $template_planet['fleet_list'];
303
-      if($fleet_list['own']['count']) {
303
+      if ($fleet_list['own']['count']) {
304 304
         $planet_fleet_id = "p{$UserPlanet['id']}";
305 305
         $fleets_to_planet[$UserPlanet['id']] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id);
306 306
 //        $fleet_id++;tpl_parse_fleet_sn
307 307
       }
308
-      if($UserPlanet['planet_type'] == PT_MOON) {
308
+      if ($UserPlanet['planet_type'] == PT_MOON) {
309 309
         continue;
310 310
       }
311 311
       $moon = db_planet_by_parent($UserPlanet['id']);
312
-      if($moon) {
312
+      if ($moon) {
313 313
         $moon_fill = min(100, floor($moon['field_current'] / eco_planet_fields_max($moon) * 100));
314 314
       } else {
315 315
         $moon_fill = 0;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     tpl_assign_fleet($template, $fleets);
336 336
 
337 337
     $lune = $planetrow['planet_type'] == PT_PLANET ? db_planet_by_parent($planetrow['id']) : db_planet_by_id($planetrow['parent_planet']);
338
-    if($lune) {
338
+    if ($lune) {
339 339
       $template->assign_vars(array(
340 340
         'MOON_ID' => $lune['id'],
341 341
         'MOON_IMG' => $lune['image'],
@@ -347,15 +347,15 @@  discard block
 block discarded – undo
347 347
     $planet_fill = $planet_fill > 100 ? 100 : $planet_fill;
348 348
 
349 349
     $planet_recyclers_orbiting = 0;
350
-    foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
350
+    foreach (sn_get_groups('flt_recyclers') as $recycler_id) {
351 351
       $planet_recyclers_orbiting += mrc_get_level($user, $planetrow, $recycler_id);
352 352
     }
353 353
 
354 354
     int_planet_pretemplate($planetrow, $template);
355 355
 
356 356
     $sn_group_ques = sn_get_groups('ques');
357
-    if(!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) {
358
-      foreach(array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) {
357
+    if (!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) {
358
+      foreach (array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) {
359 359
         $this_que = $que['ques'][$que_id][$user['id']][$planetrow['id']];
360 360
         $template->assign_block_vars('ques', array(
361 361
           'ID'     => $que_id,
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
           'LENGTH' => empty($this_que) ? 0 : count($this_que),
364 364
         ));
365 365
 
366
-        if(!empty($this_que)) {
367
-          foreach($this_que as $que_item) {
366
+        if (!empty($this_que)) {
367
+          foreach ($this_que as $que_item) {
368 368
             $template->assign_block_vars('que', que_tpl_parse_element($que_item));
369 369
           }
370 370
         }
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
       'LENGTH' => $que_hangar_length,
379 379
     ));
380 380
 
381
-    if(!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) {
381
+    if (!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) {
382 382
       $que_hangar_length = tpl_assign_hangar($template, $planetrow, SUBQUE_DEFENSE);
383 383
       $template->assign_block_vars('ques', array(
384 384
         'ID'     => SUBQUE_DEFENSE,
@@ -390,12 +390,12 @@  discard block
 block discarded – undo
390 390
     $overview_planet_rows = $user['opt_int_overview_planet_rows'];
391 391
     $overview_planet_columns = $user['opt_int_overview_planet_columns'];
392 392
 
393
-    if($overview_planet_rows <= 0 && $overview_planet_columns <= 0) {
393
+    if ($overview_planet_rows <= 0 && $overview_planet_columns <= 0) {
394 394
       $overview_planet_rows = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_rows'];
395 395
       $overview_planet_columns = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_columns'];
396 396
     }
397 397
 
398
-    if($overview_planet_rows > 0 && $overview_planet_columns <= 0) {
398
+    if ($overview_planet_rows > 0 && $overview_planet_columns <= 0) {
399 399
       $overview_planet_columns = ceil($planet_count / $overview_planet_rows);
400 400
     }
401 401
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
     ));
453 453
     tpl_set_resource_info($template, $planetrow, $fleets_to_planet, 2);
454 454
 
455
-    foreach($result as &$a_result) {
455
+    foreach ($result as &$a_result) {
456 456
       $template->assign_block_vars('result', $a_result);
457 457
     }
458 458
 
Please login to merge, or discard this patch.
login.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
 include('includes/init.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 // die();
18
-if($template_result[F_USER_IS_AUTHORIZED]) {
18
+if ($template_result[F_USER_IS_AUTHORIZED]) {
19 19
   sys_redirect('index' . DOT_PHP_EX);
20 20
 }
21 21
 lng_include('login');
Please login to merge, or discard this patch.
changelog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 $template = gettemplate('changelog_table');
15 15
 
16 16
 
17
-foreach($lang['changelog'] as $a => $b)
17
+foreach ($lang['changelog'] as $a => $b)
18 18
 {
19 19
 
20 20
   $parse['version_number'] = $a;
Please login to merge, or discard this patch.
market.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $newstock = $stock;
27 27
 $intError = MARKET_DEAL;
28 28
 
29
-switch($mode)
29
+switch ($mode)
30 30
 {
31 31
   case MARKET_RESOURCES: // Resource trader
32 32
     require('includes/includes/market_trader.inc');
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 }
83 83
 
84 84
 $message_id = sys_get_param_int('message');
85
-if($message_id != MARKET_NOTHING)
85
+if ($message_id != MARKET_NOTHING)
86 86
 {
87 87
   $template->assign_block_vars('result', array('MESSAGE' => $lang['eco_mrk_errors'][$message_id]));
88 88
 }
89 89
 
90
-if($message)
90
+if ($message)
91 91
 {
92 92
   $template->assign_block_vars('result', array('MESSAGE' => $message));
93 93
 }
Please login to merge, or discard this patch.
language/en/system.mo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -961,7 +961,7 @@
 block discarded – undo
961 961
     REGISTER_ERROR_USERNAME_WRONG => 'Некорректное имя игрока',
962 962
     REGISTER_ERROR_ACCOUNT_NAME_EXISTS => 'Имя учётной записи уже занято. Попробуйте войти с этим именем и вашим паролем или воспользоваться сбросом пароля',
963 963
     REGISTER_ERROR_PASSWORD_INSECURE => 'Неправильный пароль. Пароль должен состоять минимум из ' . PASSWORD_LENGTH_MIN . ' символов',
964
-    REGISTER_ERROR_USERNAME_SHORT => 'Слишком короткое имя. Имя должно состоять минимум из ' . LOGIN_LENGTH_MIN. ' символов',
964
+    REGISTER_ERROR_USERNAME_SHORT => 'Слишком короткое имя. Имя должно состоять минимум из ' . LOGIN_LENGTH_MIN . ' символов',
965 965
     REGISTER_ERROR_PASSWORD_DIFFERENT => 'Пароль и проверочный пароль не совпадают. Проверьте правильность ввода',
966 966
     REGISTER_ERROR_EMAIL_EMPTY => 'Е-Мейл не может быть пустым',
967 967
     REGISTER_ERROR_EMAIL_WRONG => 'Введенный Е-Мейл не является допустимым адресом электронной почты. Проверьте написание Е-Мейла или используйте другой адрес почтового ящика',
Please login to merge, or discard this patch.
admin/includes/admin_planet_edit.inc.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
     ));
116 116
 
117 117
     display($template, $lang['tech'][STRUC_MOON_GATE]);
118
-  }
119
-  else
118
+  } else
120 119
   {
121 120
     message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10);
122 121
   }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list){return sn_function_call(__FUNCTION__, array(&$template, &$admin_planet_edit_mode_list));}
3
+function admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list) {return sn_function_call(__FUNCTION__, array(&$template, &$admin_planet_edit_mode_list)); }
4 4
 function sn_admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list)
5 5
 {
6 6
   global $lang;
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
   return $mode;
20 20
 }
21 21
 
22
-function admin_planet_edit_template(&$template, $edit_planet_row, $mode){return sn_function_call(__FUNCTION__, array(&$template, $edit_planet_row, $mode));}
22
+function admin_planet_edit_template(&$template, $edit_planet_row, $mode) {return sn_function_call(__FUNCTION__, array(&$template, $edit_planet_row, $mode)); }
23 23
 function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode)
24 24
 {
25 25
   global $lang;
26 26
 
27 27
   $unit_list = sn_get_groups($mode);
28
-  if(empty($unit_list))
28
+  if (empty($unit_list))
29 29
   {
30 30
     return;
31 31
   }
32 32
   $name_list = $lang['tech'];
33 33
 
34
-  foreach($unit_list as $unit_id)
34
+  foreach ($unit_list as $unit_id)
35 35
   {
36 36
     $template->assign_block_vars('unit', array(
37 37
       'ID'    => $unit_id,
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
   }
43 43
 }
44 44
 
45
-function admin_planet_edit_query_string($unit_id, $unit_amount, $mode){return sn_function_call(__FUNCTION__, array($unit_id, $unit_amount, $mode));}
45
+function admin_planet_edit_query_string($unit_id, $unit_amount, $mode) {return sn_function_call(__FUNCTION__, array($unit_id, $unit_amount, $mode)); }
46 46
 function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode)
47 47
 {
48
-  if($unit_amount && in_array($unit_id, sn_get_groups($mode)))
48
+  if ($unit_amount && in_array($unit_id, sn_get_groups($mode)))
49 49
   {
50 50
     $unit_amount = round($unit_amount);
51 51
     $unit_name = get_unit_param($unit_id, P_NAME);
Please login to merge, or discard this patch.