Test Failed
Branch trunk (c9c94d)
by SuperNova.WS
10:03 queued 05:45
created
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.
annonce.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,25 +18,25 @@  discard block
 block discarded – undo
18 18
 
19 19
 lng_include('announce');
20 20
 
21
-switch($action)
21
+switch ($action)
22 22
 {
23 23
   case 1://on veut poster une annonce
24
-    $page .='<HTML>
24
+    $page .= '<HTML>
25 25
     <center>
26 26
     <br>
27 27
     <table width="600">
28
-    <td class="c" colspan="10" align="center"><b><font color="white">'.$lang['Classifieds'].'</font></b></td></tr>
28
+    <td class="c" colspan="10" align="center"><b><font color="white">'.$lang['Classifieds'] . '</font></b></td></tr>
29 29
     <form action="annonce.php?action=2" method="post">
30
-    <td class="c" colspan="10" align="center"><b>'.$lang['Resources_to_be_sold'].'</font></b></td>
31
-    <tr><th colspan="5">'.$lang['metal'].'</th><th colspan="5"><input type="texte" value="0" name="metalvendre" /></th></tr>
32
-    <tr><th colspan="5">'.$lang['crystal'].'</th><th colspan="5"><input type="texte" value="0" name="cristalvendre" /></th></tr>
33
-    <tr><th colspan="5">'.$lang['deuterium'].'</th><th colspan="5"><input type="texte" value="0" name="deutvendre" /></th></tr>
30
+    <td class="c" colspan="10" align="center"><b>'.$lang['Resources_to_be_sold'] . '</font></b></td>
31
+    <tr><th colspan="5">'.$lang['metal'] . '</th><th colspan="5"><input type="texte" value="0" name="metalvendre" /></th></tr>
32
+    <tr><th colspan="5">'.$lang['crystal'] . '</th><th colspan="5"><input type="texte" value="0" name="cristalvendre" /></th></tr>
33
+    <tr><th colspan="5">'.$lang['deuterium'] . '</th><th colspan="5"><input type="texte" value="0" name="deutvendre" /></th></tr>
34 34
 
35
-    <td class="c" colspan="10" align="center"><b>'.$lang['Desired_resources'].'</font></b></td></tr>
36
-    <tr><th colspan="5">'.$lang['metal'].'</th><th colspan="5"><input type="texte" value="0" name="metalsouhait" /></th></tr>
37
-    <tr><th colspan="5">'.$lang['crystal'].'</th><th colspan="5"><input type="texte" value="0" name="cristalsouhait" /></th></tr>
38
-    <tr><th colspan="5">'.$lang['deuterium'].'</th><th colspan="5"><input type="texte" value="0" name="deutsouhait" /></th></tr>
39
-    <tr><th colspan="10"><input type="submit" value="'.$lang['send'].'" /></th></tr>
35
+    <td class="c" colspan="10" align="center"><b>'.$lang['Desired_resources'] . '</font></b></td></tr>
36
+    <tr><th colspan="5">'.$lang['metal'] . '</th><th colspan="5"><input type="texte" value="0" name="metalsouhait" /></th></tr>
37
+    <tr><th colspan="5">'.$lang['crystal'] . '</th><th colspan="5"><input type="texte" value="0" name="cristalsouhait" /></th></tr>
38
+    <tr><th colspan="5">'.$lang['deuterium'] . '</th><th colspan="5"><input type="texte" value="0" name="deutsouhait" /></th></tr>
39
+    <tr><th colspan="10"><input type="submit" value="'.$lang['send'] . '" /></th></tr>
40 40
 
41 41
     <form>
42 42
     </table>
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
     $deutvendre = sys_get_param_float('deutvendre');
54 54
     $deutsouhait = sys_get_param_float('deutsouhait');
55 55
 
56
-    if(($metalvendre!=0 && $metalsouhait==0) ||($cristalvendre!=0 && $cristalsouhait==0) || ($deutvendre!=0 && $deutsouhait==0))
56
+    if (($metalvendre != 0 && $metalsouhait == 0) || ($cristalvendre != 0 && $cristalsouhait == 0) || ($deutvendre != 0 && $deutsouhait == 0))
57 57
     {
58 58
       doquery("INSERT INTO {{annonce}} SET `user` ='{$users['username']}', `galaxie` ='{$users['galaxy']}', `systeme` ='{$users['system']}', `metala` ='{$metalvendre}', `cristala` ='{$cristalvendre}', `deuta` ='{$deutvendre}', `metals` ='{$metalsouhait}', `cristals` ='{$cristalsouhait}', `deuts` ='{$deutsouhait}'");
59
-      message ($lang['Your_announce_was_recorded'], $lang['announce_status'],"annonce.php");
59
+      message($lang['Your_announce_was_recorded'], $lang['announce_status'], "annonce.php");
60 60
     }
61 61
     else
62 62
     {
63
-      message ($lang['Your_announce_not_recorded'], $lang['announce_status'],"annonce.php?action=1");
63
+      message($lang['Your_announce_not_recorded'], $lang['announce_status'], "annonce.php?action=1");
64 64
     }
65 65
   break;
66 66
 
67 67
   case 3://Suppression d'annonce
68 68
     doquery("DELETE FROM {{annonce}} WHERE `id` = {$GET_id}");
69
-    message ($lang['Your_announce_was_deleted'], $lang['announce_status'],"annonce.php");
69
+    message($lang['Your_announce_was_deleted'], $lang['announce_status'], "annonce.php");
70 70
   break;
71 71
 
72 72
   default://Sinon on affiche la liste des annonces
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
     while ($b = db_fetch($annonce))
82 82
     {
83 83
       $page2 .= '<tr><th>';
84
-      foreach($b as $name => $value)
84
+      foreach ($b as $name => $value)
85 85
       {
86
-        if($name!='id')
86
+        if ($name != 'id')
87 87
         {
88
-          $page2 .= $value ;
88
+          $page2 .= $value;
89 89
           $page2 .= '</th><th>';
90 90
         }
91 91
       }
92
-      $page2 .= ($b['user']==$users['username'])?"<a href=\"annonce.php?action=3&id={$b[id]}\">X</a></th></tr>":"</th></tr>";
92
+      $page2 .= ($b['user'] == $users['username']) ? "<a href=\"annonce.php?action=3&id={$b[id]}\">X</a></th></tr>" : "</th></tr>";
93 93
     }
94 94
 
95 95
     $page2 .= "<tr><th colspan=\"10\" align=\"center\"><a href=\"annonce.php?action=1\">{$lang['add_announce']}</a></th></tr></td></table></HTML>";
Please login to merge, or discard this patch.
classes/auth_abstract.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
    */
36 36
   // OK 4.9
37 37
   public function __construct($filename = __FILE__) {
38
-    if($this->provider_id == ACCOUNT_PROVIDER_NONE) {
38
+    if ($this->provider_id == ACCOUNT_PROVIDER_NONE) {
39 39
       die('У всех провайдеров должен быть $provider_id!');
40 40
     }
41 41
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
   // OK 4.6
134 134
   public function player_name_suggest() {
135 135
     $name = '';
136
-    if(is_object($this->account) && !empty($this->account->account_email)) {
136
+    if (is_object($this->account) && !empty($this->account->account_email)) {
137 137
       list($name) = explode('@', $this->account->account_email);
138 138
     }
139 139
 
Please login to merge, or discard this patch.
classes/Confirmation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
       // $query = static::$db->doquery("SELECT `id` FROM {{confirmations}} WHERE `code` = '{$confirm_code_safe}' AND `type` = {$confirmation_type_safe} FOR UPDATE", true);
42 42
       // Тип не нужен для проверки - код подтверждения должен быть уникален от слова "совсем"
43 43
       $query = $this->db->doquery("SELECT `id` FROM {{confirmations}} WHERE `code` = '{$confirm_code_safe}' FOR UPDATE", true);
44
-    } while($query);
44
+    } while ($query);
45 45
 
46 46
     $this->db->doquery(
47 47
       "REPLACE INTO {{confirmations}}
Please login to merge, or discard this patch.
classes/Pimple/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 
240 240
         $factory = $this->values[$id];
241 241
 
242
-        $extended = function ($c) use ($callable, $factory) {
242
+        $extended = function($c) use ($callable, $factory) {
243 243
             return $callable($factory($c), $c);
244 244
         };
245 245
 
Please login to merge, or discard this patch.
classes/PlayerToAccountTranslate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
   protected static $is_init = false;
20 20
 
21 21
   protected static function init() {
22
-    if(!empty(static::$db)) {
22
+    if (!empty(static::$db)) {
23 23
       return;
24 24
     }
25 25
     static::$db = classSupernova::$db;
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
     $provider_id_safe = intval($provider_id_unsafe);
67 67
     !is_array($account_list) ? $account_list = array($account_list) : false;
68 68
 
69
-    foreach($account_list as $provider_account_id_unsafe) {
69
+    foreach ($account_list as $provider_account_id_unsafe) {
70 70
       $provider_account_id_safe = intval($provider_account_id_unsafe);
71 71
 
72 72
       // TODO - Здесь могут отсутствовать аккаунты - проверять провайдером
73 73
       $query = static::$db->doquery("SELECT `user_id` FROM {{account_translate}} WHERE `provider_id` = {$provider_id_safe} AND `provider_account_id` = {$provider_account_id_safe} FOR UPDATE");
74
-      while($row = static::$db->db_fetch($query)) {
74
+      while ($row = static::$db->db_fetch($query)) {
75 75
         $account_translation[$row['user_id']][$provider_id_unsafe][$provider_account_id_unsafe] = true;
76 76
       }
77 77
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
       "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} " .
92 92
       ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : '') .
93 93
       "ORDER BY `timestamp` FOR UPDATE");
94
-    while($row = static::$db->db_fetch($query)) {
94
+    while ($row = static::$db->db_fetch($query)) {
95 95
       $account_translation[$row['user_id']][$row['provider_id']][$row['provider_account_id']] = $row;
96 96
     }
97 97
 
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
       DBStaticPlanet::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 < classSupernova::$config->planet_capital_cost) {
70
+        if ($user_dark_matter < classSupernova::$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
         DBStaticPlanet::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
           DBStaticPlanet::db_planet_set_by_id($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0");
150 150
           DBStaticPlanet::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 = DBStaticPlanet::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
       DBStaticPlanet::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 = DBStaticPlanet::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 = DBStaticPlanet::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 ? DBStaticPlanet::db_planet_by_parent($planetrow['id']) : DBStaticPlanet::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.
metamatter.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 include_once('common.' . substr(strrchr(__FILE__, '.'), 1));
10 10
 
11
-if(!sn_module_get_active_count('payment')) {
11
+if (!sn_module_get_active_count('payment')) {
12 12
   sys_redirect('dark_matter.php');
13 13
   die();
14 14
 }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // $player_currency_default = player_load_option($user, PLAYER_OPTION_CURRENCY_DEFAULT);
24 24
 $player_currency_default = classSupernova::$user_options[PLAYER_OPTION_CURRENCY_DEFAULT];
25 25
 $player_currency = sys_get_param_str('player_currency', $player_currency_default);
26
-empty($lang['pay_currency_list'][$player_currency]) ? ($player_currency =  $player_currency_default ? $player_currency_default : classSupernova::$config->payment_currency_default) : false;
26
+empty($lang['pay_currency_list'][$player_currency]) ? ($player_currency = $player_currency_default ? $player_currency_default : classSupernova::$config->payment_currency_default) : false;
27 27
 // $player_currency_default != $player_currency ? player_save_option($user, PLAYER_OPTION_CURRENCY_DEFAULT, $player_currency) : false;
28 28
 $player_currency_default != $player_currency ? classSupernova::$user_options[PLAYER_OPTION_CURRENCY_DEFAULT] = $player_currency : false;
29 29
 
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
 // Таблица скидок
67 67
 $prev_discount = 0;
68
-if(isset(sn_module_payment::$bonus_table) && is_array(sn_module_payment::$bonus_table)) {
69
-  foreach(sn_module_payment::$bonus_table as $sum => $discount) {
70
-    if($discount && $discount != $prev_discount) {
68
+if (isset(sn_module_payment::$bonus_table) && is_array(sn_module_payment::$bonus_table)) {
69
+  foreach (sn_module_payment::$bonus_table as $sum => $discount) {
70
+    if ($discount && $discount != $prev_discount) {
71 71
       $template->assign_block_vars('discount', array(
72 72
         'SUM' => $sum,
73 73
         'DISCOUNT' => $discount * 100,
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
 }
81 81
 
82 82
 // Результат платежа
83
-if($payment_id = sys_get_param_id('payment_id')) {
83
+if ($payment_id = sys_get_param_id('payment_id')) {
84 84
   $payment = doquery("SELECT * FROM {{payment}} WHERE `payment_id` = {$payment_id} LIMIT 1;", true);
85
-  if($payment && $payment['payment_user_id'] == $user['id']) {
86
-    if($payment['payment_status'] == PAYMENT_STATUS_COMPLETE) {
85
+  if ($payment && $payment['payment_user_id'] == $user['id']) {
86
+    if ($payment['payment_status'] == PAYMENT_STATUS_COMPLETE) {
87 87
       $template->assign_block_vars('result', array('MESSAGE' => sprintf($lang['pay_msg_mm_purchase_complete'], $payment['payment_dark_matter_paid'], $payment['payment_module_name'], $payment['payment_dark_matter_gained'])));
88 88
     }
89
-    if($payment['payment_status'] == PAYMENT_STATUS_NONE) {
89
+    if ($payment['payment_status'] == PAYMENT_STATUS_NONE) {
90 90
       $template->assign_block_vars('result', array(
91 91
         'MESSAGE' => sprintf($lang['pay_msg_mm_purchase_incomplete'], $payment['payment_dark_matter_paid'], $payment['payment_module_name']),
92 92
         'STATUS' => 1,
93 93
       ));
94 94
     }
95
-    if($payment['payment_test']) {
95
+    if ($payment['payment_test']) {
96 96
       $template->assign_block_vars('result', array(
97 97
         'MESSAGE' => sprintf($lang['pay_msg_mm_purchase_test']),
98 98
         'STATUS' => -1,
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
   'metamatter' => sys_get_param_float('metamatter'),
108 108
 );
109 109
 
110
-if(!$request['metamatter']) {
110
+if (!$request['metamatter']) {
111 111
   unset($_POST);
112 112
 }
113 113
 
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
 
119 119
 $payment_module_valid = false;
120 120
 $payment_module = sys_get_param_str('payment_module');
121
-foreach($sn_module_list['payment'] as $module_name => $module) {
122
-  if(!is_object($module) || !$module->manifest['active']) {
121
+foreach ($sn_module_list['payment'] as $module_name => $module) {
122
+  if (!is_object($module) || !$module->manifest['active']) {
123 123
     continue;
124 124
   }
125 125
 
126 126
   lng_include($module_name, $module->manifest['root_relative']);
127 127
 
128
-  foreach(sn_module_payment::$payment_methods as $payment_type_id => $available_methods) {
129
-    foreach($available_methods as $payment_method => $payment_currency) {
130
-      if(isset($module->manifest['payment_method'][$payment_method])) {
128
+  foreach (sn_module_payment::$payment_methods as $payment_type_id => $available_methods) {
129
+    foreach ($available_methods as $payment_method => $payment_currency) {
130
+      if (isset($module->manifest['payment_method'][$payment_method])) {
131 131
         $payment_methods_available[$payment_type_id][$payment_method][$module_name] = $module->manifest['payment_method'][$payment_method];
132 132
       }
133 133
     }
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 
139 139
 global $template_result;
140 140
 // Доступные платежные методы
141
-foreach($payment_methods_available as $payment_type_id => $payment_methods) {
142
-  if(empty($payment_methods)) continue;
141
+foreach ($payment_methods_available as $payment_type_id => $payment_methods) {
142
+  if (empty($payment_methods)) continue;
143 143
 
144
-  $template_result['.']['payment'][$payment_type_id] =array(
144
+  $template_result['.']['payment'][$payment_type_id] = array(
145 145
     'ID' => $payment_type_id,
146 146
     'NAME' => $lang['pay_methods'][$payment_type_id],
147 147
   );
148
-  foreach($payment_methods as $payment_method_id => $module_list) {
149
-    if(empty($module_list)) {
148
+  foreach ($payment_methods as $payment_method_id => $module_list) {
149
+    if (empty($module_list)) {
150 150
       continue;
151 151
     }
152 152
     $template_result['.']['payment'][$payment_type_id]['.']['method'][$payment_method_id] = array(
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
       'NAME_FORCE' => isset(sn_module_payment::$payment_methods[$payment_type_id][$payment_method_id]['name']),
158 158
       'BUTTON'     => isset(sn_module_payment::$payment_methods[$payment_type_id][$payment_method_id]['button']),
159 159
     );
160
-    foreach($module_list as $payment_module_name => $payment_module_method_details) {
160
+    foreach ($module_list as $payment_module_name => $payment_module_method_details) {
161 161
       $template_result['.']['payment'][$payment_type_id]['.']['method'][$payment_method_id]['.']['module'][] = array(
162 162
         'MODULE' => $payment_module_name,
163 163
       );
164 164
     }
165 165
   }
166 166
 
167
-  if(empty($template_result['.']['payment'][$payment_type_id]['.'])) {
167
+  if (empty($template_result['.']['payment'][$payment_type_id]['.'])) {
168 168
     unset($template_result['.']['payment'][$payment_type_id]);
169 169
   }
170 170
 }
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
 $payment_module_valid = $payment_module_valid && (!$payment_method_selected || isset($payment_methods_available[$payment_type_selected][$payment_method_selected][$module_name]));
178 178
 
179 179
 // If payment_module invalid - making it empty OR if there is only one payment_module - selecting it
180
-if($payment_module_valid) {
180
+if ($payment_module_valid) {
181 181
   // $payment_module = $payment_module; // Really - do nothing
182
-} elseif($payment_type_selected && count($payment_methods_available[$payment_type_selected][$payment_method_selected]) == 1) {
182
+} elseif ($payment_type_selected && count($payment_methods_available[$payment_type_selected][$payment_method_selected]) == 1) {
183 183
   reset($payment_methods_available[$payment_type_selected][$payment_method_selected]);
184 184
   $payment_module = key($payment_methods_available[$payment_type_selected][$payment_method_selected]);
185
-} elseif(count($sn_module_list['payment']) == 1) {
185
+} elseif (count($sn_module_list['payment']) == 1) {
186 186
   $payment_module = $module_name;
187 187
 } else {
188 188
   $payment_module = '';
189 189
 }
190 190
 
191
-if($payment_type_selected && $payment_method_selected) {
192
-  foreach($payment_methods_available[$payment_type_selected][$payment_method_selected] as $module_name => $temp) {
191
+if ($payment_type_selected && $payment_method_selected) {
192
+  foreach ($payment_methods_available[$payment_type_selected][$payment_method_selected] as $module_name => $temp) {
193 193
     $template->assign_block_vars('payment_module', array(
194 194
       'ID' => $module_name,
195 195
       'NAME' => $lang["module_{$module_name}_name"],
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
   }
199 199
 }
200 200
 
201
-foreach($lang['pay_currency_list'] as $key => $value) {
201
+foreach ($lang['pay_currency_list'] as $key => $value) {
202 202
   $course = get_exchange_rate($key);
203
-  if(!$course) {
203
+  if (!$course) {
204 204
     continue;
205 205
   }
206 206
   $template->assign_block_vars('exchange', array(
@@ -214,17 +214,17 @@  discard block
 block discarded – undo
214 214
   ));
215 215
 }
216 216
 
217
-if($request['metamatter'] && $payment_module) {
217
+if ($request['metamatter'] && $payment_module) {
218 218
   try {
219 219
     // Any possible errors about generating paylink should be raised in module!
220 220
     $pay_link = $sn_module[$payment_module]->compile_request($request);
221 221
 
222 222
     // Поддержка дополнительной информации
223
-    if(is_array($pay_link['RENDER'])) {
224
-      foreach($pay_link['RENDER'] as $html_data) {
223
+    if (is_array($pay_link['RENDER'])) {
224
+      foreach ($pay_link['RENDER'] as $html_data) {
225 225
         $template->assign_block_vars('render', $html_data);
226
-        if(isset($html_data['VALUE']) && is_array($html_data['VALUE'])) {
227
-          foreach($html_data['VALUE'] as $value_id => $value_value) {
226
+        if (isset($html_data['VALUE']) && is_array($html_data['VALUE'])) {
227
+          foreach ($html_data['VALUE'] as $value_id => $value_value) {
228 228
             $template->assign_block_vars('render.value', array(
229 229
               'FIELD' => $value_id,
230 230
               'VALUE' => $value_value,
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
     }
236 236
 
237 237
     // Поддержка передачи данных для многошаговых платежных систем
238
-    if(is_array($pay_link['DATA'])) {
239
-      foreach($pay_link['DATA'] as $key => $value) {
238
+    if (is_array($pay_link['DATA'])) {
239
+      foreach ($pay_link['DATA'] as $key => $value) {
240 240
         $template->assign_block_vars('pay_link_data', array(
241 241
           'FIELD' => $key,
242 242
           'VALUE' => $value,
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
       }
245 245
     }
246 246
 
247
-    if(is_array($pay_link) && in_array($pay_link['PAY_LINK_METHOD'], array('POST', 'GET', 'LINK', 'STEP'))) {
247
+    if (is_array($pay_link) && in_array($pay_link['PAY_LINK_METHOD'], array('POST', 'GET', 'LINK', 'STEP'))) {
248 248
       // TODO Переделать это под assign_vars_recursive и возвращать пустые строки если нет платежного метода - для унификации формы в темплейте
249 249
       $template->assign_vars(array(
250 250
         'PAY_LINK_METHOD' => $pay_link['PAY_LINK_METHOD'],
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     } else {
254 254
       throw new exception($lang['pay_msg_request_paylink_unsupported'], ERR_ERROR);
255 255
     }
256
-  } catch(exception $e) {
256
+  } catch (exception $e) {
257 257
     $template->assign_block_vars('result', $response = array(
258 258
       'STATUS'  => $e->getCode(),
259 259
       'MESSAGE' => $e->getMessage(),
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 }
264 264
 
265 265
 // Прегенерированные пакеты
266
-foreach($unit_available_amount_list as $unit_amount => $discount) {
266
+foreach ($unit_available_amount_list as $unit_amount => $discount) {
267 267
   $temp = sn_module_payment::currency_convert($unit_amount, 'MM_', $player_currency);
268 268
   $template->assign_block_vars('mm_amount', array(
269 269
     'VALUE' => $unit_amount,
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
   'PLAYER_CURRENCY' => $player_currency,
299 299
   'PLAYER_CURRENCY_PRICE_PER_MM' => sn_module_payment::currency_convert(1, $player_currency, 'MM_', 10),
300 300
 
301
-  'UNIT_AMOUNT' => (float)$request['metamatter'],
301
+  'UNIT_AMOUNT' => (float) $request['metamatter'],
302 302
   'UNIT_AMOUNT_TEXT' => pretty_number($request['metamatter']),
303 303
   'UNIT_AMOUNT_BONUS_PERCENT' => $bonus_percent,
304 304
   'UNIT_AMOUNT_TEXT_DISCOUNTED' => $income_metamatter_text,
Please login to merge, or discard this patch.
alliance.php 1 patch
Spacing   +15 added lines, -15 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(classSupernova::$config->game_mode == GAME_BLITZ) {
5
+if (classSupernova::$config->game_mode == GAME_BLITZ) {
6 6
   message($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10);
7 7
   die();
8 8
 }
@@ -14,21 +14,21 @@  discard block
 block discarded – undo
14 14
 
15 15
 $mode = sys_get_param_str('mode');
16 16
 
17
-if($mode == 'ainfo')
17
+if ($mode == 'ainfo')
18 18
 {
19 19
   include('includes/alliance/ali_info.inc');
20 20
 }
21 21
 
22
-if(!$user['ally_id'])
22
+if (!$user['ally_id'])
23 23
 {
24 24
   $user_request = doquery("SELECT * FROM {{alliance_requests}} WHERE `id_user` ='{$user['id']}' LIMIT 1;", '', true);
25
-  if($user_request['id_user'])
25
+  if ($user_request['id_user'])
26 26
   {
27 27
     require('includes/alliance/ali_external_request.inc');
28 28
   }
29 29
   else
30 30
   {
31
-    switch($mode)
31
+    switch ($mode)
32 32
     {
33 33
       case 'search':
34 34
         require('includes/alliance/ali_external_search.inc');
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 sn_ali_fill_user_ally($user);
53 53
 //$ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$user['ally_id']}'", '', true);
54
-if(!isset($user['ally']))
54
+if (!isset($user['ally']))
55 55
 {
56 56
   db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_register_time` = 0, `ally_rank_id` = 0");
57 57
   message($lang['ali_sys_notFound'], $lang['your_alliance'], 'alliance.php');
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 
81 81
 // This piece converting old ally data to new one
82 82
 //  unset($ally['ranklist']);
83
-if(!$ally['ranklist'] && $ally['ally_ranks'])
83
+if (!$ally['ranklist'] && $ally['ally_ranks'])
84 84
 {
85 85
   $ally_ranks = unserialize($ally['ally_ranks']);
86 86
   $i = 0;
87
-  foreach($ally_ranks as $rank_id => $rank)
87
+  foreach ($ally_ranks as $rank_id => $rank)
88 88
   {
89
-    foreach($ally_rights as $key => $value)
89
+    foreach ($ally_rights as $key => $value)
90 90
     {
91 91
       $ranks[$i][$value] = $rank[$rights_old[$key]];
92 92
     }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     $i++;
95 95
   }
96 96
 
97
-  if(!empty($ranks))
97
+  if (!empty($ranks))
98 98
   {
99 99
     ali_rank_list_save($ranks);
100 100
   }
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
 
114 114
 $edit = sys_get_param_str('edit');
115 115
 ally_pre_call();
116
-switch($mode)
116
+switch ($mode)
117 117
 {
118 118
   case 'admin':
119
-    if(!array_key_exists($edit , $sn_ali_admin_internal))
119
+    if (!array_key_exists($edit, $sn_ali_admin_internal))
120 120
     {
121 121
       $edit = 'default';
122 122
     }
123
-    if($sn_ali_admin_internal[$edit]['include'])
123
+    if ($sn_ali_admin_internal[$edit]['include'])
124 124
     {
125 125
       require("includes/{$sn_ali_admin_internal[$edit]['include']}");
126 126
     }
127
-    if(isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function']))
127
+    if (isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function']))
128 128
     {
129 129
       call_user_func($sn_ali_admin_internal[$edit]['function']);
130 130
     }
@@ -135,6 +135,6 @@  discard block
 block discarded – undo
135 135
   default:             require('includes/alliance/ali_info.inc'); break;
136 136
 }
137 137
 
138
-function ally_pre_call(){$func_args = func_get_args();return sn_function_call('ally_pre_call', $func_args);}
138
+function ally_pre_call() {$func_args = func_get_args(); return sn_function_call('ally_pre_call', $func_args); }
139 139
 
140 140
 ?>
Please login to merge, or discard this patch.