@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | global $debug, $sn_mvc, $template_result, $user; |
13 | 13 | |
14 | 14 | // Напоминание для Администрации, что игра отключена |
15 | -if($template_result[F_GAME_DISABLE]) { |
|
15 | +if ($template_result[F_GAME_DISABLE]) { |
|
16 | 16 | echo '<div class="global_admin_warning">', $template_result[F_GAME_DISABLE_REASON], '</div>'; |
17 | 17 | } |
18 | 18 | unset($disable_reason); |
19 | 19 | |
20 | 20 | |
21 | -if(defined('IN_ADMIN') && IN_ADMIN === true) { |
|
21 | +if (defined('IN_ADMIN') && IN_ADMIN === true) { |
|
22 | 22 | lng_include('admin'); |
23 | -} elseif($sys_user_logged_in) { |
|
23 | +} elseif ($sys_user_logged_in) { |
|
24 | 24 | sys_user_vacation($user); |
25 | 25 | |
26 | 26 | $planet_id = SetSelectedPlanet($user); |
27 | 27 | |
28 | 28 | // TODO НЕ НУЖНО АЛЬЯНС КАЖДЫЙ РАЗ ОБНОВЛЯТЬ!!! |
29 | - if($user['ally_id']) { |
|
29 | + if ($user['ally_id']) { |
|
30 | 30 | sn_db_transaction_start(); |
31 | 31 | sn_ali_fill_user_ally($user); |
32 | - if(!$user['ally']['player']['id']) { |
|
32 | + if (!$user['ally']['player']['id']) { |
|
33 | 33 | // sn_sys_logout(false, true); |
34 | 34 | // core_auth::logout(false); |
35 | 35 | classSupernova::$auth->logout(false); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | sn_db_transaction_commit(); |
49 | 49 | |
50 | 50 | $planetrow = $global_data['planet']; |
51 | - if(!($planetrow && isset($planetrow['id']) && $planetrow['id'])) { |
|
51 | + if (!($planetrow && isset($planetrow['id']) && $planetrow['id'])) { |
|
52 | 52 | // sn_sys_logout(false, true); |
53 | 53 | // core_auth::logout(false); |
54 | 54 | classSupernova::$auth->logout(false); |
@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
3 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
4 | 4 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
5 | - if($sn_page_name) { |
|
5 | + if ($sn_page_name) { |
|
6 | 6 | // Loading page-specific language files |
7 | 7 | global $template; |
8 | 8 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
9 | 9 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
10 | - if(!empty($template_result) && is_object($template)) { |
|
10 | + if (!empty($template_result) && is_object($template)) { |
|
11 | 11 | $template->assign_recursive($template_result); |
12 | 12 | } |
13 | 13 | display($template, '', true, '', defined('IN_ADMIN') && (IN_ADMIN === true), true); |
@@ -237,53 +237,53 @@ discard block |
||
237 | 237 | $birthday_array = $uni_galaxyRowUser['user_birthday'] ? date_parse($uni_galaxyRowUser['user_birthday']) : array(); |
238 | 238 | $user_activity = floor((SN_TIME_NOW - $uni_galaxyRowUser['onlinetime'])/(60*60*24)); |
239 | 239 | $template->assign_block_vars('galaxyrow', array( |
240 | - 'PLANET_ID' => $uni_galaxyRowPlanet['id'], |
|
241 | - 'PLANET_NUM' => $Planet, |
|
242 | - 'PLANET_NAME' => $uni_galaxyRowPlanet['name'], |
|
243 | - 'PLANET_NAME_JS' => js_safe_string($uni_galaxyRowPlanet['name']), |
|
244 | - 'PLANET_DESTROYED' => $uni_galaxyRowPlanet["destruyed"], |
|
245 | - 'PLANET_TYPE' => $uni_galaxyRowPlanet["planet_type"], |
|
246 | - 'PLANET_ACTIVITY' => floor((SN_TIME_NOW - $uni_galaxyRowPlanet['last_update'])/60), |
|
247 | - 'PLANET_IMAGE' => $uni_galaxyRowPlanet['image'], |
|
248 | - 'PLANET_FLEET_ID' => $planet_fleet_id, |
|
249 | - 'PLANET_DIAMETER' => number_format($uni_galaxyRowPlanet['diameter'], 0, '', '.'), |
|
250 | - |
|
251 | - 'MOON_NAME_JS' => js_safe_string($uni_galaxyRowMoon['name']), |
|
252 | - 'MOON_IMAGE' => $uni_galaxyRowMoon['image'], |
|
253 | - 'MOON_DIAMETER' => number_format($uni_galaxyRowMoon['diameter'], 0, '', '.'), |
|
254 | - 'MOON_TEMP' => number_format($uni_galaxyRowMoon['temp_min'], 0, '', '.'), |
|
255 | - 'MOON_FLEET_ID' => $moon_fleet_id, |
|
256 | - |
|
257 | - 'DEBRIS' => $uni_galaxyRowPlanet['debris'], |
|
258 | - 'DEBRIS_METAL' => $uni_galaxyRowPlanet['debris_metal'], |
|
259 | - 'DEBRIS_CRYSTAL' => $uni_galaxyRowPlanet['debris_crystal'], |
|
260 | - 'DEBRIS_REST_PERCENT' => $uni_galaxyRowPlanet["debris_rest_percent"], |
|
261 | - |
|
262 | - 'DEBRIS_RESERVED' => $uni_galaxyRowPlanet['debris_reserved'], |
|
263 | - 'DEBRIS_RESERVED_PERCENT' => $uni_galaxyRowPlanet['debris_reserved_percent'], |
|
264 | - 'DEBRIS_WILL_GATHER' => $uni_galaxyRowPlanet['debris_will_gather'], |
|
265 | - 'DEBRIS_WILL_GATHER_PERCENT' => $uni_galaxyRowPlanet['debris_will_gather_percent'], |
|
266 | - 'DEBRIS_GATHER_TOTAL' => $uni_galaxyRowPlanet['debris_gather_total'], |
|
267 | - 'DEBRIS_GATHER_TOTAL_PERCENT' => $uni_galaxyRowPlanet['debris_gather_total_percent'], |
|
268 | - |
|
269 | - 'USER_ID' => $uni_galaxyRowUser['id'], |
|
270 | - 'USER_NAME' => player_nick_render_to_html($uni_galaxyRowUser), |
|
271 | - 'USER_NAME_JS' => js_safe_string(player_nick_render_to_html($uni_galaxyRowUser)), |
|
272 | - 'USER_RANK' => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'], |
|
273 | - 'USER_BANNED' => $uni_galaxyRowUser['banaday'], |
|
274 | - 'USER_VACATION' => $uni_galaxyRowUser['vacation'], |
|
275 | - 'USER_ACTIVITY' => $user_activity, |
|
276 | - 'USER_ATTACKABLE' => $user_activity >= 7, |
|
277 | - 'USER_INACTIVE' => $user_activity >= 28, |
|
278 | - 'USER_PROTECTED'=> $RowUserPoints <= classSupernova::$config->game_noob_points, |
|
279 | - 'USER_NOOB' => $RowUserPoints * classSupernova::$config->game_noob_factor < $CurrentPoints && classSupernova::$config->game_noob_factor, |
|
280 | - 'USER_STRONG' => $CurrentPoints * classSupernova::$config->game_noob_factor < $RowUserPoints && classSupernova::$config->game_noob_factor, |
|
281 | - 'USER_AUTH' => $uni_galaxyRowUser['authlevel'], |
|
282 | - 'USER_ADMIN' => $lang['user_level_shortcut'][$uni_galaxyRowUser['authlevel']], |
|
283 | - 'USER_BIRTHDAY' => $birthday_array['month'] == $time_now_parsed['mon'] && $birthday_array['day'] == $time_now_parsed['mday'] ? date(FMT_DATE, SN_TIME_NOW) : 0, |
|
284 | - |
|
285 | - 'ALLY_ID' => $uni_galaxyRowUser['ally_id'], |
|
286 | - 'ALLY_TAG' => $uni_galaxyRowUser['ally_tag'], |
|
240 | + 'PLANET_ID' => $uni_galaxyRowPlanet['id'], |
|
241 | + 'PLANET_NUM' => $Planet, |
|
242 | + 'PLANET_NAME' => $uni_galaxyRowPlanet['name'], |
|
243 | + 'PLANET_NAME_JS' => js_safe_string($uni_galaxyRowPlanet['name']), |
|
244 | + 'PLANET_DESTROYED' => $uni_galaxyRowPlanet["destruyed"], |
|
245 | + 'PLANET_TYPE' => $uni_galaxyRowPlanet["planet_type"], |
|
246 | + 'PLANET_ACTIVITY' => floor((SN_TIME_NOW - $uni_galaxyRowPlanet['last_update'])/60), |
|
247 | + 'PLANET_IMAGE' => $uni_galaxyRowPlanet['image'], |
|
248 | + 'PLANET_FLEET_ID' => $planet_fleet_id, |
|
249 | + 'PLANET_DIAMETER' => number_format($uni_galaxyRowPlanet['diameter'], 0, '', '.'), |
|
250 | + |
|
251 | + 'MOON_NAME_JS' => js_safe_string($uni_galaxyRowMoon['name']), |
|
252 | + 'MOON_IMAGE' => $uni_galaxyRowMoon['image'], |
|
253 | + 'MOON_DIAMETER' => number_format($uni_galaxyRowMoon['diameter'], 0, '', '.'), |
|
254 | + 'MOON_TEMP' => number_format($uni_galaxyRowMoon['temp_min'], 0, '', '.'), |
|
255 | + 'MOON_FLEET_ID' => $moon_fleet_id, |
|
256 | + |
|
257 | + 'DEBRIS' => $uni_galaxyRowPlanet['debris'], |
|
258 | + 'DEBRIS_METAL' => $uni_galaxyRowPlanet['debris_metal'], |
|
259 | + 'DEBRIS_CRYSTAL' => $uni_galaxyRowPlanet['debris_crystal'], |
|
260 | + 'DEBRIS_REST_PERCENT' => $uni_galaxyRowPlanet["debris_rest_percent"], |
|
261 | + |
|
262 | + 'DEBRIS_RESERVED' => $uni_galaxyRowPlanet['debris_reserved'], |
|
263 | + 'DEBRIS_RESERVED_PERCENT' => $uni_galaxyRowPlanet['debris_reserved_percent'], |
|
264 | + 'DEBRIS_WILL_GATHER' => $uni_galaxyRowPlanet['debris_will_gather'], |
|
265 | + 'DEBRIS_WILL_GATHER_PERCENT' => $uni_galaxyRowPlanet['debris_will_gather_percent'], |
|
266 | + 'DEBRIS_GATHER_TOTAL' => $uni_galaxyRowPlanet['debris_gather_total'], |
|
267 | + 'DEBRIS_GATHER_TOTAL_PERCENT' => $uni_galaxyRowPlanet['debris_gather_total_percent'], |
|
268 | + |
|
269 | + 'USER_ID' => $uni_galaxyRowUser['id'], |
|
270 | + 'USER_NAME' => player_nick_render_to_html($uni_galaxyRowUser), |
|
271 | + 'USER_NAME_JS' => js_safe_string(player_nick_render_to_html($uni_galaxyRowUser)), |
|
272 | + 'USER_RANK' => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'], |
|
273 | + 'USER_BANNED' => $uni_galaxyRowUser['banaday'], |
|
274 | + 'USER_VACATION' => $uni_galaxyRowUser['vacation'], |
|
275 | + 'USER_ACTIVITY' => $user_activity, |
|
276 | + 'USER_ATTACKABLE' => $user_activity >= 7, |
|
277 | + 'USER_INACTIVE' => $user_activity >= 28, |
|
278 | + 'USER_PROTECTED'=> $RowUserPoints <= classSupernova::$config->game_noob_points, |
|
279 | + 'USER_NOOB' => $RowUserPoints * classSupernova::$config->game_noob_factor < $CurrentPoints && classSupernova::$config->game_noob_factor, |
|
280 | + 'USER_STRONG' => $CurrentPoints * classSupernova::$config->game_noob_factor < $RowUserPoints && classSupernova::$config->game_noob_factor, |
|
281 | + 'USER_AUTH' => $uni_galaxyRowUser['authlevel'], |
|
282 | + 'USER_ADMIN' => $lang['user_level_shortcut'][$uni_galaxyRowUser['authlevel']], |
|
283 | + 'USER_BIRTHDAY' => $birthday_array['month'] == $time_now_parsed['mon'] && $birthday_array['day'] == $time_now_parsed['mday'] ? date(FMT_DATE, SN_TIME_NOW) : 0, |
|
284 | + |
|
285 | + 'ALLY_ID' => $uni_galaxyRowUser['ally_id'], |
|
286 | + 'ALLY_TAG' => $uni_galaxyRowUser['ally_tag'], |
|
287 | 287 | )); |
288 | 288 | } |
289 | 289 | |
@@ -349,53 +349,53 @@ discard block |
||
349 | 349 | $system_name = doquery("select `universe_name` from `{{universe}}` where `universe_galaxy` = {$uni_galaxy} and `universe_system` = {$uni_system} limit 1;", true); |
350 | 350 | |
351 | 351 | $template->assign_vars(array( |
352 | - 'rows' => $Result, |
|
353 | - 'userCount' => classSupernova::$config->users_amount, |
|
354 | - 'ALLY_COUNT' => $ally_count['ally_count'], |
|
355 | - 'PLANET_EXPEDITION' => classSupernova::$config->game_maxPlanet + 1, |
|
356 | - 'curPlanetID' => $planetrow['id'], |
|
357 | - 'curPlanetG' => $planetrow['galaxy'], |
|
358 | - 'curPlanetS' => $planetrow['system'], |
|
359 | - 'curPlanetP' => $planetrow['planet'], |
|
360 | - 'curPlanetPT' => $planetrow['planet_type'], |
|
361 | - 'deathStars' => mrc_get_level($user, $planetrow, SHIP_HUGE_DEATH_STAR, false, true), |
|
362 | - 'galaxy' => $uni_galaxy, |
|
363 | - 'system' => $uni_system, |
|
364 | - 'planet' => $planet, |
|
365 | - 'MIPs' => round($CurrentMIP), |
|
366 | - 'MODE' => $mode, |
|
367 | - 'planets' => $planetcount, |
|
368 | - 'SPs' => pretty_number(mrc_get_level($user, $planetrow, SHIP_SPY, false, true)), |
|
369 | - 'SHOW_ADMIN' => SHOW_ADMIN, |
|
370 | - 'fleet_count' => $flying_fleet_count, |
|
371 | - 'fleet_max' => $fleetmax, |
|
372 | - 'ALLY_ID' => $user['ally_id'], |
|
373 | - 'USER_ID' => $user['id'], |
|
374 | - 'ACT_SPIO' => classSupernova::$user_options[PLAYER_OPTION_FLEET_SPY_DEFAULT], |
|
375 | - 'ACT_SPY' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_SPYING], |
|
376 | - 'ACT_WRITE' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_PM], |
|
377 | - 'ACT_STATISTICS' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_STATS], |
|
378 | - 'ACT_INFO' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_PROFILE], |
|
379 | - 'ACT_FRIEND' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_BUDDY], |
|
380 | - 'opt_uni_tooltip_time'=> classSupernova::$user_options[PLAYER_OPTION_TOOLTIP_DELAY], |
|
381 | - 'opt_uni_avatar_user' => $user['opt_uni_avatar_user'], |
|
382 | - 'opt_uni_avatar_ally' => $user['opt_uni_avatar_ally'], |
|
383 | - 'ACT_MISSILE' => $is_missile, |
|
384 | - 'PLANET_PHALANX' => $HavePhalanx && $uni_galaxy == $CurrentGalaxy && $uni_system >= $CurrentSystem - $PhalanxRange && $uni_system <= $CurrentSystem + $PhalanxRange, |
|
385 | - 'PAGE_HINT' => $lang['gal_sys_hint'], |
|
386 | - 'PLANET_RECYCLERS' => $planet_recyclers_orbiting, |
|
387 | - 'PLANET_RECYCLERS_TEXT' => pretty_number($planet_recyclers_orbiting), |
|
388 | - 'GALAXY_NAME' => $galaxy_name['universe_name'], |
|
389 | - 'SYSTEM_NAME' => $system_name['universe_name'], |
|
390 | - 'COL_SPAN' => $colspan + 9, |
|
391 | - 'COL_SPAN_PLUS' => $colspan + 3, |
|
392 | - |
|
393 | - 'COL_SPAN_NEW' => $colspan + 4, |
|
394 | - 'COL_SPAN_NEW_COLONIZE' => $colspan - 2, |
|
395 | - |
|
396 | - 'PLAYER_OPTION_UNIVERSE_OLD' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_OLD], |
|
397 | - 'PLAYER_OPTION_UNIVERSE_DISABLE_COLONIZE' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_DISABLE_COLONIZE], |
|
398 | - ) |
|
352 | + 'rows' => $Result, |
|
353 | + 'userCount' => classSupernova::$config->users_amount, |
|
354 | + 'ALLY_COUNT' => $ally_count['ally_count'], |
|
355 | + 'PLANET_EXPEDITION' => classSupernova::$config->game_maxPlanet + 1, |
|
356 | + 'curPlanetID' => $planetrow['id'], |
|
357 | + 'curPlanetG' => $planetrow['galaxy'], |
|
358 | + 'curPlanetS' => $planetrow['system'], |
|
359 | + 'curPlanetP' => $planetrow['planet'], |
|
360 | + 'curPlanetPT' => $planetrow['planet_type'], |
|
361 | + 'deathStars' => mrc_get_level($user, $planetrow, SHIP_HUGE_DEATH_STAR, false, true), |
|
362 | + 'galaxy' => $uni_galaxy, |
|
363 | + 'system' => $uni_system, |
|
364 | + 'planet' => $planet, |
|
365 | + 'MIPs' => round($CurrentMIP), |
|
366 | + 'MODE' => $mode, |
|
367 | + 'planets' => $planetcount, |
|
368 | + 'SPs' => pretty_number(mrc_get_level($user, $planetrow, SHIP_SPY, false, true)), |
|
369 | + 'SHOW_ADMIN' => SHOW_ADMIN, |
|
370 | + 'fleet_count' => $flying_fleet_count, |
|
371 | + 'fleet_max' => $fleetmax, |
|
372 | + 'ALLY_ID' => $user['ally_id'], |
|
373 | + 'USER_ID' => $user['id'], |
|
374 | + 'ACT_SPIO' => classSupernova::$user_options[PLAYER_OPTION_FLEET_SPY_DEFAULT], |
|
375 | + 'ACT_SPY' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_SPYING], |
|
376 | + 'ACT_WRITE' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_PM], |
|
377 | + 'ACT_STATISTICS' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_STATS], |
|
378 | + 'ACT_INFO' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_PROFILE], |
|
379 | + 'ACT_FRIEND' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_ICON_BUDDY], |
|
380 | + 'opt_uni_tooltip_time'=> classSupernova::$user_options[PLAYER_OPTION_TOOLTIP_DELAY], |
|
381 | + 'opt_uni_avatar_user' => $user['opt_uni_avatar_user'], |
|
382 | + 'opt_uni_avatar_ally' => $user['opt_uni_avatar_ally'], |
|
383 | + 'ACT_MISSILE' => $is_missile, |
|
384 | + 'PLANET_PHALANX' => $HavePhalanx && $uni_galaxy == $CurrentGalaxy && $uni_system >= $CurrentSystem - $PhalanxRange && $uni_system <= $CurrentSystem + $PhalanxRange, |
|
385 | + 'PAGE_HINT' => $lang['gal_sys_hint'], |
|
386 | + 'PLANET_RECYCLERS' => $planet_recyclers_orbiting, |
|
387 | + 'PLANET_RECYCLERS_TEXT' => pretty_number($planet_recyclers_orbiting), |
|
388 | + 'GALAXY_NAME' => $galaxy_name['universe_name'], |
|
389 | + 'SYSTEM_NAME' => $system_name['universe_name'], |
|
390 | + 'COL_SPAN' => $colspan + 9, |
|
391 | + 'COL_SPAN_PLUS' => $colspan + 3, |
|
392 | + |
|
393 | + 'COL_SPAN_NEW' => $colspan + 4, |
|
394 | + 'COL_SPAN_NEW_COLONIZE' => $colspan - 2, |
|
395 | + |
|
396 | + 'PLAYER_OPTION_UNIVERSE_OLD' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_OLD], |
|
397 | + 'PLAYER_OPTION_UNIVERSE_DISABLE_COLONIZE' => classSupernova::$user_options[PLAYER_OPTION_UNIVERSE_DISABLE_COLONIZE], |
|
398 | + ) |
|
399 | 399 | ); |
400 | 400 | |
401 | 401 | display(parsetemplate($template), $lang['sys_universe'], true, '', false); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $uni_system = sys_get_param_int('system', $planetrow['system']); |
30 | 30 | $planet = sys_get_param_int('planet', $planetrow['planet']); |
31 | 31 | |
32 | -if($mode == 'name') { |
|
32 | +if ($mode == 'name') { |
|
33 | 33 | require_once('includes/includes/uni_rename.php'); |
34 | 34 | } |
35 | 35 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | |
81 | 81 | $planet_precache_query = DBStaticPlanet::db_planet_list_in_system($uni_galaxy, $uni_system); |
82 | 82 | // while($planet_row = db_fetch($planet_precache_query)) |
83 | -if(!empty($planet_precache_query)) |
|
84 | -foreach($planet_precache_query as $planet_row) |
|
83 | +if (!empty($planet_precache_query)) |
|
84 | +foreach ($planet_precache_query as $planet_row) |
|
85 | 85 | { |
86 | 86 | $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row; |
87 | 87 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // $fleet_list[$fleet_planet][$fleet_type][] = $fleet_row; |
101 | 101 | //} |
102 | 102 | $system_fleet_list = fleet_list_by_planet_coords($uni_galaxy, $uni_system); |
103 | -foreach($system_fleet_list as $fleet_row) { |
|
103 | +foreach ($system_fleet_list as $fleet_row) { |
|
104 | 104 | $fleet_planet = $fleet_row['fleet_mess'] == 0 ? $fleet_row['fleet_end_planet'] : $fleet_row['fleet_start_planet']; |
105 | 105 | $fleet_type = $fleet_row['fleet_mess'] == 0 ? $fleet_row['fleet_end_type'] : $fleet_row['fleet_start_type']; |
106 | 106 | $fleet_list[$fleet_planet][$fleet_type][] = $fleet_row; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $recycler_info = array(); |
112 | 112 | $planet_recyclers_orbiting = 0; |
113 | 113 | $recyclers_fleet = array(); |
114 | -foreach(sn_get_groups('flt_recyclers') as $recycler_id) |
|
114 | +foreach (sn_get_groups('flt_recyclers') as $recycler_id) |
|
115 | 115 | { |
116 | 116 | $recycler_info[$recycler_id] = get_ship_data($recycler_id, $user); |
117 | 117 | $recyclers_fleet[$recycler_id] = mrc_get_level($user, $planetrow, $recycler_id); |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | $planet_fleet_id = 0; |
139 | 139 | if ($uni_galaxyRowPlanet['destruyed']) |
140 | 140 | { |
141 | - CheckAbandonPlanetState ($uni_galaxyRowPlanet); |
|
141 | + CheckAbandonPlanetState($uni_galaxyRowPlanet); |
|
142 | 142 | } |
143 | - elseif($uni_galaxyRowPlanet['id']) |
|
143 | + elseif ($uni_galaxyRowPlanet['id']) |
|
144 | 144 | { |
145 | - if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) |
|
145 | + if ($cached['users'][$uni_galaxyRowPlanet['id_owner']]) |
|
146 | 146 | { |
147 | 147 | $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']]; |
148 | 148 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser; |
153 | 153 | } |
154 | 154 | |
155 | - if(!$uni_galaxyRowUser['id']) |
|
155 | + if (!$uni_galaxyRowUser['id']) |
|
156 | 156 | { |
157 | 157 | $debug->warning("Planet '{$uni_galaxyRowPlanet['name']}' [{$uni_galaxy}:{$uni_system}:{$Planet}] has no owner!", 'Userless planet', 503); |
158 | 158 | $uni_galaxyRowPlanet['destruyed'] = SN_TIME_NOW + 60 * 60 * 24; |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | DBStaticPlanet::db_planet_set_by_id($uni_galaxyRowPlanet['id'], "id_owner = 0, destruyed = {$uni_galaxyRowPlanet['destruyed']}"); |
161 | 161 | } |
162 | 162 | |
163 | - if($uni_galaxyRowUser['id']) |
|
163 | + if ($uni_galaxyRowUser['id']) |
|
164 | 164 | { |
165 | 165 | $planetcount++; |
166 | - if($uni_galaxyRowUser['ally_id']) |
|
166 | + if ($uni_galaxyRowUser['ally_id']) |
|
167 | 167 | { |
168 | - if($cached['allies'][$uni_galaxyRowUser['ally_id']]) |
|
168 | + if ($cached['allies'][$uni_galaxyRowUser['ally_id']]) |
|
169 | 169 | { |
170 | 170 | $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']]; |
171 | 171 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | $fleets_to_planet = flt_get_fleets_to_planet(false, $fleet_list[$Planet][PT_PLANET]); |
180 | - if($fleets_to_planet['own']['count']) |
|
180 | + if ($fleets_to_planet['own']['count']) |
|
181 | 181 | { |
182 | 182 | $planet_fleet_id = $fleet_id; |
183 | 183 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | { |
194 | 194 | $moon_fleet_id = 0; |
195 | 195 | $fleets_to_planet = flt_get_fleets_to_planet(false, $fleet_list[$Planet][PT_MOON]); |
196 | - if($fleets_to_planet['own']['count']) |
|
196 | + if ($fleets_to_planet['own']['count']) |
|
197 | 197 | { |
198 | 198 | $moon_fleet_id = $fleet_id; |
199 | 199 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | // $recyclers_incoming = 0; |
207 | 207 | $recyclers_incoming_capacity = 0; |
208 | 208 | $uni_galaxyRowPlanet['debris'] = $uni_galaxyRowPlanet['debris_metal'] + $uni_galaxyRowPlanet['debris_crystal']; |
209 | - if($uni_galaxyRowPlanet['debris']) { |
|
210 | - if($fleet_list[$Planet][PT_DEBRIS]) { |
|
211 | - foreach($fleet_list[$Planet][PT_DEBRIS] as $fleet_row) { |
|
212 | - if($fleet_row['fleet_owner'] == $user['id']) { |
|
209 | + if ($uni_galaxyRowPlanet['debris']) { |
|
210 | + if ($fleet_list[$Planet][PT_DEBRIS]) { |
|
211 | + foreach ($fleet_list[$Planet][PT_DEBRIS] as $fleet_row) { |
|
212 | + if ($fleet_row['fleet_owner'] == $user['id']) { |
|
213 | 213 | $fleet_data = sys_unit_str2arr($fleet_row['fleet_array']); |
214 | - foreach($recycler_info as $recycler_id => $recycler_data) { |
|
214 | + foreach ($recycler_info as $recycler_id => $recycler_data) { |
|
215 | 215 | $recyclers_incoming_capacity += $fleet_data[$recycler_id] * $recycler_data['capacity']; |
216 | 216 | } |
217 | 217 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | $RowUserPoints = $uni_galaxyRowUser['total_points']; |
237 | 237 | $birthday_array = $uni_galaxyRowUser['user_birthday'] ? date_parse($uni_galaxyRowUser['user_birthday']) : array(); |
238 | - $user_activity = floor((SN_TIME_NOW - $uni_galaxyRowUser['onlinetime'])/(60*60*24)); |
|
238 | + $user_activity = floor((SN_TIME_NOW - $uni_galaxyRowUser['onlinetime']) / (60 * 60 * 24)); |
|
239 | 239 | $template->assign_block_vars('galaxyrow', array( |
240 | 240 | 'PLANET_ID' => $uni_galaxyRowPlanet['id'], |
241 | 241 | 'PLANET_NUM' => $Planet, |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'PLANET_NAME_JS' => js_safe_string($uni_galaxyRowPlanet['name']), |
244 | 244 | 'PLANET_DESTROYED' => $uni_galaxyRowPlanet["destruyed"], |
245 | 245 | 'PLANET_TYPE' => $uni_galaxyRowPlanet["planet_type"], |
246 | - 'PLANET_ACTIVITY' => floor((SN_TIME_NOW - $uni_galaxyRowPlanet['last_update'])/60), |
|
246 | + 'PLANET_ACTIVITY' => floor((SN_TIME_NOW - $uni_galaxyRowPlanet['last_update']) / 60), |
|
247 | 247 | 'PLANET_IMAGE' => $uni_galaxyRowPlanet['image'], |
248 | 248 | 'PLANET_FLEET_ID' => $planet_fleet_id, |
249 | 249 | 'PLANET_DIAMETER' => number_format($uni_galaxyRowPlanet['diameter'], 0, '', '.'), |
@@ -289,21 +289,21 @@ discard block |
||
289 | 289 | |
290 | 290 | tpl_assign_fleet($template, $fleets); |
291 | 291 | |
292 | -foreach(sn_get_groups('defense_active') as $unit_id) { |
|
292 | +foreach (sn_get_groups('defense_active') as $unit_id) { |
|
293 | 293 | $template->assign_block_vars('defense_active', array( |
294 | 294 | 'ID' => $unit_id, |
295 | 295 | 'NAME' => $lang['tech'][$unit_id], |
296 | 296 | )); |
297 | 297 | } |
298 | 298 | |
299 | -foreach($cached['users'] as $PlanetUser) { |
|
300 | - if(!$PlanetUser) { |
|
299 | +foreach ($cached['users'] as $PlanetUser) { |
|
300 | + if (!$PlanetUser) { |
|
301 | 301 | continue; |
302 | 302 | } |
303 | 303 | |
304 | 304 | $user_ally = $cached['allies'][$PlanetUser['ally_id']]; |
305 | - if(isset($user_ally)) { |
|
306 | - if($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
305 | + if (isset($user_ally)) { |
|
306 | + if ($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
307 | 307 | $user_rank_title = $user_ally['ally_owner_range']; |
308 | 308 | } else { |
309 | 309 | $ally_ranks = explode(';', $user_ally['ranklist']); |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | )); |
327 | 327 | } |
328 | 328 | |
329 | -foreach($cached['allies'] as $PlanetAlly) |
|
329 | +foreach ($cached['allies'] as $PlanetAlly) |
|
330 | 330 | { |
331 | - if($PlanetAlly) |
|
331 | + if ($PlanetAlly) |
|
332 | 332 | { |
333 | 333 | $template->assign_block_vars('alliances', array( |
334 | 334 | 'ID' => $PlanetAlly['id'], |
@@ -80,11 +80,12 @@ discard block |
||
80 | 80 | |
81 | 81 | $planet_precache_query = DBStaticPlanet::db_planet_list_in_system($uni_galaxy, $uni_system); |
82 | 82 | // while($planet_row = db_fetch($planet_precache_query)) |
83 | -if(!empty($planet_precache_query)) |
|
84 | -foreach($planet_precache_query as $planet_row) |
|
83 | +if(!empty($planet_precache_query)) { |
|
84 | + foreach($planet_precache_query as $planet_row) |
|
85 | 85 | { |
86 | 86 | $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row; |
87 | 87 | } |
88 | +} |
|
88 | 89 | |
89 | 90 | |
90 | 91 | //$fleet_precache_query = doquery( |
@@ -139,14 +140,12 @@ discard block |
||
139 | 140 | if ($uni_galaxyRowPlanet['destruyed']) |
140 | 141 | { |
141 | 142 | CheckAbandonPlanetState ($uni_galaxyRowPlanet); |
142 | - } |
|
143 | - elseif($uni_galaxyRowPlanet['id']) |
|
143 | + } elseif($uni_galaxyRowPlanet['id']) |
|
144 | 144 | { |
145 | 145 | if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) |
146 | 146 | { |
147 | 147 | $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']]; |
148 | - } |
|
149 | - else |
|
148 | + } else |
|
150 | 149 | { |
151 | 150 | $uni_galaxyRowUser = db_user_by_id($uni_galaxyRowPlanet['id_owner']); |
152 | 151 | $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser; |
@@ -168,8 +167,7 @@ discard block |
||
168 | 167 | if($cached['allies'][$uni_galaxyRowUser['ally_id']]) |
169 | 168 | { |
170 | 169 | $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']]; |
171 | - } |
|
172 | - else |
|
170 | + } else |
|
173 | 171 | { |
174 | 172 | $allyquery = doquery("SELECT * FROM `{{alliance}}` WHERE `id` = '{$uni_galaxyRowUser['ally_id']}';", '', true); |
175 | 173 | $cached['allies'][$uni_galaxyRowUser['ally_id']] = $allyquery; |
@@ -188,8 +186,7 @@ discard block |
||
188 | 186 | if ($uni_galaxyRowMoon['destruyed']) |
189 | 187 | { |
190 | 188 | CheckAbandonPlanetState($uni_galaxyRowMoon); |
191 | - } |
|
192 | - else |
|
189 | + } else |
|
193 | 190 | { |
194 | 191 | $moon_fleet_id = 0; |
195 | 192 | $fleets_to_planet = flt_get_fleets_to_planet(false, $fleet_list[$Planet][PT_MOON]); |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = (array( |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = (array( |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = (array( |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = (array( |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = (array( |