@@ -8,19 +8,19 @@ discard block |
||
8 | 8 | $ts_var_stat_update = strtotime($config->db_loadItem('var_stat_update')); |
9 | 9 | $ts_scheduled_update = sys_schedule_get_prev_run($config->db_loadItem('stats_schedule'), $config->var_stat_update); |
10 | 10 | |
11 | - if(sys_get_param_int('admin_update')) { |
|
11 | + if (sys_get_param_int('admin_update')) { |
|
12 | 12 | define('USER_LEVEL', isset($user['authlevel']) ? $user['authlevel'] : -1); |
13 | - if(USER_LEVEL > 0) { |
|
13 | + if (USER_LEVEL > 0) { |
|
14 | 14 | $is_admin_request = true; |
15 | 15 | $ts_scheduled_update = SN_TIME_NOW; |
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
19 | - if($ts_scheduled_update > $ts_var_stat_update) { |
|
19 | + if ($ts_scheduled_update > $ts_var_stat_update) { |
|
20 | 20 | lng_include('admin'); |
21 | 21 | sn_db_transaction_start(); |
22 | 22 | $ts_var_stat_update_end = strtotime($config->db_loadItem('var_stat_update_end')); |
23 | - if(SN_TIME_NOW > $ts_var_stat_update_end) { |
|
23 | + if (SN_TIME_NOW > $ts_var_stat_update_end) { |
|
24 | 24 | $old_server_status = $config->db_loadItem('game_disable'); |
25 | 25 | $config->db_saveItem('game_disable', GAME_DISABLE_STAT); |
26 | 26 | |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | $config->db_saveItem('var_stat_update_end', SN_TIME_SQL); |
57 | 57 | |
58 | 58 | $config->db_saveItem('game_disable', $old_server_status); |
59 | - } elseif($ts_scheduled_update > $ts_var_stat_update) { |
|
59 | + } elseif ($ts_scheduled_update > $ts_var_stat_update) { |
|
60 | 60 | $timeout = strtotime($config->db_loadItem('var_stat_update_end')) - SN_TIME_NOW; |
61 | 61 | $msg = $config->db_loadItem('var_stat_update_msg'); |
62 | 62 | $msg = "{$msg} ETA {$timeout} seconds. Please wait..."; |
63 | 63 | } |
64 | 64 | sn_db_transaction_rollback(); |
65 | - } elseif($is_admin_request) { |
|
65 | + } elseif ($is_admin_request) { |
|
66 | 66 | $msg = 'Stat is up to date'; |
67 | 67 | } |
68 | 68 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('INSIDE')) |
|
3 | +if (!defined('INSIDE')) |
|
4 | 4 | { |
5 | 5 | die('Hack attempt!'); |
6 | 6 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'shield' => 10, |
39 | 39 | 'armor' => 400, |
40 | 40 | 'attack' => 5, |
41 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
41 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
42 | 42 | ), |
43 | 43 | SHIP_CARGO_BIG => array( |
44 | 44 | 'name' => 'big_ship_cargo', |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'shield' => 25, |
59 | 59 | 'armor' => 1200, |
60 | 60 | 'attack' => 5, |
61 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
61 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
62 | 62 | 'engine' => array( |
63 | 63 | array( |
64 | 64 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'shield' => 50, |
87 | 87 | 'armor' => 3000, |
88 | 88 | 'attack' => 10, |
89 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
89 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
90 | 90 | 'engine' => array( |
91 | 91 | array( |
92 | 92 | 'tech' => TECH_ENGINE_ION, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'shield' => 200, |
115 | 115 | 'armor' => 70000, |
116 | 116 | 'attack' => 50, |
117 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
117 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
118 | 118 | 'engine' => array( |
119 | 119 | array( |
120 | 120 | 'tech' => TECH_ENGINE_HYPER, |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'shield' => 100, |
144 | 144 | 'armor' => 3000, |
145 | 145 | 'attack' => 50, |
146 | - 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
146 | + 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
147 | 147 | 'engine' => array( |
148 | 148 | array( |
149 | 149 | 'tech' => TECH_ENGINE_ION, |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | 'shield' => 10, |
172 | 172 | 'armor' => 1600, |
173 | 173 | 'attack' => 1, |
174 | - 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ), |
|
174 | + 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,), |
|
175 | 175 | 'engine' => array( |
176 | 176 | array( |
177 | 177 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | 'shield' => 0.01, |
200 | 200 | 'armor' => 100, |
201 | 201 | 'attack' => 0.01, |
202 | - 'amplify' => array( SHIP_SPY => 1,), |
|
202 | + 'amplify' => array(SHIP_SPY => 1,), |
|
203 | 203 | 'engine' => array( |
204 | 204 | array( |
205 | 205 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 'factor' => 1, |
224 | 224 | ), |
225 | 225 | P_UNIT_PRODUCTION => array( |
226 | - RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);}, |
|
226 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); }, |
|
227 | 227 | ), |
228 | 228 | P_MINING_IS_MANAGED => true, |
229 | 229 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | 'shield' => 10, |
233 | 233 | 'armor' => 200, |
234 | 234 | 'attack' => 1, |
235 | - 'amplify' => array(SHIP_SPY => 1, ), |
|
235 | + 'amplify' => array(SHIP_SPY => 1,), |
|
236 | 236 | 'engine' => array( |
237 | 237 | array( |
238 | 238 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'shield' => 10, |
265 | 265 | 'armor' => 400, |
266 | 266 | 'attack' => 50, |
267 | - 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
267 | + 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
268 | 268 | 'engine' => array( |
269 | 269 | array( |
270 | 270 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | 'shield' => 25, |
294 | 294 | 'armor' => 1000, |
295 | 295 | 'attack' => 150, |
296 | - 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ), |
|
296 | + 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,), |
|
297 | 297 | 'engine' => array( |
298 | 298 | array( |
299 | 299 | 'tech' => TECH_ENGINE_ION, |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | 'shield' => 50, |
353 | 353 | 'armor' => 2700, |
354 | 354 | 'attack' => 400, |
355 | - 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ), |
|
355 | + 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,), |
|
356 | 356 | 'engine' => array( |
357 | 357 | array( |
358 | 358 | 'tech' => TECH_ENGINE_ION, |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | 'shield' => 200, |
412 | 412 | 'armor' => 6000, |
413 | 413 | 'attack' => 1000, |
414 | - 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ), |
|
414 | + 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,), |
|
415 | 415 | 'engine' => array( |
416 | 416 | array( |
417 | 417 | 'tech' => TECH_ENGINE_HYPER, |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | 'shield' => 500, |
508 | 508 | 'armor' => 11000, |
509 | 509 | 'attack' => 2000, |
510 | - 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ), |
|
510 | + 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,), |
|
511 | 511 | 'engine' => array( |
512 | 512 | array( |
513 | 513 | 'tech' => TECH_ENGINE_HYPER, |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | 'shield' => 20, |
612 | 612 | 'armor' => 200, |
613 | 613 | 'attack' => 80, |
614 | - 'amplify' => array(SHIP_SPY => 7, ), |
|
614 | + 'amplify' => array(SHIP_SPY => 7,), |
|
615 | 615 | ), |
616 | 616 | UNIT_DEF_TURRET_LASER_SMALL => array( |
617 | 617 | 'name' => 'small_laser', |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | 'shield' => 25, |
630 | 630 | 'armor' => 200, |
631 | 631 | 'attack' => 100, |
632 | - 'amplify' => array(SHIP_SPY => 5, ), |
|
632 | + 'amplify' => array(SHIP_SPY => 5,), |
|
633 | 633 | ), |
634 | 634 | UNIT_DEF_TURRET_LASER_BIG => array( |
635 | 635 | 'name' => 'big_laser', |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | 'shield' => 100, |
648 | 648 | 'armor' => 800, |
649 | 649 | 'attack' => 250, |
650 | - 'amplify' => array(SHIP_SPY => 2, ), |
|
650 | + 'amplify' => array(SHIP_SPY => 2,), |
|
651 | 651 | ), |
652 | 652 | UNIT_DEF_TURRET_GAUSS => array( |
653 | 653 | 'name' => 'gauss_canyon', |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | 'armor' => 3500, |
666 | 666 | 'shield' => 200, |
667 | 667 | 'attack' => 1100, |
668 | - 'amplify' => array(SHIP_SPY => 0.5, ), |
|
668 | + 'amplify' => array(SHIP_SPY => 0.5,), |
|
669 | 669 | ), |
670 | 670 | UNIT_DEF_TURRET_ION => array( |
671 | 671 | 'name' => 'ionic_canyon', |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | 'shield' => 500, |
684 | 684 | 'armor' => 800, |
685 | 685 | 'attack' => 150, |
686 | - 'amplify' => array(SHIP_SPY => 3.3, ), |
|
686 | + 'amplify' => array(SHIP_SPY => 3.3,), |
|
687 | 687 | ), |
688 | 688 | UNIT_DEF_TURRET_PLASMA => array( |
689 | 689 | 'name' => 'buster_canyon', |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | 'shield' => 300, |
702 | 702 | 'armor' => 10000, |
703 | 703 | 'attack' => 3000, |
704 | - 'amplify' => array(SHIP_SPY => 0.17, ), |
|
704 | + 'amplify' => array(SHIP_SPY => 0.17,), |
|
705 | 705 | ), |
706 | 706 | |
707 | 707 | UNIT_DEF_SHIELD_SMALL => array( |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | 'shield' => 2000, |
722 | 722 | 'armor' => 2000, |
723 | 723 | 'attack' => 1, |
724 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
724 | + 'amplify' => array(SHIP_SPY => 500,), |
|
725 | 725 | ), |
726 | 726 | UNIT_DEF_SHIELD_BIG => array( |
727 | 727 | 'name' => 'big_protection_shield', |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | 'shield' => 2000, |
741 | 741 | 'armor' => 10000, |
742 | 742 | 'attack' => 1, |
743 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
743 | + 'amplify' => array(SHIP_SPY => 500,), |
|
744 | 744 | ), |
745 | 745 | UNIT_DEF_SHIELD_PLANET => array( |
746 | 746 | 'name' => 'planet_protector', |
@@ -61,8 +61,7 @@ |
||
61 | 61 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
62 | 62 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
63 | 63 | )); |
64 | - } |
|
65 | - elseif($type=='ally') |
|
64 | + } elseif($type=='ally') |
|
66 | 65 | { |
67 | 66 | $template->assign_block_vars('search_result', array( |
68 | 67 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 | |
15 | -if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
15 | +if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
16 | 16 | message($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10); |
17 | 17 | die(); |
18 | 18 | } |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | $template = gettemplate('search', true); |
27 | 27 | |
28 | -if($searchtext && $type) |
|
28 | +if ($searchtext && $type) |
|
29 | 29 | { |
30 | - switch($type) |
|
30 | + switch ($type) |
|
31 | 31 | { |
32 | 32 | case "planetname": |
33 | 33 | // $search = db_planet_list_search($searchtext); |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | break; |
44 | 44 | } |
45 | 45 | |
46 | - while($row = db_fetch($search)) |
|
46 | + while ($row = db_fetch($search)) |
|
47 | 47 | { |
48 | - if($type=='playername' || $type=='planetname') |
|
48 | + if ($type == 'playername' || $type == 'planetname') |
|
49 | 49 | { |
50 | 50 | $template->assign_block_vars('search_result', array( |
51 | 51 | 'PLAYER_ID' => $row['uid'], |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
63 | 63 | )); |
64 | 64 | } |
65 | - elseif($type=='ally') |
|
65 | + elseif ($type == 'ally') |
|
66 | 66 | { |
67 | 67 | $template->assign_block_vars('search_result', array( |
68 | 68 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 'ally' => 'sys_alliance', |
82 | 82 | ); |
83 | 83 | |
84 | -foreach($search_type as $type_id => $type_lang) |
|
84 | +foreach ($search_type as $type_id => $type_lang) |
|
85 | 85 | { |
86 | 86 | $template->assign_block_vars('type', array( |
87 | 87 | 'ID' => $type_id, |
@@ -2,16 +2,16 @@ |
||
2 | 2 | // Captcha code for registration - really didn't work alot :( |
3 | 3 | |
4 | 4 | session_start(); |
5 | -$en=100; |
|
6 | -$boy=25; |
|
7 | -$sayi = mt_rand(0,9999999); |
|
5 | +$en = 100; |
|
6 | +$boy = 25; |
|
7 | +$sayi = mt_rand(0, 9999999); |
|
8 | 8 | $_SESSION['captcha'] = $sayi; |
9 | -$tuval = imagecreatetruecolor($en,$boy); |
|
10 | -$b = imagecolorallocate($tuval,175,238,238); |
|
11 | -$s = imagecolorallocate($tuval,0,0,0); |
|
12 | -imagefill($tuval,0,0,$s); |
|
13 | -imageline($tuval,20,50,$en,$boy,$b); |
|
14 | -imagestring($tuval,3,27,7,$sayi,$b); |
|
9 | +$tuval = imagecreatetruecolor($en, $boy); |
|
10 | +$b = imagecolorallocate($tuval, 175, 238, 238); |
|
11 | +$s = imagecolorallocate($tuval, 0, 0, 0); |
|
12 | +imagefill($tuval, 0, 0, $s); |
|
13 | +imageline($tuval, 20, 50, $en, $boy, $b); |
|
14 | +imagestring($tuval, 3, 27, 7, $sayi, $b); |
|
15 | 15 | Header("content-type:image/gif"); |
16 | 16 | imagegif($tuval); |
17 | 17 | imagedestroy($tuval); |
@@ -7,8 +7,8 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | 12 | |
13 | 13 | require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 |
@@ -25,8 +25,7 @@ |
||
25 | 25 | if($user_request['id_user']) |
26 | 26 | { |
27 | 27 | require('includes/alliance/ali_external_request.inc'); |
28 | - } |
|
29 | - else |
|
28 | + } else |
|
30 | 29 | { |
31 | 30 | switch($mode) |
32 | 31 | { |
@@ -2,7 +2,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ?> |
@@ -12,16 +12,16 @@ discard block |
||
12 | 12 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
13 | 13 | |
14 | 14 | $unit_id = sys_get_param_id('gid'); |
15 | -if($unit_id == RES_DARK_MATTER) { |
|
15 | +if ($unit_id == RES_DARK_MATTER) { |
|
16 | 16 | sys_redirect('dark_matter.php'); |
17 | 17 | } |
18 | 18 | |
19 | -if($unit_id == RES_METAMATTER) { |
|
19 | +if ($unit_id == RES_METAMATTER) { |
|
20 | 20 | sys_redirect('metamatter.php'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | lng_include('infos'); |
24 | -if(!$unit_id || (!get_unit_param($unit_id) && !isset($lang['info'][$unit_id]))) { |
|
24 | +if (!$unit_id || (!get_unit_param($unit_id) && !isset($lang['info'][$unit_id]))) { |
|
25 | 25 | sys_redirect('index.php?page=techtree'); |
26 | 26 | } |
27 | 27 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $unit_data = get_unit_param($unit_id); |
31 | 31 | $unit_type = $unit_data['type']; |
32 | 32 | |
33 | -if($unit_type == UNIT_SHIPS) { |
|
33 | +if ($unit_type == UNIT_SHIPS) { |
|
34 | 34 | $template_result['UNIT_IS_SHIP'] = true; |
35 | 35 | |
36 | 36 | $ship_data = get_ship_data($unit_id, $user); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | |
48 | 48 | $engine_template_info = array(); |
49 | - foreach($unit_data['engine'] as $unit_engine_data) { |
|
49 | + foreach ($unit_data['engine'] as $unit_engine_data) { |
|
50 | 50 | $unit_engine_data = get_engine_data($user, $unit_engine_data); |
51 | 51 | |
52 | 52 | $engine_template_info[] = array( |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | |
67 | 67 | $sn_data_group_combat = sn_get_groups('combat'); |
68 | -if(in_array($unit_id, $sn_data_group_combat)) { |
|
68 | +if (in_array($unit_id, $sn_data_group_combat)) { |
|
69 | 69 | $template_result['UNIT_IS_COMBAT'] = true; |
70 | 70 | |
71 | 71 | $unit_durability = $unit_data['shield'] + $unit_data['armor']; |
@@ -73,21 +73,21 @@ discard block |
||
73 | 73 | $volley_arr = $rapid_to = $rapid_from = array(); |
74 | 74 | $str_rapid_from = ''; |
75 | 75 | $str_rapid_to = ''; |
76 | - foreach($sn_data_group_combat as $enemy_id) { |
|
76 | + foreach ($sn_data_group_combat as $enemy_id) { |
|
77 | 77 | $enemy_data = get_unit_param($enemy_id); |
78 | 78 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
79 | 79 | |
80 | 80 | $rapid = $unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability; |
81 | - if($rapid >= 1) { |
|
81 | + if ($rapid >= 1) { |
|
82 | 82 | $volley_arr[$enemy_id]['TO'] = floor($rapid); |
83 | 83 | } |
84 | 84 | |
85 | 85 | $rapid = $enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability; |
86 | - if($rapid >= 1) { |
|
86 | + if ($rapid >= 1) { |
|
87 | 87 | $volley_arr[$enemy_id]['FROM'] = floor($rapid); |
88 | 88 | } |
89 | 89 | } |
90 | - foreach($volley_arr as $enemy_id => &$rapid) { |
|
90 | + foreach ($volley_arr as $enemy_id => &$rapid) { |
|
91 | 91 | $rapid['ENEMY_ID'] = $enemy_id; |
92 | 92 | $rapid['ENEMY_NAME'] = $lang['tech'][$enemy_id]; |
93 | 93 | } |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | } |
107 | 107 | |
108 | -if($lang['info'][$unit_id]['effect']) { |
|
108 | +if ($lang['info'][$unit_id]['effect']) { |
|
109 | 109 | $template_result['UNIT_EFFECT'] = $lang['info'][$unit_id]['effect']; |
110 | 110 | } |
111 | 111 | |
112 | -if($unit_data['bonus']) { |
|
112 | +if ($unit_data['bonus']) { |
|
113 | 113 | $unit_bonus = !$unit_data['bonus'] || $unit_data['bonus_type'] == BONUS_ABILITY ? '' : ( |
114 | 114 | ($unit_data['bonus'] >= 0 ? '+' : '') . $unit_data['bonus'] . ($unit_data['bonus_type'] == BONUS_PERCENT ? '%' : '') |
115 | 115 | ); |
@@ -174,20 +174,20 @@ discard block |
||
174 | 174 | )); |
175 | 175 | |
176 | 176 | $ActualProd = floor($Prod[$BuildID]); |
177 | - if($BuildID != STRUC_MINE_FUSION) { |
|
177 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
178 | 178 | $ActualNeed = floor($Prod[STRUC_MINE_SOLAR]); |
179 | 179 | } else { |
180 | 180 | $ActualNeed = floor($Prod[STRUC_MINE_DEUTERIUM]); |
181 | 181 | } |
182 | 182 | |
183 | 183 | $BuildStartLvl = $CurrentBuildtLvl - 2; |
184 | - if($BuildStartLvl < 1) { |
|
184 | + if ($BuildStartLvl < 1) { |
|
185 | 185 | $BuildStartLvl = 1; |
186 | 186 | } |
187 | 187 | $Table = ''; |
188 | 188 | $ProdFirst = 0; |
189 | - for($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
190 | - if($BuildID != STRUC_MOON_PHALANX) { |
|
189 | + for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
190 | + if ($BuildID != STRUC_MOON_PHALANX) { |
|
191 | 191 | $Prod[STRUC_MINE_METAL] = floor(mrc_modify_value( |
192 | 192 | $CurrentUser, |
193 | 193 | $CurrentPlanet, |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | )); |
215 | 215 | |
216 | 216 | $bloc['build_lvl'] = ($CurrentBuildtLvl == $BuildLevel) ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel; |
217 | - if($ProdFirst > 0) { |
|
218 | - if($BuildID != STRUC_MINE_FUSION) { |
|
217 | + if ($ProdFirst > 0) { |
|
218 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
219 | 219 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[$BuildID] - $ProdFirst)) . ")</font>"; |
220 | 220 | } else { |
221 | 221 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[STRUC_MINE_SOLAR] - $ProdFirst)) . ")</font>"; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } else { |
224 | 224 | $bloc['build_gain'] = ''; |
225 | 225 | } |
226 | - if($BuildID != STRUC_MINE_FUSION) { |
|
226 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
227 | 227 | $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID])); |
228 | 228 | $bloc['build_prod_diff'] = pretty_number(floor($Prod[$BuildID] - $ActualProd), true, true); |
229 | 229 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_SOLAR]), true, true); |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM]), true, true); |
235 | 235 | $bloc['build_need_diff'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM] - $ActualNeed), true, true); |
236 | 236 | } |
237 | - if($ProdFirst == 0) { |
|
238 | - if($BuildID != STRUC_MINE_FUSION) { |
|
237 | + if ($ProdFirst == 0) { |
|
238 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
239 | 239 | $ProdFirst = floor($Prod[$BuildID]); |
240 | 240 | } else { |
241 | 241 | $ProdFirst = floor($Prod[STRUC_MINE_SOLAR]); |
@@ -260,22 +260,22 @@ discard block |
||
260 | 260 | |
261 | 261 | $str_rapid_from = ''; |
262 | 262 | $str_rapid_to = ''; |
263 | - foreach(sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
263 | + foreach (sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
264 | 264 | $enemy_data = get_unit_param($enemy_id); |
265 | 265 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
266 | 266 | |
267 | 267 | $rapid = floor($unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability); |
268 | - if($rapid >= 1) { |
|
268 | + if ($rapid >= 1) { |
|
269 | 269 | $str_rapid_to .= "{$lang['nfo_rf_again']} {$lang['tech'][$enemy_id]} <font color=\"#00ff00\">{$rapid}</font><br>"; |
270 | 270 | } |
271 | 271 | |
272 | 272 | $rapid = floor($enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability); |
273 | - if($rapid >= 1) { |
|
273 | + if ($rapid >= 1) { |
|
274 | 274 | $str_rapid_from .= "{$lang['tech'][$enemy_id]} {$lang['nfo_rf_from']} <font color=\"#ff0000\">{$rapid}</font><br>"; |
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
278 | - if($str_rapid_to && $str_rapid_from) { |
|
278 | + if ($str_rapid_to && $str_rapid_from) { |
|
279 | 279 | $str_rapid_to .= '<hr>'; |
280 | 280 | } |
281 | 281 | |
@@ -304,75 +304,75 @@ discard block |
||
304 | 304 | |
305 | 305 | $unit_info = get_unit_param($unit_id); |
306 | 306 | |
307 | -if($unit_id >= 1 && $unit_id <= 3) { |
|
307 | +if ($unit_id >= 1 && $unit_id <= 3) { |
|
308 | 308 | // Cas des mines |
309 | 309 | $PageTPL = gettemplate('info_buildings_table'); |
310 | 310 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
311 | 311 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
312 | 312 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; |
313 | -} elseif($unit_id == 4) { |
|
313 | +} elseif ($unit_id == 4) { |
|
314 | 314 | // Centrale Solaire |
315 | 315 | $PageTPL = gettemplate('info_buildings_table'); |
316 | 316 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
317 | 317 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
318 | 318 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; |
319 | -} elseif($unit_id == STRUC_MINE_FUSION) { |
|
319 | +} elseif ($unit_id == STRUC_MINE_FUSION) { |
|
320 | 320 | // Centrale Fusion |
321 | 321 | $PageTPL = gettemplate('info_buildings_table'); |
322 | 322 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
323 | 323 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
324 | 324 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; |
325 | -} elseif($unit_id >= STRUC_FACTORY_ROBOT && $unit_id <= 32) { |
|
325 | +} elseif ($unit_id >= STRUC_FACTORY_ROBOT && $unit_id <= 32) { |
|
326 | 326 | // Batiments Generaux |
327 | 327 | $PageTPL = gettemplate('info_buildings_general'); |
328 | 328 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
329 | -} elseif($unit_id == STRUC_TERRAFORMER) { |
|
329 | +} elseif ($unit_id == STRUC_TERRAFORMER) { |
|
330 | 330 | // Batiments Terraformer |
331 | 331 | $PageTPL = gettemplate('info_buildings_general'); |
332 | -} elseif($unit_id == STRUC_ALLY_DEPOSIT) { |
|
332 | +} elseif ($unit_id == STRUC_ALLY_DEPOSIT) { |
|
333 | 333 | // Dépot d'alliance |
334 | 334 | $PageTPL = gettemplate('info_buildings_general'); |
335 | 335 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
336 | -} elseif($unit_id == STRUC_LABORATORY_NANO) { |
|
336 | +} elseif ($unit_id == STRUC_LABORATORY_NANO) { |
|
337 | 337 | // nano |
338 | 338 | $PageTPL = gettemplate('info_buildings_general'); |
339 | 339 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
340 | -} elseif($unit_id == STRUC_SILO) { |
|
340 | +} elseif ($unit_id == STRUC_SILO) { |
|
341 | 341 | // Silo de missiles |
342 | 342 | $PageTPL = gettemplate('info_buildings_general'); |
343 | 343 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
344 | -} elseif($unit_id == STRUC_MOON_STATION) { |
|
344 | +} elseif ($unit_id == STRUC_MOON_STATION) { |
|
345 | 345 | // Batiments lunaires |
346 | 346 | $PageTPL = gettemplate('info_buildings_general'); |
347 | -} elseif($unit_id == STRUC_MOON_PHALANX) { |
|
347 | +} elseif ($unit_id == STRUC_MOON_PHALANX) { |
|
348 | 348 | // Phalange |
349 | 349 | $PageTPL = gettemplate('info_buildings_table'); |
350 | 350 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; |
351 | 351 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; |
352 | 352 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
353 | -} elseif($unit_id == STRUC_MOON_GATE) { |
|
353 | +} elseif ($unit_id == STRUC_MOON_GATE) { |
|
354 | 354 | // Porte de Saut |
355 | 355 | $PageTPL = gettemplate('info_buildings_general'); |
356 | 356 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
357 | -} elseif(in_array($unit_id, sn_get_groups('tech'))) { |
|
357 | +} elseif (in_array($unit_id, sn_get_groups('tech'))) { |
|
358 | 358 | // Laboratoire |
359 | 359 | $PageTPL = gettemplate('info_buildings_general'); |
360 | -} elseif(in_array($unit_id, sn_get_groups('fleet'))) { |
|
360 | +} elseif (in_array($unit_id, sn_get_groups('fleet'))) { |
|
361 | 361 | // Flotte |
362 | 362 | |
363 | 363 | $PageTPL = gettemplate('info_buildings_fleet'); |
364 | 364 | |
365 | 365 | $parse['element_typ'] = $lang['tech'][UNIT_SHIPS]; |
366 | 366 | $rapid_fire = eco_render_rapid_fire($unit_id); |
367 | - $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
367 | + $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
368 | 368 | $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de |
369 | 369 | |
370 | 370 | $parse['hull_pt'] = pretty_number(($unit_info['metal'] + $unit_info['crystal']) / 10); // Points de Structure |
371 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
372 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
371 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
372 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
373 | 373 | $parse['capacity_pt'] = pretty_number($unit_info['capacity']); // Capacitée de fret |
374 | - $parse['base_speed'] = pretty_number($unit_info['engine'][0]['speed']); // Vitesse de base |
|
375 | - $parse['base_conso'] = pretty_number($unit_info['engine'][0]['consumption']); // Consommation de base |
|
374 | + $parse['base_speed'] = pretty_number($unit_info['engine'][0]['speed']); // Vitesse de base |
|
375 | + $parse['base_conso'] = pretty_number($unit_info['engine'][0]['consumption']); // Consommation de base |
|
376 | 376 | |
377 | 377 | $parse['ACTUAL_ARMOR'] = pretty_number(mrc_modify_value($user, false, array(MRC_ADMIRAL, TECH_ARMOR), ($unit_info['metal'] + $unit_info['crystal']) / 10)); |
378 | 378 | $parse['ACTUAL_SHIELD'] = pretty_number(mrc_modify_value($user, false, array(MRC_ADMIRAL, TECH_SHIELD), $unit_info['shield'])); |
@@ -382,37 +382,37 @@ discard block |
||
382 | 382 | $parse['ACTUAL_CAPACITY'] = pretty_number($ship_data['capacity']); |
383 | 383 | $parse['ACTUAL_SPEED'] = pretty_number($ship_data['speed']); |
384 | 384 | $parse['ACTUAL_CONSUMPTION'] = pretty_number($ship_data['consumption']); |
385 | - if(count($unit_info['engine']) > 1) { |
|
386 | - $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['speed']) . ")</font>"; // Vitesse rééquipée |
|
385 | + if (count($unit_info['engine']) > 1) { |
|
386 | + $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['speed']) . ")</font>"; // Vitesse rééquipée |
|
387 | 387 | $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['consumption']) . ")</font>"; // Consommation apres rééquipement |
388 | 388 | } |
389 | -} elseif(in_array($unit_id, sn_get_groups('defense_active'))) { |
|
389 | +} elseif (in_array($unit_id, sn_get_groups('defense_active'))) { |
|
390 | 390 | // Defenses |
391 | 391 | $PageTPL = gettemplate('info_buildings_defense'); |
392 | 392 | $parse['element_typ'] = $lang['tech'][UNIT_DEFENCE]; |
393 | 393 | |
394 | 394 | $rapid_fire = eco_render_rapid_fire($unit_id); |
395 | - $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
395 | + $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
396 | 396 | $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de |
397 | 397 | |
398 | 398 | $parse['hull_pt'] = pretty_number(($unit_info['metal'] + $unit_info['crystal']) / 10); // Points de Structure |
399 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
400 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
401 | -} elseif(in_array($unit_id, sn_get_groups('missile'))) { |
|
399 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
400 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
401 | +} elseif (in_array($unit_id, sn_get_groups('missile'))) { |
|
402 | 402 | // Misilles |
403 | 403 | $PageTPL = gettemplate('info_buildings_defense'); |
404 | 404 | $parse['element_typ'] = $lang['tech'][UNIT_DEFENCE]; |
405 | 405 | $parse['hull_pt'] = pretty_number($unit_info['metal'] + $unit_info['crystal']); // Points de Structure |
406 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
407 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
408 | -} elseif(in_array($unit_id, sn_get_groups(array('mercenaries', 'governors', 'artifacts', 'resources_all')))) { |
|
406 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
407 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
408 | +} elseif (in_array($unit_id, sn_get_groups(array('mercenaries', 'governors', 'artifacts', 'resources_all')))) { |
|
409 | 409 | // Officiers |
410 | 410 | $PageTPL = gettemplate('info_officiers_general'); |
411 | 411 | |
412 | 412 | $mercenary = $unit_info; |
413 | 413 | $mercenary_bonus = $mercenary['bonus']; |
414 | 414 | $mercenary_bonus = $mercenary_bonus >= 0 ? "+{$mercenary_bonus}" : "{$mercenary_bonus}"; |
415 | - switch($mercenary['bonus_type']) { |
|
415 | + switch ($mercenary['bonus_type']) { |
|
416 | 416 | case BONUS_PERCENT: |
417 | 417 | $mercenary_bonus = "{$mercenary_bonus}%"; |
418 | 418 | break; |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | $parse['EFFECT'] = $lang['info'][$unit_id]['effect']; |
432 | 432 | $parse['mercenary_bonus'] = $mercenary_bonus; |
433 | - if(!in_array($unit_id, sn_get_groups(array('artifacts', 'resources_all')))) { |
|
433 | + if (!in_array($unit_id, sn_get_groups(array('artifacts', 'resources_all')))) { |
|
434 | 434 | $parse['max_level'] = $lang['sys_level'] . ' ' . |
435 | 435 | (in_array($unit_id, sn_get_groups('mercenaries')) ? mrc_get_level($user, $planetrow, $unit_id) : ($mercenary['location'] == LOC_USER ? mrc_get_level($user, null, $unit_id) : ($planetrow['PLANET_GOVERNOR_ID'] == $unit_id ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0))) |
436 | 436 | . (isset($mercenary['max']) ? "/{$mercenary['max']}" : ''); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | // ---- Tableau d'evolution |
441 | -if($TableHeadTPL != '') { |
|
441 | +if ($TableHeadTPL != '') { |
|
442 | 442 | $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); |
443 | 443 | $parse['table_data'] = ShowProductionTable($user, $planetrow, $unit_id, $TableTPL); |
444 | 444 | } |
@@ -41,12 +41,10 @@ |
||
41 | 41 | if(!$check_result) |
42 | 42 | { |
43 | 43 | $version_check = SNC_VER_ERROR_CONNECT; |
44 | -} |
|
45 | -elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
44 | +} elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
46 | 45 | { |
47 | 46 | $version_check = $check_result; |
48 | -} |
|
49 | -else |
|
47 | +} else |
|
50 | 48 | { |
51 | 49 | // JSON decode if string |
52 | 50 | $check_result = json_decode($check_result, true); |
@@ -22,19 +22,19 @@ |
||
22 | 22 | */ |
23 | 23 | switch($mode) |
24 | 24 | { |
25 | - case SNC_MODE_REGISTER: |
|
26 | - if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) |
|
27 | - { |
|
28 | - if($ajax) |
|
25 | + case SNC_MODE_REGISTER: |
|
26 | + if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) |
|
29 | 27 | { |
30 | - print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
28 | + if($ajax) |
|
29 | + { |
|
30 | + print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
31 | + } |
|
32 | + die(); |
|
31 | 33 | } |
32 | - die(); |
|
33 | - } |
|
34 | - $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
35 | -//TODO REMOVE DEBUG!!! |
|
36 | -//$url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode('http://supernova.ws/'); |
|
37 | - break; |
|
34 | + $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
35 | + //TODO REMOVE DEBUG!!! |
|
36 | + //$url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode('http://supernova.ws/'); |
|
37 | + break; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $check_result = sn_get_url_contents($url); |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | . '&key=' . urlencode(classSupernova::$config->server_updater_key) |
21 | 21 | . '&id=' . urlencode(classSupernova::$config->server_updater_id); |
22 | 22 | */ |
23 | -switch($mode) |
|
23 | +switch ($mode) |
|
24 | 24 | { |
25 | 25 | case SNC_MODE_REGISTER: |
26 | - if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) |
|
26 | + if (classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) |
|
27 | 27 | { |
28 | - if($ajax) |
|
28 | + if ($ajax) |
|
29 | 29 | { |
30 | 30 | print(SNC_VER_REGISTER_ERROR_REGISTERED); |
31 | 31 | } |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | $check_result = sn_get_url_contents($url); |
41 | -if(!$check_result) |
|
41 | +if (!$check_result) |
|
42 | 42 | { |
43 | 43 | $version_check = SNC_VER_ERROR_CONNECT; |
44 | 44 | } |
45 | -elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
45 | +elseif (($version_check = intval($check_result)) && $version_check == $check_result) |
|
46 | 46 | { |
47 | 47 | $version_check = $check_result; |
48 | 48 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $check_result = json_decode($check_result, true); |
53 | 53 | $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check']; |
54 | 54 | |
55 | - switch($mode) |
|
55 | + switch ($mode) |
|
56 | 56 | { |
57 | 57 | case SNC_MODE_REGISTER: |
58 | - if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) |
|
58 | + if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) |
|
59 | 59 | { |
60 | 60 | classSupernova::$config->db_saveItem('server_updater_key', $check_result['site']['site_key']); |
61 | 61 | classSupernova::$config->db_saveItem('server_updater_id', $check_result['site']['site_id']); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | classSupernova::$config->db_saveItem('server_updater_check_last', SN_TIME_NOW); |
70 | 70 | classSupernova::$config->db_saveItem('server_updater_check_result', $version_check); |
71 | 71 | |
72 | -if($ajax) |
|
72 | +if ($ajax) |
|
73 | 73 | { |
74 | 74 | define('IN_AJAX', true); |
75 | 75 | print($version_check); |
@@ -115,8 +115,7 @@ |
||
115 | 115 | )); |
116 | 116 | |
117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
118 | - } |
|
119 | - else |
|
118 | + } else |
|
120 | 119 | { |
121 | 120 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -14,39 +14,39 @@ discard block |
||
14 | 14 | |
15 | 15 | lng_include('fleet'); |
16 | 16 | |
17 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
17 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
18 | 18 | { |
19 | 19 | sn_db_transaction_start(); |
20 | 20 | db_user_by_id($user['id'], true, 'id'); |
21 | 21 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
22 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
22 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
23 | 23 | { |
24 | 24 | $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
25 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
25 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
26 | 26 | { |
27 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
28 | - if(!$NextDestTime) |
|
27 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
28 | + if (!$NextDestTime) |
|
29 | 29 | { |
30 | 30 | // $SubQueryOri = ""; |
31 | 31 | // $SubQueryDes = ""; |
32 | 32 | $ship_list = sys_get_param('ships'); |
33 | 33 | $db_changeset = array(); |
34 | - foreach($ship_list as $ship_id => $ship_count) |
|
34 | + foreach ($ship_list as $ship_id => $ship_count) |
|
35 | 35 | { |
36 | - if(!in_array($ship_id, sn_get_groups('fleet'))) |
|
36 | + if (!in_array($ship_id, sn_get_groups('fleet'))) |
|
37 | 37 | { |
38 | 38 | continue; |
39 | 39 | } |
40 | 40 | |
41 | 41 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
42 | - if($ship_count) |
|
42 | + if ($ship_count) |
|
43 | 43 | { |
44 | 44 | $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, -$ship_count, $user, $planetrow['id']); |
45 | 45 | $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, $ship_count, $user, $TargetGate['id']); |
46 | 46 | } |
47 | 47 | } |
48 | 48 | // Dit monsieur, y avait quelque chose a envoyer ??? |
49 | - if(!empty($db_changeset)) |
|
49 | + if (!empty($db_changeset)) |
|
50 | 50 | { |
51 | 51 | DBStaticPlanet::db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
52 | 52 | DBStaticPlanet::db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
@@ -55,31 +55,31 @@ discard block |
||
55 | 55 | db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'"); |
56 | 56 | |
57 | 57 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
58 | - $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
58 | + $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow)); |
|
59 | 59 | } else { |
60 | 60 | $RetMessage = $lang['gate_wait_data']; |
61 | 61 | } |
62 | 62 | } else { |
63 | - $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
63 | + $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime); |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | $RetMessage = $lang['gate_no_dest_g']; |
67 | 67 | } |
68 | 68 | } else { |
69 | - $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
69 | + $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime); |
|
70 | 70 | } |
71 | 71 | sn_db_transaction_commit(); |
72 | 72 | message($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
73 | 73 | } else { |
74 | 74 | $template = gettemplate('jumpgate', true); |
75 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
75 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
76 | 76 | { |
77 | 77 | $Combo = ''; |
78 | 78 | $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']); |
79 | 79 | // while($CurMoon = db_fetch($MoonList)) |
80 | - foreach($MoonList as $CurMoon) |
|
80 | + foreach ($MoonList as $CurMoon) |
|
81 | 81 | { |
82 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
82 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
83 | 83 | { |
84 | 84 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
85 | 85 | $template->assign_block_vars('moon', array( |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | - foreach(sn_get_groups('fleet') as $Ship) |
|
96 | + foreach (sn_get_groups('fleet') as $Ship) |
|
97 | 97 | { |
98 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
98 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
99 | 99 | { |
100 | 100 | continue; |
101 | 101 | } |