Completed
Push — work-fleets ( 9e446e...674b8a )
by SuperNova.WS
12:48 queued 05:50
created
includes/functions/rpg_points.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@
 block discarded – undo
61 61
     } else {
62 62
       $changeset['dark_matter_total'] = +$dark_matter;
63 63
     }
64
-    if($dark_matter) {
64
+    if ($dark_matter) {
65 65
       $changeset[$sn_data_dark_matter_db_name] = +$dark_matter;
66 66
     }
67
-    if(!empty($changeset)) {
67
+    if (!empty($changeset)) {
68 68
       DBStaticUser::db_user_adjust_by_id($user_id, $changeset);
69 69
     }
70 70
     $rows_affected = classSupernova::$db->db_affected_rows();
Please login to merge, or discard this patch.
includes/functions/lng_language.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,14 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // ----------------------------------------------------------------------------------------------------------------
4
-function lng_try_filepath($path, $file_path_relative)
5
-{
4
+function lng_try_filepath($path, $file_path_relative) {
6 5
   $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative;
7 6
   return file_exists($file_path) ? $file_path : false;
8 7
 }
9 8
 
10
-function lng_die_not_an_object()
11
-{
9
+function lng_die_not_an_object() {
12 10
   print('Ошибка - lang не объект! Сообщите Администратору сервера и приложите содержимое страницы');
13 11
   $trace = debug_backtrace();
14 12
   unset($trace[0]);
@@ -17,27 +15,22 @@  discard block
 block discarded – undo
17 15
 }
18 16
 
19 17
 // ----------------------------------------------------------------------------------------------------------------
20
-function lng_include($filename, $path = '', $ext = '.mo.php')
21
-{
18
+function lng_include($filename, $path = '', $ext = '.mo.php') {
22 19
   return is_object(classLocale::$lang) ? classLocale::$lang->lng_include($filename, $path, $ext) : lng_die_not_an_object();
23 20
 }
24 21
 
25
-function lng_get_list()
26
-{
22
+function lng_get_list() {
27 23
   return is_object(classLocale::$lang) ? classLocale::$lang->lng_get_list() : lng_die_not_an_object();
28 24
 }
29 25
 
30
-function lng_get_info($entry)
31
-{
26
+function lng_get_info($entry) {
32 27
   return is_object(classLocale::$lang) ? classLocale::$lang->lng_get_info($entry) : lng_die_not_an_object();
33 28
 }
34 29
 
35
-function lng_switch($language_new)
36
-{
30
+function lng_switch($language_new) {
37 31
   return is_object(classLocale::$lang) ? classLocale::$lang->lng_switch($language_new) : lng_die_not_an_object();
38 32
 }
39 33
 
40
-function lng_load_i18n($i18n)
41
-{
34
+function lng_load_i18n($i18n) {
42 35
   return is_object(classLocale::$lang) ? classLocale::$lang->lng_load_i18n($i18n) : lng_die_not_an_object();
43 36
 }
Please login to merge, or discard this patch.
galaxy.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $uni_system = sys_get_param_int('system', $planetrow['system']);
22 22
 $planet = sys_get_param_int('planet', $planetrow['planet']);
23 23
 
24
-if($mode == 'name') {
24
+if ($mode == 'name') {
25 25
   require_once('includes/includes/uni_rename.php');
26 26
 }
27 27
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 
43 43
 $flying_fleet_count = FleetList::fleet_count_flying($user['id']);
44 44
 
45
-if($mode == 1) {
46
-} elseif($mode == 2 || $mode == 3) {
45
+if ($mode == 1) {
46
+} elseif ($mode == 2 || $mode == 3) {
47 47
   $planet = $planetrow['planet'];
48 48
 } else {
49 49
   $uni_galaxy = $planetrow['galaxy'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
   $planet = $planetrow['planet'];
52 52
 }
53 53
 
54
-$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies? Vector::$knownGalaxies: $uni_galaxy);
54
+$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies ? Vector::$knownGalaxies : $uni_galaxy);
55 55
 $uni_system = $uni_system < 1 ? 1 : ($uni_system > Vector::$knownSystems ? Vector::$knownSystems : $uni_system);
56 56
 $planet = $planet < 1 ? 1 : ($planet > Vector::$knownPlanets + 1 ? Vector::$knownPlanets + 1 : $planet);
57 57
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 $PhalanxRange = GetPhalanxRange($HavePhalanx);
70 70
 
71 71
 $planet_precache_query = DBStaticPlanet::db_planet_list_in_system($uni_galaxy, $uni_system);
72
-if(!empty($planet_precache_query)) {
73
-  foreach($planet_precache_query as $planet_row) {
72
+if (!empty($planet_precache_query)) {
73
+  foreach ($planet_precache_query as $planet_row) {
74 74
     $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row;
75 75
   }
76 76
 }
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
  * @var Fleet[][][] $fleet_list
89 89
  */
90 90
 $fleet_list = array();
91
-foreach($system_fleet_list->_container as $objFleetSystem) {
92
-  if(!$objFleetSystem->isReturning()) {
91
+foreach ($system_fleet_list->_container as $objFleetSystem) {
92
+  if (!$objFleetSystem->isReturning()) {
93 93
     $fleet_planet = $objFleetSystem->fleet_end_planet;
94 94
     $fleet_type = $objFleetSystem->fleet_end_type;
95 95
   } else {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 $recycler_info = array();
105 105
 $planet_recyclers_orbiting = 0;
106 106
 $recyclers_fleet = array();
107
-foreach(classSupernova::$gc->groupRecyclers as $recycler_id) {
107
+foreach (classSupernova::$gc->groupRecyclers as $recycler_id) {
108 108
   $recycler_info[$recycler_id] = get_ship_data($recycler_id, $user);
109 109
   $recyclers_fleet[$recycler_id] = mrc_get_level($user, $planetrow, $recycler_id);
110 110
   $planet_recyclers_orbiting += $recyclers_fleet[$recycler_id];
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 $fleet_id = 1;
115 115
 $fleets = array();
116 116
 $config_game_max_planet = Vector::$knownPlanets + 1;
117
-for($Planet = 1; $Planet < $config_game_max_planet; $Planet++) {
117
+for ($Planet = 1; $Planet < $config_game_max_planet; $Planet++) {
118 118
   unset($uni_galaxyRowPlanet);
119 119
   unset($uni_galaxyRowMoon);
120 120
   unset($uni_galaxyRowUser);
@@ -124,17 +124,17 @@  discard block
 block discarded – undo
124 124
   $uni_galaxyRowPlanet = $planet_list[$Planet][PT_PLANET];
125 125
 
126 126
   $planet_fleet_id = 0;
127
-  if($uni_galaxyRowPlanet['destruyed']) {
127
+  if ($uni_galaxyRowPlanet['destruyed']) {
128 128
     CheckAbandonPlanetState($uni_galaxyRowPlanet);
129
-  } elseif($uni_galaxyRowPlanet['id']) {
130
-    if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) {
129
+  } elseif ($uni_galaxyRowPlanet['id']) {
130
+    if ($cached['users'][$uni_galaxyRowPlanet['id_owner']]) {
131 131
       $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']];
132 132
     } else {
133 133
       $uni_galaxyRowUser = DBStaticUser::db_user_by_id($uni_galaxyRowPlanet['id_owner']);
134 134
       $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser;
135 135
     }
136 136
 
137
-    if(!$uni_galaxyRowUser['id']) {
137
+    if (!$uni_galaxyRowUser['id']) {
138 138
       classSupernova::$debug->warning("Planet '{$uni_galaxyRowPlanet['name']}' [{$uni_galaxy}:{$uni_system}:{$Planet}] has no owner!", 'Userless planet', 503);
139 139
       $uni_galaxyRowPlanet['destruyed'] = SN_TIME_NOW + 60 * 60 * 24;
140 140
       $uni_galaxyRowPlanet['id_owner'] = 0;
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
       );
148 148
     }
149 149
 
150
-    if($uni_galaxyRowUser['id']) {
150
+    if ($uni_galaxyRowUser['id']) {
151 151
       $planetcount++;
152
-      if($uni_galaxyRowUser['ally_id']) {
153
-        if($cached['allies'][$uni_galaxyRowUser['ally_id']]) {
152
+      if ($uni_galaxyRowUser['ally_id']) {
153
+        if ($cached['allies'][$uni_galaxyRowUser['ally_id']]) {
154 154
           $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']];
155 155
         } else {
156 156
           $allyquery = DBStaticAlly::db_ally_get_by_id($uni_galaxyRowUser['ally_id']);
@@ -159,19 +159,19 @@  discard block
 block discarded – undo
159 159
       }
160 160
 
161 161
       $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_PLANET]);
162
-      if(!empty($fleets_to_planet['own']['count'])) {
162
+      if (!empty($fleets_to_planet['own']['count'])) {
163 163
         $planet_fleet_id = $fleet_id;
164 164
         $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id);
165 165
         $fleet_id++;
166 166
       }
167 167
 
168 168
       $uni_galaxyRowMoon = $planet_list[$Planet][PT_MOON];
169
-      if($uni_galaxyRowMoon['destruyed']) {
169
+      if ($uni_galaxyRowMoon['destruyed']) {
170 170
         CheckAbandonPlanetState($uni_galaxyRowMoon);
171 171
       } else {
172 172
         $moon_fleet_id = 0;
173 173
         $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_MOON]);
174
-        if(!empty($fleets_to_planet['own']['count'])) {
174
+        if (!empty($fleets_to_planet['own']['count'])) {
175 175
           $moon_fleet_id = $fleet_id;
176 176
           $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id);
177 177
           $fleet_id++;
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
   $recyclers_incoming_capacity = 0;
184 184
   $uni_galaxyRowPlanet['debris'] = $uni_galaxyRowPlanet['debris_metal'] + $uni_galaxyRowPlanet['debris_crystal'];
185
-  if($uni_galaxyRowPlanet['debris']) {
186
-    if(!empty($fleet_list[$Planet][PT_DEBRIS])) {
187
-      foreach($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) {
188
-        if($objFleetToDebris->playerOwnerId == $user['id']) {
185
+  if ($uni_galaxyRowPlanet['debris']) {
186
+    if (!empty($fleet_list[$Planet][PT_DEBRIS])) {
187
+      foreach ($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) {
188
+        if ($objFleetToDebris->playerOwnerId == $user['id']) {
189 189
           $recyclers_incoming_capacity += $objFleetToDebris->shipsGetCapacityRecyclers($recycler_info);
190 190
         }
191 191
       }
@@ -262,21 +262,21 @@  discard block
 block discarded – undo
262 262
 
263 263
 tpl_assign_fleet($template, $fleets);
264 264
 
265
-foreach(sn_get_groups('defense_active') as $unit_id) {
265
+foreach (sn_get_groups('defense_active') as $unit_id) {
266 266
   $template->assign_block_vars('defense_active', array(
267 267
     'ID'   => $unit_id,
268 268
     'NAME' => classLocale::$lang['tech'][$unit_id],
269 269
   ));
270 270
 }
271 271
 
272
-foreach($cached['users'] as $PlanetUser) {
273
-  if(!$PlanetUser) {
272
+foreach ($cached['users'] as $PlanetUser) {
273
+  if (!$PlanetUser) {
274 274
     continue;
275 275
   }
276 276
 
277 277
   $user_ally = $cached['allies'][$PlanetUser['ally_id']];
278
-  if(isset($user_ally)) {
279
-    if($PlanetUser['id'] == $user_ally['ally_owner']) {
278
+  if (isset($user_ally)) {
279
+    if ($PlanetUser['id'] == $user_ally['ally_owner']) {
280 280
       $user_rank_title = $user_ally['ally_owner_range'];
281 281
     } else {
282 282
       $ally_ranks = explode(';', $user_ally['ranklist']);
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
   ));
300 300
 }
301 301
 
302
-foreach($cached['allies'] as $PlanetAlly) {
303
-  if($PlanetAlly) {
302
+foreach ($cached['allies'] as $PlanetAlly) {
303
+  if ($PlanetAlly) {
304 304
     $template->assign_block_vars('alliances', array(
305 305
       'ID'      => $PlanetAlly['id'],
306 306
       'NAME_JS' => js_safe_string($PlanetAlly['ally_name']),
Please login to merge, or discard this patch.
announce.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,40 +28,40 @@  discard block
 block discarded – undo
28 28
 $mode = sys_get_param_str('mode');
29 29
 
30 30
 $announce = array();
31
-if($user['authlevel'] >= 3) {
32
-  if(!empty($text)) {
31
+if ($user['authlevel'] >= 3) {
32
+  if (!empty($text)) {
33 33
     $announce_time = strtotime($announce_time, SN_TIME_NOW);
34 34
     $announce_time = $announce_time ? $announce_time : SN_TIME_NOW;
35 35
 
36
-    if($mode == 'edit') {
36
+    if ($mode == 'edit') {
37 37
       DBStaticNews::db_news_update_set($announce_time, $text_unsafe, $detail_url_unsafe, $announce_id);
38 38
       DBStaticSurvey::db_survey_delete_by_id($announce_id);
39 39
     } else {
40 40
       DBStaticNews::db_news_insert_set($announce_time, $text_unsafe, $detail_url_unsafe, $user['id'], $user['username']);
41 41
       $announce_id = classSupernova::$db->db_insert_id();
42 42
     }
43
-    if(($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
43
+    if (($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) {
44 44
       $survey_answers = explode("\r\n", $survey_answers);
45 45
       $survey_until = strtotime($survey_until = sys_get_param_str('survey_until'), SN_TIME_NOW);
46 46
       $survey_until = date(FMT_DATE_TIME_SQL, $survey_until ? $survey_until : SN_TIME_NOW + PERIOD_DAY * 1);
47 47
       $survey_question_unsafe = sys_get_param_str_unsafe('survey_question');
48 48
       DBStaticSurvey::db_survey_insert($announce_id, $survey_question_unsafe, $survey_until);
49 49
       $survey_id = classSupernova::$db->db_insert_id();
50
-      foreach($survey_answers as $survey_answer) {
50
+      foreach ($survey_answers as $survey_answer) {
51 51
         $survey_answer_unsafe = trim($survey_answer);
52
-        if(empty($survey_answer_unsafe)) {
52
+        if (empty($survey_answer_unsafe)) {
53 53
           continue;
54 54
         }
55 55
         DBStaticSurveyAnswer::db_survey_answer_insert($survey_id, $survey_answer_unsafe);
56 56
       }
57 57
     }
58 58
 
59
-    if($announce_time <= SN_TIME_NOW) {
60
-      if($announce_time > classSupernova::$config->var_news_last && $announce_time == SN_TIME_NOW) {
59
+    if ($announce_time <= SN_TIME_NOW) {
60
+      if ($announce_time > classSupernova::$config->var_news_last && $announce_time == SN_TIME_NOW) {
61 61
         classSupernova::$config->db_saveItem('var_news_last', $announce_time);
62 62
       }
63 63
 
64
-      if(sys_get_param_int('news_mass_mail')) {
64
+      if (sys_get_param_int('news_mass_mail')) {
65 65
         $lang_news_more = classLocale::$lang['news_more'];
66 66
         $text = sys_get_param('text') . ($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang_news_more}</span></a>" : '');
67 67
         DBStaticMessages::msgSendFromAdmin('*', classLocale::$lang['news_title'], $text);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
   }
74 74
 
75 75
   $survey_answers = '';
76
-  switch($mode) {
76
+  switch ($mode) {
77 77
     case 'del':
78 78
       DBStaticNews::db_news_delete_by_id($announce_id);
79 79
       $mode = '';
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
       $template->assign_var('ID', $announce_id);
85 85
     case 'copy':
86 86
       $announce = DBStaticNews::db_news_with_survey_select_by_id($announce_id);
87
-      if($announce['survey_id']) {
87
+      if ($announce['survey_id']) {
88 88
         $query = DBStaticSurveyAnswer::db_survey_answer_text_select_by_news($announce);
89
-        while($row = db_fetch($query)) {
89
+        while ($row = db_fetch($query)) {
90 90
           $survey_answers[] = $row['survey_answer_text'];
91 91
         }
92 92
         $survey_answers = implode("\r\n", $survey_answers);
Please login to merge, or discard this patch.
notes.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 $template = gettemplate('notes', true);
20 20
 
21 21
 $result = array();
22
-if(($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
22
+if (($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) {
23 23
   $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => classLocale::$lang[$result_message]);
24 24
 }
25 25
 
26 26
 $note_id_edit = sys_get_param_id('note_id_edit');
27 27
 $note_title_unsafe = sys_get_param_str_unsafe('note_title');
28 28
 $note_text_unsafe = sys_get_param_str_unsafe('note_text');
29
-if(sys_get_param('note_delete')) {
29
+if (sys_get_param('note_delete')) {
30 30
   try {
31 31
     DBStaticNote::processDelete($user, $note_id_edit);
32
-  } catch(Exception $e) {
32
+  } catch (Exception $e) {
33 33
     $note_id_edit = 0;
34 34
     sn_db_transaction_rollback();
35 35
     $result[] = array(
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
       'MESSAGE' => classLocale::$lang[$e->getMessage()],
38 38
     );
39 39
   }
40
-} elseif(($note_title_unsafe = sys_get_param_str_unsafe('note_title')) || ($note_text_unsafe = sys_get_param_str('note_text'))) {
40
+} elseif (($note_title_unsafe = sys_get_param_str_unsafe('note_title')) || ($note_text_unsafe = sys_get_param_str('note_text'))) {
41 41
   $note_title_unsafe == classLocale::$lang['note_new_title'] ? $note_title_unsafe = '' : false;
42 42
   $note_text_unsafe == classLocale::$lang['note_new_text'] ? $note_text_unsafe = '' : false;
43 43
   try {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     $note_system = max(0, min(sys_get_param_id('note_system'), Vector::$knownSystems));
46 46
     $note_planet = max(0, min(sys_get_param_id('note_planet'), Vector::$knownPlanets + 1));
47 47
 
48
-    if(!$note_text_unsafe && !$note_title_unsafe && !$note_galaxy && !$note_system && !$note_planet) {
48
+    if (!$note_text_unsafe && !$note_title_unsafe && !$note_galaxy && !$note_system && !$note_planet) {
49 49
       throw new Exception('note_err_note_empty', ERR_WARNING);
50 50
     }
51 51
 
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
     $note_sticky = intval(sys_get_param_id('note_sticky')) ? 1 : 0;
55 55
 
56 56
     sn_db_transaction_start();
57
-    if($note_id_edit) {
57
+    if ($note_id_edit) {
58 58
       $check_note_id = DBStaticNote::db_note_get_id_and_owner($note_id_edit);
59
-      if(!$check_note_id) {
59
+      if (!$check_note_id) {
60 60
         throw new Exception('note_err_note_not_found', ERR_ERROR);
61 61
       }
62 62
     }
63 63
 
64
-    if($note_id_edit) {
65
-      if($check_note_id['owner'] != $user['id']) {
64
+    if ($note_id_edit) {
65
+      if ($check_note_id['owner'] != $user['id']) {
66 66
         throw new Exception('note_err_owner_wrong', ERR_ERROR);
67 67
       }
68 68
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     sn_db_transaction_commit();
75 75
     sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added'));
76 76
 //    throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE);
77
-  } catch(Exception $e) {
77
+  } catch (Exception $e) {
78 78
     $note_id_edit = 0;
79 79
     sn_db_transaction_rollback();
80 80
     $result[] = array(
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
   }
85 85
 }
86 86
 
87
-if(!$note_id_edit) {
87
+if (!$note_id_edit) {
88 88
   note_assign($template, array(
89 89
     'id'          => 0,
90 90
     'time'        => SN_TIME_NOW,
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 
98 98
 $note_exist = false;
99 99
 $notes_query = DBStaticNote::db_note_list_by_owner($user['id']);
100
-while($note_row = db_fetch($notes_query)) {
100
+while ($note_row = db_fetch($notes_query)) {
101 101
   note_assign($template, $note_row);
102 102
   $note_exist = $note_exist || $note_row['id'] == $note_id_edit;
103 103
 }
104 104
 $note_id_edit = $note_exist ? $note_id_edit : 0;
105 105
 
106
-foreach($note_priority_classes as $note_priority_id => $note_priority_class) {
106
+foreach ($note_priority_classes as $note_priority_id => $note_priority_class) {
107 107
   $template->assign_block_vars('note_priority', array(
108 108
     'ID'    => $note_priority_id,
109 109
     'CLASS' => $note_priority_classes[$note_priority_id],
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
   ));
112 112
 }
113 113
 
114
-foreach(classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
114
+foreach (classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) {
115 115
   $template->assign_block_vars('planet_type', array(
116 116
     'ID'   => $planet_type_id,
117 117
     'TEXT' => $planet_type_string,
118 118
   ));
119 119
 }
120 120
 
121
-foreach($result as $result_data) {
121
+foreach ($result as $result_data) {
122 122
   $template->assign_block_vars('result', $result_data);
123 123
 }
124 124
 
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
16 16
 
17
-if($user['authlevel'] < 3) {
17
+if ($user['authlevel'] < 3) {
18 18
   AdminMessage(classLocale::$lang['adm_err_denied']);
19 19
 }
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach(DBStaticMessages::$snMessageClassList as $key => $value) {
32
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
31
+foreach (DBStaticMessages::$snMessageClassList as $key => $value) {
32
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) {
33 33
     continue;
34 34
   }
35 35
 
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 $deletedMessages = '';
44
-if($idMessageDelete = sys_get_param_id('msg_del')) {
44
+if ($idMessageDelete = sys_get_param_id('msg_del')) {
45 45
   DBStaticMessages::db_message_delete_by_id($idMessageDelete);
46 46
   $deletedMessages = $idMessageDelete;
47
-} elseif(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
47
+} elseif (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) {
48 48
   $message_delete = implode(', ', $message_delete);
49 49
   DBStaticMessages::db_message_list_delete_set($message_delete);
50 50
   $deletedMessages = $message_delete;
51 51
 }
52 52
 
53
-if($deletedMessages) {
53
+if ($deletedMessages) {
54 54
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted'], $deletedMessages)));
55 55
 }
56 56
 
57 57
 
58
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
58
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) {
59 59
   $delete_date = "{$year}-{$month}-{$day}";
60 60
   DBStaticMessages::db_message_list_delete_by_date($delete_date, $int_type_selected);
61 61
   $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date)));
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
69 69
 
70
-if(sys_get_param('page_prev') && $int_page_current > 1) {
70
+if (sys_get_param('page_prev') && $int_page_current > 1) {
71 71
   $int_page_current--;
72
-} elseif(sys_get_param('page_next') && $int_page_current < $page_max) {
72
+} elseif (sys_get_param('page_next') && $int_page_current < $page_max) {
73 73
   $int_page_current++;
74 74
 }
75 75
 
76
-for($i = 1; $i <= $page_max; $i++) {
76
+for ($i = 1; $i <= $page_max; $i++) {
77 77
   $template->assign_block_vars('page', array('NUMBER' => $i));
78 78
 }
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $StartRec = ($int_page_current - 1) * 25;
82 82
 
83 83
 $Messages = DBStaticMessages::db_message_list_admin_by_type($int_type_selected, $StartRec);
84
-while($row = db_fetch($Messages)) {
84
+while ($row = db_fetch($Messages)) {
85 85
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
86 86
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
87 87
   $row['TEXT'] = nl2br($row['TEXT']);
Please login to merge, or discard this patch.
admin/userlist.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
18 18
 
19 19
 global $user;
20
-if($user['authlevel'] < 3) {
20
+if ($user['authlevel'] < 3) {
21 21
   AdminMessage(classLocale::$lang['adm_err_denied']);
22 22
 }
23 23
 
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 $sort = sys_get_param_int('sort', SORT_ID);
42 42
 $sort = $sort_fields[$sort] ? $sort : SORT_ID;
43 43
 
44
-if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
44
+if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) {
45 45
   $user_selected = DBStaticUser::db_user_by_id($user_id, false, 'id, username, authlevel');
46
-  if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
47
-    switch($action) {
46
+  if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) {
47
+    switch ($action) {
48 48
       case ACTION_DELETE:
49 49
         DeleteSelectedUser($user_id);
50 50
         sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}");
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
 $template = gettemplate('admin/userlist', true);
65 65
 
66 66
 $multi_ip = array();
67
-foreach(DBStaticUser::db_user_list_admin_multiaccounts() as $ip) {
67
+foreach (DBStaticUser::db_user_list_admin_multiaccounts() as $ip) {
68 68
   $multi_ip[$ip['user_lastip']] = $ip['ip_count'];
69 69
 }
70 70
 
71 71
 $geoip = geoip_status();
72 72
 $count = 0;
73
-foreach(DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row ) {
73
+foreach (DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row) {
74 74
   $count++;
75
-  if($user_row['banaday']) {
75
+  if ($user_row['banaday']) {
76 76
     $ban_details = db_ban_list_get_details($user_row);
77 77
   }
78 78
 
79 79
   $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array();
80
-  foreach($geoip_info as $key => $value) {
80
+  foreach ($geoip_info as $key => $value) {
81 81
     $geoip_info[strtoupper($key)] = $value;
82 82
     unset($geoip_info[$key]);
83 83
   }
Please login to merge, or discard this patch.
admin/admin_user.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@  discard block
 block discarded – undo
5 5
 define('IN_ADMIN', true);
6 6
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
7 7
 
8
-if($user['authlevel'] < 3) {
8
+if ($user['authlevel'] < 3) {
9 9
   AdminMessage(classLocale::$lang['adm_err_denied']);
10 10
 }
11 11
 
12 12
 lng_include('admin');
13 13
 
14 14
 $user_id = sys_get_param_id('uid');
15
-if(!($user_row = DBStaticUser::db_user_by_id($user_id))) {
15
+if (!($user_row = DBStaticUser::db_user_by_id($user_id))) {
16 16
   AdminMessage(sprintf(classLocale::$lang['adm_dm_user_none'], $user_id));
17 17
 }
18 18
 
19 19
 $template = gettemplate('admin/admin_user', true);
20 20
 
21
-if(!empty($user_row['user_last_browser_id'])) {
21
+if (!empty($user_row['user_last_browser_id'])) {
22 22
   $user_row['browser_user_agent'] = db_browser_agent_get_by_id($user_row['user_last_browser_id']);
23 23
 }
24 24
 
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
     'raidsloose',
55 55
     'raidswin',
56 56
     'total_rank',
57
-    'total_points',  ),
57
+    'total_points',),
58 58
 );
59
-foreach($formats as $callable => $field_list) {
60
-  foreach($field_list as $field_name) {
59
+foreach ($formats as $callable => $field_list) {
60
+  foreach ($field_list as $field_name) {
61 61
     $user_row[$field_name] = call_user_func($callable, $user_row[$field_name]);
62 62
   }
63 63
 }
Please login to merge, or discard this patch.
admin/ajax_maintenance.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1));
8 8
 
9
-if($user['authlevel'] < 3)
9
+if ($user['authlevel'] < 3)
10 10
 {
11 11
   message(classLocale::$lang['sys_noalloaw'], classLocale::$lang['sys_noaccess']);
12 12
   die();
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 // [#] info_best_battles 1b0
23 23
 $best_reports = array();
24 24
 
25
-if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
25
+if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
26 26
   $query = db_ube_report_get_best_battles();
27
-  while($row = db_fetch($query)) {
27
+  while ($row = db_fetch($query)) {
28 28
     $best_reports[] = $row['ube_report_id'];
29 29
   }
30 30
 }
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false;
192 192
 sn_db_transaction_commit();
193 193
 
194
-foreach($ques as $que_transaction) {
194
+foreach ($ques as $que_transaction) {
195 195
   sn_db_transaction_start();
196 196
 
197 197
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
198
-  foreach($que_transaction as $que) {
198
+  foreach ($que_transaction as $que) {
199 199
     set_time_limit(120);
200
-    if(is_callable($que)) {
200
+    if (is_callable($que)) {
201 201
       $QryResult = call_user_func($que);
202 202
     } else {
203 203
       $QryResult = classSupernova::$db->doSql($que);
Please login to merge, or discard this patch.