@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | * @copyright 2008 by ??????? for XNova |
9 | 9 | */ |
10 | 10 | |
11 | -define('INSIDE' , true); |
|
12 | -define('INSTALL' , false); |
|
11 | +define('INSIDE', true); |
|
12 | +define('INSTALL', false); |
|
13 | 13 | define('IN_ADMIN', true); |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 | |
16 | -if($user['authlevel'] < 3) { |
|
16 | +if ($user['authlevel'] < 3) { |
|
17 | 17 | AdminMessage($lang['adm_err_denied']); |
18 | 18 | } |
19 | 19 | |
20 | 20 | $template = gettemplate('admin/settings', true); |
21 | 21 | |
22 | -if(sys_get_param('save')) { |
|
22 | +if (sys_get_param('save')) { |
|
23 | 23 | $config->game_name = sys_get_param_str_unsafe('game_name'); |
24 | 24 | $config->game_mode = sys_get_param_int('game_mode'); |
25 | 25 | $config->game_speed = sys_get_param_float('game_speed', 1); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $config->url_faq = sys_get_param_str_unsafe('url_faq'); |
30 | 30 | $config->url_forum = sys_get_param_str_unsafe('url_forum'); |
31 | 31 | $config->url_rules = sys_get_param_str_unsafe('url_rules'); |
32 | - $config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
32 | + $config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
33 | 33 | $config->game_disable = sys_get_param_int('game_disable'); |
34 | 34 | $config->game_disable_reason = sys_get_param_str_unsafe('game_disable_reason'); |
35 | 35 | $config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto'); |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | $config->stats_schedule = sys_get_param_str('stats_schedule'); |
97 | 97 | |
98 | 98 | $config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period'); |
99 | - if($config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
100 | - if($config->empire_mercenary_temporary) { |
|
99 | + if ($config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
100 | + if ($config->empire_mercenary_temporary) { |
|
101 | 101 | db_unit_list_admin_delete_mercenaries_finished(); |
102 | 102 | } else { |
103 | 103 | db_unit_list_admin_set_mercenaries_expire_time($config->empire_mercenary_base_period); |
@@ -140,21 +140,21 @@ discard block |
||
140 | 140 | // 'STATS_SCHEDULE' => $config->stats_hide_player_list, |
141 | 141 | )); |
142 | 142 | |
143 | -foreach($lang['sys_game_disable_reason'] as $id => $name) { |
|
143 | +foreach ($lang['sys_game_disable_reason'] as $id => $name) { |
|
144 | 144 | $template->assign_block_vars('sys_game_disable_reason', array( |
145 | 145 | 'ID' => $id, |
146 | 146 | 'NAME' => $name, |
147 | 147 | )); |
148 | 148 | } |
149 | 149 | |
150 | -foreach($lang['sys_game_mode'] as $mode_id => $mode_name) { |
|
150 | +foreach ($lang['sys_game_mode'] as $mode_id => $mode_name) { |
|
151 | 151 | $template->assign_block_vars('game_modes', array( |
152 | 152 | 'ID' => $mode_id, |
153 | 153 | 'NAME' => $mode_name, |
154 | 154 | )); |
155 | 155 | } |
156 | 156 | |
157 | -foreach($lang['adm_opt_ver_response'] as $ver_id => $ver_response) { |
|
157 | +foreach ($lang['adm_opt_ver_response'] as $ver_id => $ver_response) { |
|
158 | 158 | $template->assign_block_vars('ver_response', array( |
159 | 159 | 'ID' => $ver_id, |
160 | 160 | 'NAME' => js_safe_string($ver_response), |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | $lang_list = lng_get_list(); |
165 | -foreach($lang_list as $lang_id => $lang_data) { |
|
165 | +foreach ($lang_list as $lang_id => $lang_data) { |
|
166 | 166 | $template->assign_block_vars('game_languages', array( |
167 | 167 | 'ID' => $lang_id, |
168 | 168 | 'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})", |
@@ -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)); |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | global $config, $lang, $user; |
10 | 10 | |
11 | 11 | // if($user['authlevel'] < 1) |
12 | -if($user['authlevel'] < 3) { |
|
12 | +if ($user['authlevel'] < 3) { |
|
13 | 13 | AdminMessage($lang['adm_err_denied']); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $planet_active = sys_get_param_int('planet_active'); |
17 | -if(!$planet_active) { |
|
17 | +if (!$planet_active) { |
|
18 | 18 | $planet_type = sys_get_param_int('planet_type', 1); |
19 | 19 | $planet_type = $planet_type == 3 ? 3 : 1; |
20 | 20 | } else { |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $page_title = |
45 | 45 | $lang['adm_planet_list_title'] . ': ' . |
46 | - ($planet_active ? $lang['adm_planet_active'] : |
|
47 | - ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
46 | + ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
48 | 47 | ); |
49 | 48 | $template->assign_vars(array( |
50 | 49 | 'PAGE_TITLE' => $page_title, |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
8 | 8 | |
9 | 9 | // if($user['authlevel'] < 2) |
10 | -if($user['authlevel'] < 3) |
|
10 | +if ($user['authlevel'] < 3) |
|
11 | 11 | { |
12 | 12 | AdminMessage($lang['adm_err_denied']); |
13 | 13 | } |
@@ -21,30 +21,30 @@ discard block |
||
21 | 21 | $planet_id = sys_get_param_id('planet_id'); |
22 | 22 | |
23 | 23 | $unit_list = sys_get_param('unit_list'); |
24 | -if(sys_get_param('change_data') && !empty($unit_list)) |
|
24 | +if (sys_get_param('change_data') && !empty($unit_list)) |
|
25 | 25 | { |
26 | 26 | $query_string = array(); |
27 | - foreach($unit_list as $unit_id => $unit_amount) |
|
27 | + foreach ($unit_list as $unit_id => $unit_amount) |
|
28 | 28 | { |
29 | - if($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) |
|
29 | + if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) |
|
30 | 30 | { |
31 | 31 | $query_string[] = $unit_query_string; |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - if(!empty($query_string)) |
|
35 | + if (!empty($query_string)) |
|
36 | 36 | { |
37 | 37 | db_planet_set_by_id($planet_id, implode(', ', $query_string)); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | -if($planet_id) |
|
41 | +if ($planet_id) |
|
42 | 42 | { |
43 | 43 | $edit_planet_row = db_planet_by_id($planet_id); |
44 | 44 | admin_planet_edit_template($template, $edit_planet_row, $mode); |
45 | 45 | } |
46 | 46 | |
47 | -foreach($admin_planet_edit_mode_list as $page_mode => $mode_locale) |
|
47 | +foreach ($admin_planet_edit_mode_list as $page_mode => $mode_locale) |
|
48 | 48 | { |
49 | 49 | $template->assign_block_vars('page_menu', array( |
50 | 50 | 'ID' => $page_mode, |
@@ -7,13 +7,13 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 | |
16 | -if($user['authlevel'] < 2) |
|
16 | +if ($user['authlevel'] < 2) |
|
17 | 17 | { |
18 | 18 | AdminMessage($lang['adm_err_denied']); |
19 | 19 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -define('INSIDE' , true); |
|
3 | -define('INSTALL' , false); |
|
2 | +define('INSIDE', true); |
|
3 | +define('INSTALL', false); |
|
4 | 4 | define('IN_ADMIN', true); |
5 | 5 | |
6 | 6 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
7 | 7 | |
8 | -if($user['authlevel'] < 3) |
|
8 | +if ($user['authlevel'] < 3) |
|
9 | 9 | { |
10 | 10 | AdminMessage($lang['adm_err_denied']); |
11 | 11 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $username_unsafe = sys_get_param_str_unsafe('username'); |
26 | 26 | $username = sys_get_param_escaped('username'); |
27 | 27 | |
28 | -if($galaxy_src) |
|
28 | +if ($galaxy_src) |
|
29 | 29 | { |
30 | 30 | sn_db_transaction_start(); |
31 | 31 | $errors = array(); |
@@ -35,41 +35,41 @@ discard block |
||
35 | 35 | $planet = sys_o_get_updated($owner, array('galaxy' => $galaxy_src, 'system' => $system_src, 'planet' => $planet_src, 'planet_type' => 1), SN_TIME_NOW); |
36 | 36 | $que = $planet['que']; |
37 | 37 | $planet = $planet['planet']; |
38 | - if(!$planet) |
|
38 | + if (!$planet) |
|
39 | 39 | { |
40 | 40 | $errors[] = $lang['adm_pl_comp_err_0']; |
41 | 41 | } |
42 | 42 | |
43 | - if($planet['destruyed']) |
|
43 | + if ($planet['destruyed']) |
|
44 | 44 | { |
45 | 45 | $errors[] = $lang['adm_pl_comp_err_1']; |
46 | 46 | } |
47 | 47 | |
48 | - if($planet['id_owner'] != $owner['id'] || !$username) |
|
48 | + if ($planet['id_owner'] != $owner['id'] || !$username) |
|
49 | 49 | { |
50 | 50 | $errors[] = $lang['adm_pl_comp_err_4']; |
51 | 51 | } |
52 | 52 | |
53 | 53 | $destination = sys_o_get_updated($owner, array('galaxy' => $galaxy_dst, 'system' => $system_dst, 'planet' => $planet_dst, 'planet_type' => 1), SN_TIME_NOW); |
54 | 54 | $destination = $destination['planet']; |
55 | - if(!$destination) |
|
55 | + if (!$destination) |
|
56 | 56 | { |
57 | 57 | $errors[] = $lang['adm_pl_comp_err_2']; |
58 | 58 | } |
59 | 59 | |
60 | - if($planet['id'] == $destination['id']) |
|
60 | + if ($planet['id'] == $destination['id']) |
|
61 | 61 | { |
62 | 62 | $errors[] = $lang['adm_pl_comp_err_5']; |
63 | 63 | } |
64 | 64 | |
65 | - if($planet['id_owner'] != $destination['id_owner']) |
|
65 | + if ($planet['id_owner'] != $destination['id_owner']) |
|
66 | 66 | { |
67 | 67 | $errors[] = $lang['adm_pl_comp_err_3']; |
68 | 68 | } |
69 | 69 | |
70 | - if(!empty($errors)) |
|
70 | + if (!empty($errors)) |
|
71 | 71 | { |
72 | - foreach($errors as $error) |
|
72 | + foreach ($errors as $error) |
|
73 | 73 | { |
74 | 74 | $template->assign_block_vars('error', array( |
75 | 75 | 'TEXT' => $error, |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | killer_add_planet($planet); |
84 | 84 | |
85 | 85 | $moon = db_planet_by_gspt($galaxy_src, $system_src, $planet_src, PT_MOON, true); |
86 | - if($moon) |
|
86 | + if ($moon) |
|
87 | 87 | { |
88 | 88 | $moon = sys_o_get_updated($owner, $moon, SN_TIME_NOW); |
89 | 89 | $moon = $moon['planet']; |
90 | 90 | killer_add_planet($moon); |
91 | 91 | } |
92 | 92 | |
93 | - foreach(sn_get_groups('resources_loot') as $resource_id) |
|
93 | + foreach (sn_get_groups('resources_loot') as $resource_id) |
|
94 | 94 | { |
95 | 95 | $resource_name = pname_resource_name($resource_id); |
96 | 96 | $template->assign_var("{$resource_name}_cost", $final_cost[$resource_id]); |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $template->assign_var("{$resource_name}_bonus", $final_cost[$resource_id]); |
99 | 99 | } |
100 | 100 | |
101 | - if($_GET['btn_confirm']) |
|
101 | + if ($_GET['btn_confirm']) |
|
102 | 102 | { |
103 | 103 | $time = SN_TIME_NOW + PERIOD_DAY; |
104 | 104 | |
105 | 105 | db_unit_list_delete($planet['id_owner'], LOC_PLANET, $planet['id']); |
106 | 106 | db_planet_set_by_id($planet['id'], "id_owner = 0, destruyed = {$time}"); |
107 | - if($moon) |
|
107 | + if ($moon) |
|
108 | 108 | { |
109 | 109 | db_unit_list_delete($planet['id_owner'], LOC_PLANET, $moon['id']); |
110 | 110 | db_planet_set_by_id($moon['id'], "id_owner = 0, destruyed = {$time}"); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'username' => $username, |
132 | 132 | )); |
133 | 133 | |
134 | -display(parsetemplate($template, $parse), $lang['adm_pl_comp_title'], false, '', true ); |
|
134 | +display(parsetemplate($template, $parse), $lang['adm_pl_comp_title'], false, '', true); |
|
135 | 135 | |
136 | 136 | function killer_add_planet($planet) |
137 | 137 | { |
@@ -146,34 +146,34 @@ discard block |
||
146 | 146 | } |
147 | 147 | */ |
148 | 148 | |
149 | - foreach(sn_get_groups('structures') as $unit_id) |
|
149 | + foreach (sn_get_groups('structures') as $unit_id) |
|
150 | 150 | { |
151 | 151 | $build_level = mrc_get_level($user, $planet, $unit_id, true, true); |
152 | - if($build_level > 0) |
|
152 | + if ($build_level > 0) |
|
153 | 153 | { |
154 | 154 | $unit_cost = get_unit_param($unit_id, 'cost'); |
155 | 155 | $build_factor = $unit_cost['factor'] != 1 ? (1 - pow($unit_cost['factor'], $build_level)) / (1 - $unit_cost['factor']) : $unit_cost['factor']; |
156 | - foreach($sn_group_resources_loot as $resource_id) |
|
156 | + foreach ($sn_group_resources_loot as $resource_id) |
|
157 | 157 | { |
158 | 158 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $build_factor) : 0; |
159 | 159 | } |
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | - foreach(sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
163 | + foreach (sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
164 | 164 | { |
165 | 165 | $unit_count = mrc_get_level($user, $planet, $unit_id, true, true); |
166 | - if($unit_count > 0) |
|
166 | + if ($unit_count > 0) |
|
167 | 167 | { |
168 | 168 | $unit_cost = get_unit_param($unit_id, 'cost'); |
169 | - foreach($sn_group_resources_loot as $resource_id) |
|
169 | + foreach ($sn_group_resources_loot as $resource_id) |
|
170 | 170 | { |
171 | 171 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $unit_count) : 0; |
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - foreach($sn_group_resources_loot as $resource_id) |
|
176 | + foreach ($sn_group_resources_loot as $resource_id) |
|
177 | 177 | { |
178 | 178 | $final_cost[$resource_id] += floor(mrc_get_level($user, $planet, $resource_id, true, true)); |
179 | 179 | } |
@@ -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 | } |
@@ -9,18 +9,18 @@ |
||
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 | |
17 | 17 | // if($user['authlevel'] < 1) |
18 | -if($user['authlevel'] < 3) |
|
18 | +if ($user['authlevel'] < 3) |
|
19 | 19 | { |
20 | 20 | AdminMessage($lang['adm_err_denied']); |
21 | 21 | } |
22 | 22 | |
23 | -if(SN_TIME_NOW >= $config->db_loadAll('var_stat_update_admin_forced') && SN_TIME_NOW >= $config->db_loadAll('var_stat_update_end')) |
|
23 | +if (SN_TIME_NOW >= $config->db_loadAll('var_stat_update_admin_forced') && SN_TIME_NOW >= $config->db_loadAll('var_stat_update_end')) |
|
24 | 24 | { |
25 | 25 | $config->db_saveItem('var_stat_update_admin_forced', SN_TIME_NOW + 120); |
26 | 26 |
@@ -43,8 +43,7 @@ |
||
43 | 43 | doquery("UPDATE {{alliance}} SET ally_user_id = {$ally_user_id} WHERE id = {$ally_id} LIMIT 1;"); |
44 | 44 | |
45 | 45 | message(str_replace('%s', $ally_tag_raw, $lang['ally_been_maked']), str_replace('%s', $ally_tag_raw, $lang['ally_maked'])); |
46 | -} |
|
47 | -else |
|
46 | +} else |
|
48 | 47 | { |
49 | 48 | $page .= parsetemplate(gettemplate('ali_external_make'), $lang); |
50 | 49 | } |
@@ -7,25 +7,25 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 | |
16 | -if($user['authlevel'] < 3) { |
|
16 | +if ($user['authlevel'] < 3) { |
|
17 | 17 | AdminMessage($lang['adm_err_denied']); |
18 | 18 | } |
19 | 19 | |
20 | 20 | function adm_lng_assign_string($lang_id, $locale_string_name, $value) { |
21 | 21 | global $locale_string_template, $languages_info, $languages, $domain; |
22 | 22 | |
23 | - if(is_array($value)) { |
|
24 | - foreach($value as $sub_key => $sub_value) { |
|
23 | + if (is_array($value)) { |
|
24 | + foreach ($value as $sub_key => $sub_value) { |
|
25 | 25 | adm_lng_assign_string($lang_id, "{$locale_string_name}[{$sub_key}]", $sub_value); |
26 | 26 | } |
27 | - } elseif($value) { |
|
28 | - if(!isset($locale_string_template[$locale_string_name])) { |
|
27 | + } elseif ($value) { |
|
28 | + if (!isset($locale_string_template[$locale_string_name])) { |
|
29 | 29 | $locale_string_template[$locale_string_name] = array(); |
30 | 30 | } |
31 | 31 | $locale_string_template[$locale_string_name] = array_merge($locale_string_template[$locale_string_name], array("[{$lang_id}]" => htmlentities($value, ENT_COMPAT, 'utf-8'))); |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | global $domain, $lang_id; |
47 | 47 | |
48 | 48 | $return = "{$ident}'{$string_name}' => "; |
49 | - if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
49 | + if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
50 | 50 | $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"; |
51 | 51 | } else { |
52 | 52 | $return .= "array(\r\n"; |
53 | - foreach($string_value as $arr_name => $arr_data) { |
|
53 | + foreach ($string_value as $arr_name => $arr_data) { |
|
54 | 54 | $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . ' '); |
55 | 55 | } |
56 | 56 | $return .= "{$ident}),\r\n"; |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | |
104 | 104 | $string_name_new = false; |
105 | 105 | |
106 | - if(isset($honor_constants[$domain][$string_name_prefix])) { |
|
106 | + if (isset($honor_constants[$domain][$string_name_prefix])) { |
|
107 | 107 | $found_constants = array_keys($constants, $string_name); |
108 | - foreach($found_constants as $constant_name) { |
|
108 | + foreach ($found_constants as $constant_name) { |
|
109 | 109 | $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]); |
110 | - foreach($honor_prefix_list as $honor_prefix) { |
|
111 | - if(strpos($constant_name, $honor_prefix) === 0) { |
|
110 | + foreach ($honor_prefix_list as $honor_prefix) { |
|
111 | + if (strpos($constant_name, $honor_prefix) === 0) { |
|
112 | 112 | $string_name_new = $constant_name; |
113 | 113 | break; |
114 | 114 | } |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | |
119 | 119 | $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'"; |
120 | 120 | fwrite($file_handler, "{$ident}{$string_name_new} => "); |
121 | - if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
121 | + if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
122 | 122 | fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"); |
123 | 123 | } else { |
124 | 124 | $string_name_prefix = $string_name_prefix . "[{$string_name}]"; |
125 | 125 | fwrite($file_handler, "array(\r\n"); |
126 | - foreach($string_value as $arr_name => $arr_data) { |
|
126 | + foreach ($string_value as $arr_name => $arr_data) { |
|
127 | 127 | adm_lng_write_string($arr_name, $arr_data, $ident . ' ', $string_name_prefix); |
128 | 128 | } |
129 | 129 | fwrite($file_handler, "{$ident}),\r\n"); |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | $languages_info = lng_get_list(); |
144 | 144 | $domain = sys_get_param_str('domain'); |
145 | 145 | |
146 | -if($domain) { |
|
146 | +if ($domain) { |
|
147 | 147 | $lang_new = sys_get_param('lang_new'); |
148 | - if(!empty($lang_new)) { |
|
148 | + if (!empty($lang_new)) { |
|
149 | 149 | $constants = get_defined_constants(true); |
150 | 150 | $constants = $constants['user']; |
151 | 151 | ksort($constants); |
152 | - foreach($languages_info as $lang_id => $land_data) { |
|
152 | + foreach ($languages_info as $lang_id => $land_data) { |
|
153 | 153 | $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w'); |
154 | 154 | fwrite($file_handler, "<?php\r\n\r\n/*\r\n############################################################################# |
155 | 155 | # Filename: {$domain}.mo.php |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | # Website: http://www.supernova.ws |
158 | 158 | # Description: Massive Multiplayer Online Browser Space Startegy Game\r\n#\r\n"); |
159 | 159 | |
160 | - foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
160 | + foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
161 | 161 | $lang_copyright = str_replace(array('©', '"', '<', '>'), array('©', '"', '<', '>'), $lang_copyright); |
162 | 162 | fwrite($file_handler, "# {$lang_copyright}\r\n"); |
163 | 163 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version " . SN_VERSION . "\r\n*\r\n*/\r\n |
166 | 166 | /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n |
167 | 167 | \$a_lang_array = array(\r\n"); |
168 | - foreach($lang_new as $string_name => $string_value) { |
|
168 | + foreach ($lang_new as $string_name => $string_value) { |
|
169 | 169 | adm_lng_write_string($string_name, $string_value); |
170 | 170 | } |
171 | 171 | fwrite($file_handler, ");\r\n"); |
@@ -176,21 +176,21 @@ discard block |
||
176 | 176 | die(); |
177 | 177 | } |
178 | 178 | |
179 | - foreach($languages_info as $lang_id => $lang_data) { |
|
179 | + foreach ($languages_info as $lang_id => $lang_data) { |
|
180 | 180 | $template->assign_block_vars('language', $lang_data); |
181 | 181 | $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php"; |
182 | 182 | $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : '')); |
183 | - foreach($languages[$lang_id] as $locale_string_name => $cork) { |
|
183 | + foreach ($languages[$lang_id] as $locale_string_name => $cork) { |
|
184 | 184 | adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]); |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - foreach($locale_string_template as $locale_string_name => $locale_string_list) { |
|
188 | + foreach ($locale_string_template as $locale_string_name => $locale_string_list) { |
|
189 | 189 | $template->assign_block_vars('string', array( |
190 | 190 | 'NAME' => $locale_string_name, |
191 | 191 | )); |
192 | 192 | |
193 | - foreach($languages_info as $lang_id => $cork2) { |
|
193 | + foreach ($languages_info as $lang_id => $cork2) { |
|
194 | 194 | $template->assign_block_vars('string.locale', array( |
195 | 195 | 'LANG' => $lang_id, |
196 | 196 | 'VALUE' => $locale_string_list["[{$lang_id}]"], |
@@ -206,17 +206,17 @@ discard block |
||
206 | 206 | $dir = dir($path); |
207 | 207 | while (false !== ($lang_id = $dir->read())) { |
208 | 208 | $full_path = $path . $lang_id; |
209 | - if($lang_id[0] != "." && is_dir($full_path)) { |
|
209 | + if ($lang_id[0] != "." && is_dir($full_path)) { |
|
210 | 210 | $lang_file_list = dir($full_path); |
211 | 211 | while (false !== ($filename = $lang_file_list->read())) { |
212 | 212 | $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.'))); |
213 | - if(!$lang_domain) { |
|
213 | + if (!$lang_domain) { |
|
214 | 214 | continue; |
215 | 215 | } |
216 | 216 | |
217 | 217 | $file_ext = strtolower(substr($filename, strpos($filename, '.'))); |
218 | - if($lang_domain != 'language') { |
|
219 | - if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) { |
|
218 | + if ($lang_domain != 'language') { |
|
219 | + if ($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) { |
|
220 | 220 | $language_domains[$lang_domain] = $lang_domain; |
221 | 221 | $languages[$lang_id][$lang_domain] = $lang_domain; |
222 | 222 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | $dir->close(); |
228 | 228 | |
229 | - foreach($language_domains as $lang_domain) { |
|
229 | + foreach ($language_domains as $lang_domain) { |
|
230 | 230 | $template->assign_block_vars('domain', array( |
231 | 231 | 'NAME' => $lang_domain, |
232 | 232 | )); |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | |
16 | 16 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | |
18 | -if(!sn_module_get_active_count('payment')) { |
|
18 | +if (!sn_module_get_active_count('payment')) { |
|
19 | 19 | sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php'); |
20 | 20 | } |
21 | 21 | |
22 | -if($user['authlevel'] < 3) { |
|
22 | +if ($user['authlevel'] < 3) { |
|
23 | 23 | AdminMessage($lang['adm_err_denied']); |
24 | 24 | } |
25 | 25 | |
@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | $message = ''; |
29 | 29 | $message_status = ERR_ERROR; |
30 | 30 | |
31 | -if($points = sys_get_param_float('points')) { |
|
31 | +if ($points = sys_get_param_float('points')) { |
|
32 | 32 | try { |
33 | 33 | $username = sys_get_param_str_unsafe('id_user'); |
34 | - if(empty($username)) { |
|
34 | + if (empty($username)) { |
|
35 | 35 | throw new Exception($lang['adm_mm_no_dest']); |
36 | 36 | } |
37 | 37 | |
38 | 38 | $an_account = new Account(classSupernova::$auth->account->db); |
39 | - if(!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) { |
|
39 | + if (!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) { |
|
40 | 40 | throw new Exception(sprintf($lang['adm_mm_user_none'], $username)); |
41 | 41 | } |
42 | 42 | |
43 | - if(!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf( |
|
43 | + if (!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf( |
|
44 | 44 | $lang['adm_matter_change_log_record'], |
45 | 45 | $an_account->account_id, db_escape($an_account->account_name), |
46 | 46 | $user['id'], db_escape($user['username']), |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // $message = $lang['adm_mm_no_quant']; |
60 | 60 | } |
61 | 61 | |
62 | -if($message_status == ERR_ERROR) { |
|
62 | +if ($message_status == ERR_ERROR) { |
|
63 | 63 | $template->assign_vars(array( |
64 | 64 | 'ID_USER' => $username, |
65 | 65 | 'POINTS' => $points, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | )); |
68 | 68 | }; |
69 | 69 | |
70 | -if($message) { |
|
70 | +if ($message) { |
|
71 | 71 | $template->assign_block_vars('result', array('MESSAGE' => $message, 'STATUS' => $message_status ? $message_status : ERR_NONE)); |
72 | 72 | } |
73 | 73 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
16 | 16 | |
17 | 17 | global $config, $lang, $user; |
18 | -if($user['authlevel'] < 3) { |
|
18 | +if ($user['authlevel'] < 3) { |
|
19 | 19 | AdminMessage($lang['adm_err_denied']); |
20 | 20 | } |
21 | 21 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $sort = sys_get_param_int('sort', SORT_ID); |
40 | 40 | $sort = $sort_fields[$sort] ? $sort : SORT_ID; |
41 | 41 | |
42 | -if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) { |
|
42 | +if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) { |
|
43 | 43 | $user_selected = db_user_by_id($user_id, false, 'id, username, authlevel'); |
44 | - if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
45 | - switch($action) { |
|
44 | + if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
45 | + switch ($action) { |
|
46 | 46 | case ACTION_DELETE: |
47 | 47 | DeleteSelectedUser($user_id); |
48 | 48 | sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}"); |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | |
64 | 64 | $multi_ip = array(); |
65 | 65 | $ip_query = db_user_list_admin_multiaccounts(); |
66 | -while($ip = db_fetch($ip_query)) { |
|
66 | +while ($ip = db_fetch($ip_query)) { |
|
67 | 67 | $multi_ip[$ip['user_lastip']] = $ip['ip_count']; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $geoip = geoip_status(); |
71 | 71 | |
72 | 72 | $query = db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page); |
73 | -while($user_row = db_fetch($query)) { |
|
74 | - if($user_row['banaday']) { |
|
73 | +while ($user_row = db_fetch($query)) { |
|
74 | + if ($user_row['banaday']) { |
|
75 | 75 | $ban_details = doquery("SELECT * FROM {{banned}} WHERE `ban_user_id` = {$user_row['id']} ORDER BY ban_id DESC LIMIT 1", true); |
76 | 76 | } |
77 | 77 | |
78 | 78 | $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array(); |
79 | - foreach($geoip_info as $key => $value) { |
|
79 | + foreach ($geoip_info as $key => $value) { |
|
80 | 80 | $geoip_info[strtoupper($key)] = $value; |
81 | 81 | unset($geoip_info[$key]); |
82 | 82 | } |