@@ -4,18 +4,18 @@ discard block |
||
4 | 4 | // @version 1.0 |
5 | 5 | // @copyright 2008 by Chlorel for XNova |
6 | 6 | |
7 | -if(SN_IN_FLEET !== true) { |
|
7 | +if (SN_IN_FLEET !== true) { |
|
8 | 8 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
9 | 9 | } |
10 | 10 | |
11 | 11 | $template = gettemplate('fleet1', true); |
12 | 12 | |
13 | 13 | $ships = sys_get_param('ships', array()); |
14 | -if(!is_array($ships)) { |
|
14 | +if (!is_array($ships)) { |
|
15 | 15 | $ships = array(); |
16 | 16 | } |
17 | 17 | |
18 | -foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
18 | +foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
19 | 19 | $template->assign_block_vars('possible_planet_type_id', array( |
20 | 20 | 'ID' => $possible_planet_type_id, |
21 | 21 | 'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id], |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'START_NAME' => $planetrow['name'], |
29 | 29 | ); |
30 | 30 | |
31 | -if(!empty($TargetPlanet)) { |
|
31 | +if (!empty($TargetPlanet)) { |
|
32 | 32 | $template_route += array( |
33 | 33 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
34 | 34 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $template->assign_block_vars('fleets', $template_route); |
40 | 40 | |
41 | 41 | $sn_groups_fleet = sn_get_groups('fleet'); |
42 | -foreach($ships as $ship_id => $ship_count) { |
|
43 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
42 | +foreach ($ships as $ship_id => $ship_count) { |
|
43 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
44 | 44 | $ship_info = get_unit_param($ship_id); |
45 | - if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
45 | + if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
46 | 46 | $page .= $lang['fl_noenought']; |
47 | 47 | } else { |
48 | 48 | $fleet['fleetarray'][$ship_id] = $ship_count; |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | -if(empty($fleet['fleetarray'])) { |
|
64 | +if (empty($fleet['fleetarray'])) { |
|
65 | 65 | messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5); |
66 | 66 | } |
67 | 67 | |
68 | 68 | // Building list of shortcuts |
69 | 69 | $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;"); |
70 | -while($shortcut = db_fetch($query)) { |
|
70 | +while ($shortcut = db_fetch($query)) { |
|
71 | 71 | $template->assign_block_vars('shortcut', array( |
72 | 72 | 'NAME' => $shortcut['title'], |
73 | 73 | 'GALAXY' => $shortcut['galaxy'], |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | // Building list of own planets & moons |
84 | -$colonies = DBStaticPlanet::db_planet_list_sorted ( $user ); |
|
85 | -if(count($colonies) > 1) { |
|
84 | +$colonies = DBStaticPlanet::db_planet_list_sorted($user); |
|
85 | +if (count($colonies) > 1) { |
|
86 | 86 | // while($row = db_fetch($colonies)) |
87 | - foreach($colonies as $row) { |
|
87 | + foreach ($colonies as $row) { |
|
88 | 88 | $template->assign_block_vars('colonies', array( |
89 | 89 | 'NAME' => $row['name'], |
90 | 90 | 'GALAXY' => $row['galaxy'], |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | //ACS Start |
100 | 100 | //Need to look for acs attacks. |
101 | 101 | $aks_madnessred = doquery('SELECT * FROM {{aks}};'); |
102 | -while($row = db_fetch($aks_madnessred)) { |
|
102 | +while ($row = db_fetch($aks_madnessred)) { |
|
103 | 103 | $members = explode(',', $row['eingeladen']); |
104 | - foreach($members as $a => $b) { |
|
104 | + foreach ($members as $a => $b) { |
|
105 | 105 | if ($b == $user['id']) { |
106 | 106 | $template->assign_block_vars('acss', array( |
107 | 107 | 'ID' => $row['id'], |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | // @version 1.0 |
6 | 6 | // @copyright 2008 by Chlorel for XNova |
7 | 7 | |
8 | -if($fleet_ship_sort = sys_get_param_id('sort_elements')) { |
|
8 | +if ($fleet_ship_sort = sys_get_param_id('sort_elements')) { |
|
9 | 9 | define('IN_AJAX', true); |
10 | - if(!empty($lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
10 | + if (!empty($lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
11 | 11 | // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT, $fleet_ship_sort); |
12 | 12 | // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE, sys_get_param_id('fleet_ship_sort_inverse', 0)); |
13 | 13 | classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT] = $fleet_ship_sort; |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | die(); |
17 | 17 | } |
18 | 18 | |
19 | -if(SN_IN_FLEET !== true) { |
|
19 | +if (SN_IN_FLEET !== true) { |
|
20 | 20 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
21 | 21 | } |
22 | 22 | |
23 | 23 | lng_include('overview'); |
24 | 24 | |
25 | -if(!$planetrow) { |
|
25 | +if (!$planetrow) { |
|
26 | 26 | messageBox($lang['fl_noplanetrow'], $lang['fl_error']); |
27 | 27 | } |
28 | 28 | |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | |
31 | 31 | $record_index = 0; |
32 | 32 | $ship_list = array(); |
33 | -foreach(sn_get_groups('fleet') as $n => $unit_id) { |
|
33 | +foreach (sn_get_groups('fleet') as $n => $unit_id) { |
|
34 | 34 | $unit_level = mrc_get_level($user, $planetrow, $unit_id, false, true); |
35 | - if($unit_level > 0) { |
|
35 | + if ($unit_level > 0) { |
|
36 | 36 | $ship_data = get_ship_data($unit_id, $user); |
37 | 37 | $ship_list[$unit_id] = array( |
38 | 38 | '__INDEX' => $record_index++, |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | |
53 | 53 | $fleet_ship_sort = classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT]; |
54 | 54 | $fleet_ship_sort_inverse = classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE]; |
55 | -if($fleet_ship_sort || $fleet_ship_sort_inverse != PLAYER_OPTION_SORT_ORDER_PLAIN) { |
|
56 | - switch($fleet_ship_sort) { |
|
55 | +if ($fleet_ship_sort || $fleet_ship_sort_inverse != PLAYER_OPTION_SORT_ORDER_PLAIN) { |
|
56 | + switch ($fleet_ship_sort) { |
|
57 | 57 | case PLAYER_OPTION_SORT_NAME: $fleet_ship_sort_field = 'NAME'; break; |
58 | 58 | case PLAYER_OPTION_SORT_SPEED: $fleet_ship_sort_field = 'SPEED'; break; |
59 | 59 | case PLAYER_OPTION_SORT_COUNT: $fleet_ship_sort_field = 'AMOUNT'; break; |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | }); |
69 | 69 | } |
70 | 70 | |
71 | -foreach($ship_list as $ship_data) { |
|
71 | +foreach ($ship_list as $ship_data) { |
|
72 | 72 | $template->assign_block_vars('ships', $ship_data); |
73 | 73 | } |
74 | 74 | |
75 | -foreach($lang['player_option_fleet_ship_sort'] as $sort_id => $sort_text) { |
|
75 | +foreach ($lang['player_option_fleet_ship_sort'] as $sort_id => $sort_text) { |
|
76 | 76 | $template->assign_block_vars('ship_sort_list', array( |
77 | 77 | 'VALUE' => $sort_id, |
78 | 78 | 'TEXT' => $sort_text, |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | // header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); |
6 | 6 | // @header("{$serverProtocol} 200 OK"); |
7 | -echo "File {$redirectFrom} not found on server. Contact administration if you think that this is error"; |
|
7 | +echo "file {$redirectFrom} not found on server. Contact administration if you think that this is error"; |
|
8 | 8 | die(); |
9 | 9 | ?> */ |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | |
19 | 19 | $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX); |
20 | 20 | if (!intval($sensorLevel)) { |
21 | - messageBox ($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
21 | + messageBox($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if ($planetrow['planet_type'] != PT_MOON) { |
25 | - messageBox ($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
25 | + messageBox($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $scan_galaxy = sys_get_param_int('galaxy'); |
29 | 29 | $scan_system = sys_get_param_int('system'); |
30 | 30 | $scan_planet = sys_get_param_int('planet'); |
31 | -$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
31 | +$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
32 | 32 | $id = sys_get_param_id('id'); |
33 | 33 | |
34 | 34 | $source_galaxy = $planetrow['galaxy']; |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $sensorRange = GetPhalanxRange($sensorLevel); |
39 | 39 | |
40 | 40 | $system_distance = abs($source_system - $scan_system); |
41 | -if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
41 | +if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
42 | 42 | { |
43 | - messageBox ($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
43 | + messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $cost = $sensorLevel * 1000; |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type); |
54 | -if(!$planet_scanned['id']) |
|
54 | +if (!$planet_scanned['id']) |
|
55 | 55 | { |
56 | 56 | messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
57 | 57 | } |
58 | 58 | |
59 | -if($planet_scanned['destruyed']) |
|
59 | +if ($planet_scanned['destruyed']) |
|
60 | 60 | { |
61 | - messageBox ($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
61 | + messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | DBStaticPlanet::db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}"); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -define('INSIDE' , true); |
|
4 | -define('INSTALL' , false); |
|
3 | +define('INSIDE', true); |
|
4 | +define('INSTALL', false); |
|
5 | 5 | define('IN_ADMIN', true); |
6 | 6 | |
7 | 7 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
12 | 12 | |
13 | 13 | $planet_active = sys_get_param_int('planet_active'); |
14 | -if(!$planet_active) { |
|
14 | +if (!$planet_active) { |
|
15 | 15 | $planet_type = sys_get_param_int('planet_type', 1); |
16 | 16 | $planet_type = $planet_type == 3 ? 3 : 1; |
17 | 17 | } else { |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $page_title = |
42 | 42 | $lang['adm_planet_list_title'] . ': ' . |
43 | - ($planet_active ? $lang['adm_planet_active'] : |
|
44 | - ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
43 | + ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
45 | 44 | ); |
46 | 45 | $template->assign_vars(array( |
47 | 46 | 'PAGE_TITLE' => $page_title, |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
6 | 6 | |
7 | -if($user['authlevel'] < 3) |
|
7 | +if ($user['authlevel'] < 3) |
|
8 | 8 | { |
9 | 9 | messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']); |
10 | 10 | die(); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | // [#] info_best_battles 1b0 |
21 | 21 | $best_reports = array(); |
22 | -if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
22 | +if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
23 | 23 | $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY); |
24 | - while($row = db_fetch($query)) { |
|
24 | + while ($row = db_fetch($query)) { |
|
25 | 25 | $best_reports[] = $row['ube_report_id']; |
26 | 26 | } |
27 | 27 | } |
@@ -185,16 +185,16 @@ discard block |
||
185 | 185 | |
186 | 186 | function sn_maintenance_pack_user_list($user_list) { |
187 | 187 | $user_list = explode(',', $user_list); |
188 | - foreach($user_list as $key => $user_id) { |
|
189 | - if(!ceil(floatval($user_id))) { |
|
188 | + foreach ($user_list as $key => $user_id) { |
|
189 | + if (!ceil(floatval($user_id))) { |
|
190 | 190 | unset($user_list[$key]); |
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
194 | 194 | $result = array(); |
195 | - if(!empty($user_list)) { |
|
195 | + if (!empty($user_list)) { |
|
196 | 196 | $query = doquery("SELECT `id` FROM {{users}} WHERE `id` in (" . implode(',', $user_list) . ")"); |
197 | - while($row = db_fetch($query)) { |
|
197 | + while ($row = db_fetch($query)) { |
|
198 | 198 | $result[] = $row['id']; |
199 | 199 | } |
200 | 200 | } |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false; |
210 | 210 | sn_db_transaction_commit(); |
211 | 211 | |
212 | -foreach($ques as $que_transaction) { |
|
212 | +foreach ($ques as $que_transaction) { |
|
213 | 213 | sn_db_transaction_start(); |
214 | 214 | |
215 | 215 | !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; |
216 | - foreach($que_transaction as $que) { |
|
216 | + foreach ($que_transaction as $que) { |
|
217 | 217 | set_time_limit(120); |
218 | 218 | $QryResult = doquery($que); |
219 | 219 | //$msg .= '<hr>' . $que . '<hr>'; |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | * @copyright 2008 by Chlorel for XNova |
10 | 10 | */ |
11 | 11 | |
12 | -define('INSIDE' , true); |
|
13 | -define('INSTALL' , false); |
|
12 | +define('INSIDE', true); |
|
13 | +define('INSTALL', false); |
|
14 | 14 | define('IN_ADMIN', true); |
15 | 15 | require_once('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
20 | 20 | |
21 | -if(SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_end')) |
|
21 | +if (SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_stat_update_end')) |
|
22 | 22 | { |
23 | 23 | classSupernova::$config->db_saveItem('var_stat_update_admin_forced', SN_TIME_NOW + 120); |
24 | 24 |
@@ -37,8 +37,7 @@ |
||
37 | 37 | </script>'; |
38 | 38 | |
39 | 39 | messageBoxAdmin("{$script}<img src=\"design/images/progressbar.gif\"><br>{$lang['sys_wait']}", $lang['adm_stat_title'], '', 0); |
40 | -} |
|
41 | -else |
|
40 | +} else |
|
42 | 41 | { |
43 | 42 | messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php'); |
44 | 43 | } |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | |
3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
4 | 4 | |
5 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
5 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
6 | 6 | $error_message = classSupernova::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
7 | 7 | !classSupernova::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
8 | 8 | ); |
9 | 9 | |
10 | - if($error_message) { |
|
10 | + if ($error_message) { |
|
11 | 11 | messageBox($lang[$error_message], $lang['sys_error'], 'overview.php', 10); |
12 | 12 | die(); |
13 | 13 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | $current_round = intval(classSupernova::$config->db_loadItem('game_blitz_register_round')); |
18 | 18 | $current_price = intval(classSupernova::$config->db_loadItem('game_blitz_register_price')); |
19 | 19 | |
20 | -if(classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
20 | +if (classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
21 | 21 | sn_db_transaction_start(); |
22 | 22 | $user = db_user_by_id($user['id'], true); |
23 | 23 | $is_registered = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `user_id` = {$user['id']} AND `round_number` = {$current_round} FOR UPDATE;", true); |
24 | - if(sys_get_param_str('register_me')) { |
|
25 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
24 | + if (sys_get_param_str('register_me')) { |
|
25 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
26 | 26 | doquery("INSERT IGNORE INTO {{blitz_registrations}} SET `user_id` = {$user['id']}, `round_number` = {$current_round};"); |
27 | 27 | //mm_points_change($user['id'], RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
28 | 28 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $blitz_players = 0; |
44 | 44 | $blitz_prize_dark_matter = 0; |
45 | 45 | $blitz_prize_places = 0; |
46 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
47 | - if(sys_get_param_str('generate')) { |
|
46 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
47 | + if (sys_get_param_str('generate')) { |
|
48 | 48 | $next_id = 0; |
49 | 49 | $query = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY RAND();"); |
50 | - while($row = db_fetch($query)) { |
|
50 | + while ($row = db_fetch($query)) { |
|
51 | 51 | $next_id++; |
52 | 52 | $blitz_name = 'Игрок' . $next_id; |
53 | 53 | $blitz_password = sys_random_string(8); |
54 | 54 | doquery("UPDATE {{blitz_registrations}} SET blitz_name = '{$blitz_name}', blitz_password = '{$blitz_password}' WHERE `id` = {$row['id']} AND `round_number` = {$current_round};"); |
55 | 55 | } |
56 | - } elseif(sys_get_param_str('import_generated')) { |
|
56 | + } elseif (sys_get_param_str('import_generated')) { |
|
57 | 57 | // ЭТО НА БЛИЦЕ!!! |
58 | 58 | doquery("DELETE FROM {{users}} WHERE username like 'Игрок%';"); |
59 | 59 | doquery("DELETE FROM {{planets}} WHERE id_owner not in (SELECT `id` FROM {{users}});"); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $system = $system_step; |
76 | 76 | $planet = round(classSupernova::$config->game_maxPlanet / 2); |
77 | 77 | |
78 | - foreach($imported_string as &$string_data) { |
|
78 | + foreach ($imported_string as &$string_data) { |
|
79 | 79 | $string_data = explode(',', $string_data); |
80 | 80 | $username_safe = $string_data[0]; |
81 | 81 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false); |
97 | 97 | |
98 | - if(($system += $system_step) >= classSupernova::$config->game_maxSystem) { |
|
98 | + if (($system += $system_step) >= classSupernova::$config->game_maxSystem) { |
|
99 | 99 | $galaxy++; |
100 | 100 | $system = $system_step; |
101 | 101 | } |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | |
105 | 105 | classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->users_amount + $new_players); |
106 | 106 | // generated_string |
107 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
107 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
108 | 108 | $blitz_result = explode(';', $blitz_result_string); |
109 | 109 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
110 | 110 | unset($blitz_result[0]); |
111 | - foreach($blitz_result as $blitz_result_data) { |
|
111 | + foreach ($blitz_result as $blitz_result_data) { |
|
112 | 112 | $blitz_result_data = explode(',', $blitz_result_data); |
113 | - if(count($blitz_result_data) == 5) { |
|
113 | + if (count($blitz_result_data) == 5) { |
|
114 | 114 | $blitz_result_data[1] = db_escape($blitz_result_data[1]); |
115 | 115 | doquery( |
116 | 116 | "UPDATE `{{blitz_registrations}}` SET |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | $blitz_result = array(); |
125 | 125 | } |
126 | 126 | |
127 | - if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
127 | + if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
128 | 128 | $blitz_result = array(classSupernova::$config->db_loadItem('var_stat_update')); |
129 | 129 | $query = doquery("SELECT id, username, total_rank, total_points, onlinetime FROM {{users}} ORDER BY `id`;"); |
130 | - while($row = db_fetch($query)) { |
|
130 | + while ($row = db_fetch($query)) { |
|
131 | 131 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
132 | 132 | } |
133 | 133 | } else { |
134 | 134 | $query = doquery("SELECT blitz_name, blitz_password, blitz_online FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `id`;"); |
135 | - while($row = db_fetch($query)) { |
|
135 | + while ($row = db_fetch($query)) { |
|
136 | 136 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
137 | 137 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
138 | 138 | $blitz_players++; |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | 'Игрок40' |
148 | 148 | */ |
149 | 149 | |
150 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
150 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
151 | 151 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
152 | 152 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
153 | 153 | sn_db_transaction_start(); |
154 | 154 | $query = doquery("SELECT * FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `blitz_place` FOR UPDATE;"); |
155 | - while($row = db_fetch($query)) { |
|
156 | - if(!$row['blitz_place']) { |
|
155 | + while ($row = db_fetch($query)) { |
|
156 | + if (!$row['blitz_place']) { |
|
157 | 157 | continue; |
158 | 158 | } |
159 | 159 | |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | $blitz_prize_places_actual--; |
162 | 162 | |
163 | 163 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
164 | -pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}",$row['id']); |
|
165 | - if($reward) { |
|
164 | +pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
|
165 | + if ($reward) { |
|
166 | 166 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
167 | 167 | $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
168 | 168 | )); |
169 | 169 | doquery("UPDATE {{blitz_registrations}} SET blitz_reward_dark_matter = blitz_reward_dark_matter + ($reward) WHERE id = {$row['id']} AND `round_number` = {$current_round};"); |
170 | 170 | } |
171 | 171 | |
172 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
172 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
173 | 173 | break; |
174 | 174 | } |
175 | 175 | } |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | JOIN {{users}} AS u ON u.id = br.user_id |
190 | 190 | WHERE br.`round_number` = {$current_round} |
191 | 191 | order by `blitz_place`, `timestamp`;"); |
192 | -while($row = db_fetch($query)) { |
|
192 | +while ($row = db_fetch($query)) { |
|
193 | 193 | $tpl_player_data = array( |
194 | 194 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
195 | 195 | ); |
196 | 196 | |
197 | - if(classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
197 | + if (classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
198 | 198 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
199 | 199 | $tpl_player_data = array_merge($tpl_player_data, array( |
200 | 200 | 'ID' => $row['id'], |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | |
209 | 209 | $template->assign_block_vars('registrations', $tpl_player_data); |
210 | - if($row['id'] == $user['id']) { |
|
210 | + if ($row['id'] == $user['id']) { |
|
211 | 211 | $player_registered = $row; |
212 | 212 | } |
213 | 213 | } |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | $galaxy = isset($vector[$prefix . 'galaxy']) ? intval($vector[$prefix . 'galaxy']) : 0; |
40 | 40 | $system = isset($vector[$prefix . 'system']) ? intval($vector[$prefix . 'system']) : 0; |
41 | 41 | $planet = isset($vector[$prefix . 'planet']) ? intval($vector[$prefix . 'planet']) : 0; |
42 | - $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : |
|
43 | - (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
42 | + $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
44 | 43 | $planet_type = $planet_type == PT_DEBRIS ? PT_PLANET : $planet_type; |
45 | 44 | |
46 | 45 | return DBStaticPlanet::db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update, $fields); |
@@ -61,7 +60,7 @@ discard block |
||
61 | 60 | // } |
62 | 61 | |
63 | 62 | public static function db_planet_by_parent($parent_id, $for_update = false, $fields = '*') { |
64 | - if(!($parent_id = idval($parent_id))) { |
|
63 | + if (!($parent_id = idval($parent_id))) { |
|
65 | 64 | return false; |
66 | 65 | } |
67 | 66 | |
@@ -70,7 +69,7 @@ discard block |
||
70 | 69 | } |
71 | 70 | |
72 | 71 | public static function db_planet_by_id_and_owner($planet_id, $owner_id, $for_update = false, $fields = '*') { |
73 | - if(!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
72 | + if (!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
74 | 73 | return false; |
75 | 74 | } |
76 | 75 | return classSupernova::db_get_record_list(LOC_PLANET, |
@@ -79,7 +78,7 @@ discard block |
||
79 | 78 | |
80 | 79 | |
81 | 80 | public static function db_planet_list_moon_other($user_id, $this_moon_id) { |
82 | - if(!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
81 | + if (!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
83 | 82 | return false; |
84 | 83 | } |
85 | 84 | return classSupernova::db_get_record_list(LOC_PLANET, |
@@ -94,7 +93,7 @@ discard block |
||
94 | 93 | } |
95 | 94 | |
96 | 95 | public static function db_planet_list_sorted($user_row, $skip_planet_id = false, $field_list = '', $conditions = '') { |
97 | - if(!is_array($user_row)) { |
|
96 | + if (!is_array($user_row)) { |
|
98 | 97 | return false; |
99 | 98 | } |
100 | 99 | $conditions .= $skip_planet_id ? " AND `id` <> {$skip_planet_id} " : ''; |
@@ -115,7 +114,7 @@ discard block |
||
115 | 114 | } |
116 | 115 | |
117 | 116 | public static function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
118 | - if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
117 | + if (!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
119 | 118 | return false; |
120 | 119 | } |
121 | 120 | |
@@ -124,14 +123,14 @@ discard block |
||
124 | 123 | } |
125 | 124 | |
126 | 125 | public static function db_planet_set_by_id($planet_id, $set) { |
127 | - if(!($planet_id = idval($planet_id))) { |
|
126 | + if (!($planet_id = idval($planet_id))) { |
|
128 | 127 | return false; |
129 | 128 | } |
130 | 129 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
131 | 130 | } |
132 | 131 | |
133 | 132 | public static function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) { |
134 | - if(!($set = trim($set))) { |
|
133 | + if (!($set = trim($set))) { |
|
135 | 134 | return false; |
136 | 135 | } |
137 | 136 | |
@@ -144,14 +143,14 @@ discard block |
||
144 | 143 | } |
145 | 144 | |
146 | 145 | public static function db_planet_set_by_parent($ui_parent_id, $ss_set) { |
147 | - if(!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
146 | + if (!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
148 | 147 | return false; |
149 | 148 | } |
150 | 149 | return classSupernova::db_upd_record_list(LOC_PLANET, "`parent_planet` = {$si_parent_id}", $ss_set); |
151 | 150 | } |
152 | 151 | |
153 | 152 | public static function db_planet_set_by_owner($ui_owner_id, $ss_set) { |
154 | - if(!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
153 | + if (!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
155 | 154 | return false; |
156 | 155 | } |
157 | 156 | return classSupernova::db_upd_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}", $ss_set); |
@@ -159,7 +158,7 @@ discard block |
||
159 | 158 | |
160 | 159 | |
161 | 160 | public static function db_planet_delete_by_id($planet_id) { |
162 | - if(!($planet_id = idval($planet_id))) { |
|
161 | + if (!($planet_id = idval($planet_id))) { |
|
163 | 162 | return false; |
164 | 163 | } |
165 | 164 | classSupernova::db_del_record_by_id(LOC_PLANET, $planet_id); |
@@ -169,7 +168,7 @@ discard block |
||
169 | 168 | } |
170 | 169 | |
171 | 170 | public static function db_planet_list_delete_by_owner($ui_owner_id) { |
172 | - if(!($si_owner_id = idval($ui_owner_id))) { |
|
171 | + if (!($si_owner_id = idval($ui_owner_id))) { |
|
173 | 172 | return false; |
174 | 173 | } |
175 | 174 | classSupernova::db_del_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}"); |