@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
7 | 7 | $uni_system = sys_get_param_int('system'); |
8 | 8 | |
9 | - if($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
9 | + if ($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
10 | 10 | { |
11 | 11 | throw new exception($lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
12 | 12 | } |
13 | 13 | |
14 | - if($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
14 | + if ($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
15 | 15 | { |
16 | 16 | throw new exception($lang['uni_msg_error_wrong_system'], ERR_ERROR); |
17 | 17 | } |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | $uni_row['universe_price'] += $uni_system ? $config->uni_price_system : $config->uni_price_galaxy; |
21 | 21 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$lang['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$lang['sys_galaxy']} {$uni_galaxy}")); |
22 | 22 | |
23 | - if(sys_get_param_str('uni_name_submit')) |
|
23 | + if (sys_get_param_str('uni_name_submit')) |
|
24 | 24 | { |
25 | 25 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
26 | 26 | |
27 | 27 | $uni_price = sys_get_param_float('uni_price'); |
28 | - if($uni_price < $uni_row['universe_price']) |
|
28 | + if ($uni_price < $uni_row['universe_price']) |
|
29 | 29 | { |
30 | 30 | throw new exception($lang['uni_msg_error_low_price'], ERR_ERROR); |
31 | 31 | } |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | SN::db_transaction_start(); |
35 | 35 | $user = db_user_by_id($user['id'], true); |
36 | 36 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
37 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
37 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
38 | 38 | { |
39 | 39 | throw new exception($lang['uni_msg_error_no_dm'], ERR_ERROR); |
40 | 40 | } |
41 | 41 | |
42 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
42 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
43 | 43 | { |
44 | 44 | throw new exception($lang['sys_msg_err_update_dm'], ERR_ERROR); |
45 | 45 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
3 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -15,50 +15,50 @@ discard block |
||
15 | 15 | )); |
16 | 16 | |
17 | 17 | $info_action = sys_get_param_int('action'); |
18 | -if($info_action) |
|
18 | +if ($info_action) |
|
19 | 19 | { |
20 | 20 | try |
21 | 21 | { |
22 | 22 | SN::db_transaction_start(); |
23 | 23 | |
24 | 24 | $user = db_user_by_id($user['id'], true); |
25 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $config->rpg_cost_info) |
|
25 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $config->rpg_cost_info) |
|
26 | 26 | { |
27 | 27 | throw new Exception(MARKET_NO_DM, ERR_ERROR); |
28 | 28 | } |
29 | 29 | |
30 | - switch($info_action) |
|
30 | + switch ($info_action) |
|
31 | 31 | { |
32 | 32 | case MARKET_INFO_PLAYER: |
33 | 33 | $user_info_name_unsafe = sys_get_param_str_unsafe('user_info_name'); |
34 | - if(!$user_info_name_unsafe) |
|
34 | + if (!$user_info_name_unsafe) |
|
35 | 35 | { |
36 | 36 | throw new Exception(MARKET_INFO_PLAYER_WRONG, ERR_ERROR); |
37 | 37 | } |
38 | 38 | |
39 | - if(is_id($user_info_name_unsafe)) |
|
39 | + if (is_id($user_info_name_unsafe)) |
|
40 | 40 | { |
41 | 41 | $user_info = db_user_by_id($user_info_name_unsafe, true, '`id`, `username`', true); |
42 | 42 | } |
43 | - if(!is_array($user_info)) |
|
43 | + if (!is_array($user_info)) |
|
44 | 44 | { |
45 | 45 | $user_info = db_user_by_username($user_info_name_unsafe, true); |
46 | 46 | } |
47 | - if(!is_array($user_info)) |
|
47 | + if (!is_array($user_info)) |
|
48 | 48 | { |
49 | 49 | throw new Exception(MARKET_INFO_PLAYER_NOT_FOUND, ERR_ERROR); |
50 | 50 | } |
51 | - if($user_info['id'] == $user['id']) |
|
51 | + if ($user_info['id'] == $user['id']) |
|
52 | 52 | { |
53 | 53 | throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $msg_text = array(); |
57 | - foreach(sn_get_groups('mercenaries') as $mercenary_id) |
|
57 | + foreach (sn_get_groups('mercenaries') as $mercenary_id) |
|
58 | 58 | { |
59 | 59 | $msg_text[] = "{$lang['tech'][$mercenary_id]} - " . (($mercenary_level = mrc_get_level($user_info, false, $mercenary_id)) ? "{$lang['sys_level']} {$mercenary_level}" : $lang['eco_mrk_info_not_hired']); |
60 | 60 | } |
61 | - if($mercenary_level = mrc_get_level($user_info, false, UNIT_PREMIUM)) |
|
61 | + if ($mercenary_level = mrc_get_level($user_info, false, UNIT_PREMIUM)) |
|
62 | 62 | { |
63 | 63 | $msg_text[] = "{$lang['tech'][UNIT_PREMIUM]} - {$mercenary_level} {$lang['sys_level']}"; |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | break; |
73 | 73 | } |
74 | 74 | |
75 | - if(!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -$config->rpg_cost_info, "Using Black Market page {$lang['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
75 | + if (!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -$config->rpg_cost_info, "Using Black Market page {$lang['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
76 | 76 | { |
77 | 77 | // TODO: throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
78 | 78 | } |
@@ -109,33 +109,33 @@ discard block |
||
109 | 109 | `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $combat_data[UBE_TIME]) . "', |
110 | 110 | `ube_report_time_spent` = {$combat_data[UBE_TIME_SPENT]}, |
111 | 111 | |
112 | - `ube_report_combat_admin` = " . (int)$combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
112 | + `ube_report_combat_admin` = " . (int) $combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
113 | 113 | `ube_report_mission_type` = {$combat_data[UBE_OPTIONS][UBE_MISSION_TYPE]}, |
114 | 114 | |
115 | 115 | `ube_report_combat_result` = {$outcome[UBE_COMBAT_RESULT]}, |
116 | - `ube_report_combat_sfr` = " . (int)$outcome[UBE_SFR] . ", |
|
116 | + `ube_report_combat_sfr` = " . (int) $outcome[UBE_SFR] . ", |
|
117 | 117 | |
118 | - `ube_report_debris_metal` = " . (float)$outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | - `ube_report_debris_crystal` = " . (float)$outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
118 | + `ube_report_debris_metal` = " . (float) $outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | + `ube_report_debris_crystal` = " . (float) $outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
120 | 120 | `ube_report_debris_total_in_metal` = " . $ube_report_debris_total_in_metal . ", |
121 | 121 | |
122 | - `ube_report_planet_id` = " . (int)$outcome[UBE_PLANET][PLANET_ID] . ", |
|
122 | + `ube_report_planet_id` = " . (int) $outcome[UBE_PLANET][PLANET_ID] . ", |
|
123 | 123 | `ube_report_planet_name` = '" . SN::$db->db_escape($outcome[UBE_PLANET][PLANET_NAME]) . "', |
124 | - `ube_report_planet_size` = " . (int)$outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | - `ube_report_planet_galaxy` = " . (int)$outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | - `ube_report_planet_system` = " . (int)$outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | - `ube_report_planet_planet` = " . (int)$outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | - `ube_report_planet_planet_type` = " . (int)$outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
124 | + `ube_report_planet_size` = " . (int) $outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | + `ube_report_planet_galaxy` = " . (int) $outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | + `ube_report_planet_system` = " . (int) $outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | + `ube_report_planet_planet` = " . (int) $outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | + `ube_report_planet_planet_type` = " . (int) $outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
129 | 129 | |
130 | - `ube_report_moon` = " . (int)$outcome[UBE_MOON] . ", |
|
131 | - `ube_report_moon_chance` = " . (int)$outcome[UBE_MOON_CHANCE] . ", |
|
132 | - `ube_report_moon_size` = " . (float)$outcome[UBE_MOON_SIZE] . ", |
|
130 | + `ube_report_moon` = " . (int) $outcome[UBE_MOON] . ", |
|
131 | + `ube_report_moon_chance` = " . (int) $outcome[UBE_MOON_CHANCE] . ", |
|
132 | + `ube_report_moon_size` = " . (float) $outcome[UBE_MOON_SIZE] . ", |
|
133 | 133 | |
134 | - `ube_report_moon_reapers` = " . (int)$outcome[UBE_MOON_REAPERS] . ", |
|
135 | - `ube_report_moon_destroy_chance` = " . (int)$outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | - `ube_report_moon_reapers_die_chance` = " . (int)$outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
134 | + `ube_report_moon_reapers` = " . (int) $outcome[UBE_MOON_REAPERS] . ", |
|
135 | + `ube_report_moon_destroy_chance` = " . (int) $outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | + `ube_report_moon_reapers_die_chance` = " . (int) $outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
137 | 137 | |
138 | - `ube_report_capture_result` = " . (int)$outcome[UBE_CAPTURE_RESULT] . " |
|
138 | + `ube_report_capture_result` = " . (int) $outcome[UBE_CAPTURE_RESULT] . " |
|
139 | 139 | "); |
140 | 140 | $ube_report_id = $combat_data[UBE_REPORT_ID] = SN::$db->db_insert_id(); |
141 | 141 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | $player_id, |
147 | 147 | |
148 | 148 | "'" . SN::$db->db_escape($player_info[UBE_NAME]) . "'", |
149 | - (int)$player_info[UBE_ATTACKER], |
|
149 | + (int) $player_info[UBE_ATTACKER], |
|
150 | 150 | |
151 | - (float)$player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | - (float)$player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | - (float)$player_info[UBE_BONUSES][UBE_ARMOR], |
|
151 | + (float) $player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | + (float) $player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | + (float) $player_info[UBE_BONUSES][UBE_ARMOR], |
|
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
@@ -163,20 +163,20 @@ discard block |
||
163 | 163 | $fleet_info[UBE_OWNER], |
164 | 164 | $fleet_id, |
165 | 165 | |
166 | - (float)$fleet_info[UBE_PLANET][PLANET_ID], |
|
166 | + (float) $fleet_info[UBE_PLANET][PLANET_ID], |
|
167 | 167 | "'" . SN::$db->db_escape($fleet_info[UBE_PLANET][PLANET_NAME]) . "'", |
168 | - (int)$fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | - (int)$fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | - (int)$fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | - (int)$fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | - |
|
173 | - (float)$fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | - (float)$fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | - (float)$fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | - |
|
177 | - (float)$fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | - (float)$fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | - (float)$fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
168 | + (int) $fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | + (int) $fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | + (int) $fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | + (int) $fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | + |
|
173 | + (float) $fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | + (float) $fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | + (float) $fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | + |
|
177 | + (float) $fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | + (float) $fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | + (float) $fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
180 | 180 | ); |
181 | 181 | |
182 | 182 | // Сохраняем итоговую информацию по ресурсам флота - потеряно, выброшено, увезено |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | $ube_report_id, |
186 | 186 | $fleet_id, |
187 | 187 | |
188 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
188 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
191 | 191 | |
192 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
192 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
195 | 195 | |
196 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
196 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
199 | 199 | |
200 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
200 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
201 | 201 | ); |
202 | 202 | |
203 | 203 | // Сохраняем результаты по юнитам - потеряно и восстановлено |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $fleet_id, |
210 | 210 | |
211 | 211 | $unit_id, |
212 | - (float)$fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | - (float)$fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
212 | + (float) $fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | + (float) $fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
214 | 214 | |
215 | 215 | $unit_sort_order, |
216 | 216 | ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $unit_id, |
235 | 235 | $unit_count, |
236 | - (int)$fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
236 | + (int) $fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
237 | 237 | |
238 | 238 | $fleet_data[UBE_ATTACK][$unit_id], |
239 | 239 | $fleet_data[UBE_SHIELD][$unit_id], |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $query = db_user_list_to_celebrate($config->user_birthday_range); |
10 | 10 | |
11 | - while($row = db_fetch($query)) |
|
11 | + while ($row = db_fetch($query)) |
|
12 | 12 | { |
13 | 13 | $row['username'] = SN::$db->db_escape($row['username']); |
14 | 14 | rpg_points_change($row['id'], RPG_BIRTHDAY, $config->user_birthday_gift, "Birthday gift for user {$row['username']} ID {$row['id']} on his birthday on {$row['user_birthday']}. Gift last gaved at {$row['user_birthday_celebrated']}"); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - $updater->upd_alter_table('users', ["DROP COLUMN `dpath`",], $updater->isFieldExists('users', 'dpath')); |
|
240 | + $updater->upd_alter_table('users', ["DROP COLUMN `dpath`", ], $updater->isFieldExists('users', 'dpath')); |
|
241 | 241 | |
242 | 242 | // 2017-06-12 13:47:36 42c1 |
243 | 243 | $updater->new_version = 42; |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | |
251 | 251 | // 2017-10-11 09:51:49 43a4.3 |
252 | 252 | $updater->upd_alter_table('messages', |
253 | - ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`",], |
|
253 | + ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`", ], |
|
254 | 254 | !$updater->isFieldExists('messages', 'message_json') |
255 | 255 | ); |
256 | 256 | |
257 | 257 | |
258 | 258 | // 2017-10-17 09:49:24 43a6.0 |
259 | 259 | // Removing old index i_user_id |
260 | - $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`',], $updater->isIndexExists('counter', 'i_user_id')); |
|
260 | + $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`', ], $updater->isIndexExists('counter', 'i_user_id')); |
|
261 | 261 | // Adding new index I_counter_user_id |
262 | 262 | $updater->upd_alter_table('counter', |
263 | 263 | [ |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | ); |
312 | 312 | } |
313 | 313 | |
314 | - $updater->updPatchApply(1, function () use ($updater) { |
|
314 | + $updater->updPatchApply(1, function() use ($updater) { |
|
315 | 315 | $q = $updater->upd_do_query("SELECT `messageid`, `user` FROM `{{chat}}`", true); |
316 | 316 | while ($row = db_fetch($q)) { |
317 | 317 | if (strpos($row['user'], 'a:') !== 0) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | }); |
334 | 334 | |
335 | 335 | // 2018-03-07 09:23:41 43a13.23 + 2018-03-07 12:00:47 43a13.24 |
336 | - $updater->updPatchApply(2, function () use ($updater) { |
|
336 | + $updater->updPatchApply(2, function() use ($updater) { |
|
337 | 337 | $updater->upd_alter_table('festival_gifts', [ |
338 | 338 | "ADD COLUMN `disclosure` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `amount`", |
339 | 339 | "ADD COLUMN `message` VARCHAR(4096) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER `disclosure`", |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | }); |
342 | 342 | |
343 | 343 | // 2018-03-12 13:23:10 43a13.33 |
344 | - $updater->updPatchApply(3, function () use ($updater) { |
|
344 | + $updater->updPatchApply(3, function() use ($updater) { |
|
345 | 345 | $updater->upd_alter_table('player_options', |
346 | 346 | [ |
347 | 347 | "MODIFY COLUMN `value` VARCHAR(16000) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''", |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | }); |
352 | 352 | |
353 | 353 | // 2018-03-24 21:31:51 43a16.16 - OiS |
354 | - $updater->updPatchApply(4, function () use ($updater) { |
|
354 | + $updater->updPatchApply(4, function() use ($updater) { |
|
355 | 355 | if (!$updater->isTableExists('festival_ois_player')) { |
356 | 356 | $updater->upd_create_table( |
357 | 357 | 'festival_ois_player', |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | }); |
371 | 371 | |
372 | 372 | // 2018-03-25 08:11:39 43a16.21 |
373 | - $updater->updPatchApply(5, function () use ($updater) { |
|
373 | + $updater->updPatchApply(5, function() use ($updater) { |
|
374 | 374 | $updater->upd_alter_table( |
375 | 375 | 'que', |
376 | 376 | "ADD COLUMN `que_unit_one_time_raw` DECIMAL(20,5) NOT NULL DEFAULT 0", |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $updater->upd_log_version_update(); |
388 | 388 | |
389 | 389 | // 2018-12-21 14:00:41 44a5 Module "ad_promo_code" support |
390 | - $updater->updPatchApply(6, function () use ($updater) { |
|
390 | + $updater->updPatchApply(6, function() use ($updater) { |
|
391 | 391 | if (!$updater->isTableExists('ad_promo_codes')) { |
392 | 392 | $updater->upd_create_table( |
393 | 393 | 'ad_promo_codes', |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | }); |
429 | 429 | |
430 | 430 | // 2018-12-22 11:42:20 44a12 |
431 | - $updater->updPatchApply(7, function () use ($updater) { |
|
431 | + $updater->updPatchApply(7, function() use ($updater) { |
|
432 | 432 | // Creating table for HTTP query strings |
433 | 433 | $updater->upd_create_table( |
434 | 434 | 'security_query_strings', |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | $updater->upd_log_version_update(); |
571 | 571 | |
572 | 572 | // 2019-08-15 00:10:48 45a8 |
573 | - $updater->updPatchApply(8, function () use ($updater) { |
|
573 | + $updater->updPatchApply(8, function() use ($updater) { |
|
574 | 574 | if (!$updater->isTableExists('player_ignore')) { |
575 | 575 | $updater->upd_create_table( |
576 | 576 | 'player_ignore', |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | }, PATCH_REGISTER); |
592 | 592 | |
593 | 593 | // 2019-08-21 20:14:18 45a19 |
594 | - $updater->updPatchApply(9, function () use ($updater) { |
|
594 | + $updater->updPatchApply(9, function() use ($updater) { |
|
595 | 595 | $updater->upd_alter_table('payment', [ |
596 | 596 | 'ADD COLUMN `payment_method_id` smallint DEFAULT NULL AFTER `payment_module_name`', |
597 | 597 | 'ADD KEY `I_payment_method_id` (`payment_method_id`)', |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | }, PATCH_REGISTER); |
600 | 600 | |
601 | 601 | // 2020-02-18 21:00:19 45a71 |
602 | - $updater->updPatchApply(10, function () use ($updater) { |
|
602 | + $updater->updPatchApply(10, function() use ($updater) { |
|
603 | 603 | $name = classConfig::FLEET_UPDATE_MAX_RUN_TIME; |
604 | 604 | if (!SN::$gc->config->pass()->$name) { |
605 | 605 | SN::$gc->config->pass()->$name = 30; |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | $updater->upd_log_version_update(); |
616 | 616 | |
617 | 617 | // 2021-03-03 13:41:05 46a13 |
618 | - $updater->updPatchApply(11, function () use ($updater) { |
|
618 | + $updater->updPatchApply(11, function() use ($updater) { |
|
619 | 619 | $updater->upd_alter_table('festival_gifts', [ |
620 | 620 | 'ADD COLUMN `gift_unit_id` bigint(20) NOT NULL DEFAULT 0 AFTER `amount`', |
621 | 621 | ], !$updater->isFieldExists('festival_gifts', 'gift_unit_id')); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | // Pretty Safe |
3 | 3 | // TODO: Add ally_tag to usertable |
4 | 4 | |
5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
6 | 6 | { |
7 | 7 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
8 | 8 | } |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | $ally_name_raw = sys_get_param_str_unsafe('name'); |
13 | 13 | $ally_name = SN::$db->db_escape($ally_name_raw); |
14 | 14 | |
15 | -if($ally_tag) |
|
15 | +if ($ally_tag) |
|
16 | 16 | { |
17 | - if(!$ally_name_raw || !$ally_tag_raw) |
|
17 | + if (!$ally_name_raw || !$ally_tag_raw) |
|
18 | 18 | { |
19 | 19 | SnTemplate::messageBox($lang['have_not_name'], $lang['make_alliance']); |
20 | 20 | } |
21 | 21 | |
22 | 22 | $query = doquery("SELECT ally_tag FROM {{alliance}} WHERE `ally_tag` = '{$ally_tag}' or `ally_name` = '{$ally_name}' LIMIT 1;", true); |
23 | - if($query) |
|
23 | + if ($query) |
|
24 | 24 | { |
25 | 25 | SnTemplate::messageBox(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']); |
26 | 26 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Alliance\DBStaticAlly; |
4 | 4 | use \DBAL\DbQuery; |
5 | 5 | |
6 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
6 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
7 | 7 | { |
8 | 8 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
9 | 9 | } |
@@ -18,28 +18,28 @@ discard block |
||
18 | 18 | $ally_name_safe = SN::$db->db_escape($user['ally_name']); |
19 | 19 | |
20 | 20 | $autoAccept = false; |
21 | -if(sys_get_param_str('ali_dip_offer_make')) |
|
21 | +if (sys_get_param_str('ali_dip_offer_make')) |
|
22 | 22 | { |
23 | 23 | $alliance_negotiation_relation = sys_get_param_str('alliance_negotiation_relation'); |
24 | - if(!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) |
|
24 | + if (!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) |
|
25 | 25 | { |
26 | 26 | SnTemplate::messageBox($lang['ali_dip_err_wrong_offer'], $page_title); |
27 | 27 | } |
28 | 28 | |
29 | 29 | $alliance_negotiation_contr_ally_id = sys_get_param_id('alliance_negotiation_contr_ally_id'); |
30 | - if($alliance_negotiation_contr_ally_id == $user['ally_id']) |
|
30 | + if ($alliance_negotiation_contr_ally_id == $user['ally_id']) |
|
31 | 31 | { |
32 | 32 | SnTemplate::messageBox($lang['ali_dip_err_same_ally'], $page_title); |
33 | 33 | } |
34 | 34 | |
35 | 35 | $contr_ally_row = doquery("SELECT `ally_name` FROM {{alliance}} WHERE `id` = {$alliance_negotiation_contr_ally_id} LIMIT 1;", '', true); |
36 | - if(!$contr_ally_row) |
|
36 | + if (!$contr_ally_row) |
|
37 | 37 | { |
38 | 38 | SnTemplate::messageBox($lang['ali_dip_err_no_ally'], $page_title); |
39 | 39 | } |
40 | 40 | |
41 | 41 | $relation_current_id = ali_relation($user['ally_id'], $alliance_negotiation_contr_ally_id); |
42 | - if($alliance_negotiation_relation == $relation_current_id) |
|
42 | + if ($alliance_negotiation_relation == $relation_current_id) |
|
43 | 43 | { |
44 | 44 | SnTemplate::messageBox(sprintf($lang['ali_dip_err_offer_same'], $lang['ali_dip_relations'][$alliance_negotiation_relation]), $page_title); |
45 | 45 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $relation_new = $sn_diplomacy_relation_list[$alliance_negotiation_relation]; |
53 | 53 | $relation_current = $sn_diplomacy_relation_list[$relation_current_id]; |
54 | - if($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) |
|
54 | + if ($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) |
|
55 | 55 | { |
56 | 56 | DbQuery::build() |
57 | 57 | ->setTable('alliance_negotiation') |
@@ -85,39 +85,39 @@ discard block |
||
85 | 85 | else |
86 | 86 | { |
87 | 87 | $offer_id = sys_get_param_id('offer_id'); |
88 | - if($offer_id) |
|
88 | + if ($offer_id) |
|
89 | 89 | { |
90 | 90 | $offer_answer = sys_get_param_str('answer'); |
91 | 91 | |
92 | 92 | $negotiation = doquery("SELECT * FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;", '', true); |
93 | - if(!$negotiation) |
|
93 | + if (!$negotiation) |
|
94 | 94 | { |
95 | 95 | SnTemplate::messageBox($lang['ali_dip_err_offer_none'], $page_title); |
96 | 96 | } |
97 | - elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) |
|
97 | + elseif ($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) |
|
98 | 98 | { |
99 | 99 | // TODO: Add log of hack attempt |
100 | 100 | SnTemplate::messageBox($lang['ali_dip_err_offer_alien'], $page_title); |
101 | 101 | } |
102 | - elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) |
|
102 | + elseif ($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) |
|
103 | 103 | { |
104 | - if($offer_answer == 'accept') |
|
104 | + if ($offer_answer == 'accept') |
|
105 | 105 | { |
106 | 106 | // TODO: Add log of hack attempt |
107 | 107 | SnTemplate::messageBox($lang['ali_dip_err_offer_accept_own'], $page_title); |
108 | 108 | } |
109 | - elseif($offer_answer == 'deny') |
|
109 | + elseif ($offer_answer == 'deny') |
|
110 | 110 | { |
111 | 111 | doquery("DELETE FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;"); |
112 | 112 | } |
113 | 113 | } |
114 | 114 | else |
115 | 115 | { |
116 | - if($offer_answer == 'accept') |
|
116 | + if ($offer_answer == 'accept') |
|
117 | 117 | { |
118 | 118 | $accept_offer = true; |
119 | 119 | } |
120 | - elseif($offer_answer == 'deny') |
|
120 | + elseif ($offer_answer == 'deny') |
|
121 | 121 | { |
122 | 122 | DBStaticAlly::db_ally_negotiation_update_status_1($offer_id); |
123 | 123 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | -if($accept_offer) |
|
128 | +if ($accept_offer) |
|
129 | 129 | { |
130 | 130 | SN::db_transaction_start(); |
131 | 131 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | SN::db_transaction_commit(); |
186 | 186 | } |
187 | 187 | |
188 | -foreach($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) |
|
188 | +foreach ($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) |
|
189 | 189 | { |
190 | 190 | $template->assign_block_vars('relation', array( |
191 | 191 | 'ID' => $diplomacy_relation_id, |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | $query = doquery("SELECT id, ally_name, ally_tag FROM {{alliance}} WHERE `id` != {$user['ally_id']} ORDER BY ally_name;"); |
197 | -while($alliance = db_fetch($query)) |
|
197 | +while ($alliance = db_fetch($query)) |
|
198 | 198 | { |
199 | 199 | $template->assign_block_vars('alliance', array( |
200 | 200 | 'ID' => $alliance['id'], |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | WHERE |
214 | 214 | alliance_negotiation_ally_id = {$user['ally_id']} OR alliance_negotiation_contr_ally_id = {$user['ally_id']};" |
215 | 215 | ); |
216 | -while($offer = db_fetch($query)) |
|
216 | +while ($offer = db_fetch($query)) |
|
217 | 217 | { |
218 | 218 | $template->assign_block_vars('offer', array( |
219 | 219 | 'ID' => $offer['alliance_negotiation_id'], |
@@ -3,26 +3,26 @@ discard block |
||
3 | 3 | use Alliance\DBStaticAlly; |
4 | 4 | use Old\Avatar; |
5 | 5 | |
6 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
6 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
7 | 7 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
8 | 8 | } |
9 | 9 | |
10 | -if(!$user_admin) { |
|
10 | +if (!$user_admin) { |
|
11 | 11 | SnTemplate::messageBox($lang['Denied_access'], $lang['ally_admin']); |
12 | 12 | } |
13 | 13 | |
14 | 14 | $template = SnTemplate::gettemplate('ali_admin', $template); |
15 | 15 | |
16 | 16 | $text_list = array( |
17 | - 1 => array ('db_field' => 'ally_description', 'text_type' => 'Public_text_of_alliance'), |
|
18 | - 2 => array ('db_field' => 'ally_text', 'text_type' => 'Internal_text'), |
|
19 | - 3 => array ('db_field' => 'ally_request', 'text_type' => 'Show_of_request_text'), |
|
17 | + 1 => array('db_field' => 'ally_description', 'text_type' => 'Public_text_of_alliance'), |
|
18 | + 2 => array('db_field' => 'ally_text', 'text_type' => 'Internal_text'), |
|
19 | + 3 => array('db_field' => 'ally_request', 'text_type' => 'Show_of_request_text'), |
|
20 | 20 | ); |
21 | 21 | |
22 | 22 | $allyTextID = sys_get_param_int('t', 1); |
23 | -$allyTextID = ($allyTextID<1 || $allyTextID>3) ? 1 : $allyTextID; |
|
23 | +$allyTextID = ($allyTextID < 1 || $allyTextID > 3) ? 1 : $allyTextID; |
|
24 | 24 | |
25 | -if(sys_get_param_str('isSaveOptions')) { |
|
25 | +if (sys_get_param_str('isSaveOptions')) { |
|
26 | 26 | $new_image = $ally['ally_image']; |
27 | 27 | $avatar_upload_result = Avatar::sys_avatar_upload($ally['id'], $new_image, 'ally'); |
28 | 28 | $template->assign_vars([ |
@@ -31,32 +31,32 @@ discard block |
||
31 | 31 | ]); |
32 | 32 | |
33 | 33 | $ally_changeset = array(); |
34 | - if(($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) { |
|
34 | + if (($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) { |
|
35 | 35 | $new_tag_unsafe = $new_tag; |
36 | 36 | $new_tag = SN::$db->db_escape($new_tag); |
37 | 37 | $isTaggedAllyExists = DBStaticAlly::db_ally_get_by_tag($new_tag); |
38 | - if(!empty($isTaggedAllyExists)) { |
|
38 | + if (!empty($isTaggedAllyExists)) { |
|
39 | 39 | SnTemplate::messageBox(sprintf($lang['ally_message_tag_exists'], $new_tag_unsafe), '', 'alliance.php?mode=admin&edit=ally'); |
40 | 40 | } |
41 | 41 | $ally_changeset[] = "`ally_tag`='{$new_tag}'"; |
42 | 42 | db_user_set_by_id($ally['ally_user_id'], "`username`='[{$new_tag}]'"); |
43 | 43 | } |
44 | 44 | |
45 | - if(($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) { |
|
45 | + if (($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) { |
|
46 | 46 | $new_name_unsafe = $new_name; |
47 | 47 | $new_name = SN::$db->db_escape($new_name); |
48 | 48 | $isTaggedAllyExists = DBStaticAlly::db_ally_get_by_name($new_name); |
49 | - if(!empty($isTaggedAllyExists)) { |
|
49 | + if (!empty($isTaggedAllyExists)) { |
|
50 | 50 | SnTemplate::messageBox(sprintf($lang['ally_message_name_exists'], $new_name_unsafe), '', 'alliance.php?mode=admin&edit=ally'); |
51 | 51 | } |
52 | 52 | $ally_changeset[] = "`ally_name`='{$new_name}'"; |
53 | 53 | } |
54 | 54 | |
55 | - if(($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) { |
|
55 | + if (($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) { |
|
56 | 56 | $new_owner_rank = SN::$db->db_escape($new_owner_rank); |
57 | 57 | $ally_changeset[] = "`ally_owner_range` = '{$new_owner_rank}'"; |
58 | 58 | } |
59 | - if(($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) { |
|
59 | + if (($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) { |
|
60 | 60 | $new_web = SN::$db->db_escape($new_web); |
61 | 61 | $ally_changeset[] = "`ally_web` = '{$new_web}'"; |
62 | 62 | } |
@@ -65,31 +65,31 @@ discard block |
||
65 | 65 | // if(($new_request = sys_get_param_int('request_notallow', $ally['ally_request_notallow'])) && $new_request != $ally['ally_request_notallow']) { |
66 | 66 | // $ally_changeset[] = "`ally_request_notallow` = '{$new_request}'"; |
67 | 67 | // } |
68 | - if($new_image != $ally['ally_image']) { |
|
68 | + if ($new_image != $ally['ally_image']) { |
|
69 | 69 | $new_image = intval($new_image); |
70 | 70 | $ally_changeset[] = "`ally_image` = '{$new_image}'"; |
71 | 71 | } |
72 | 72 | |
73 | - if(!empty($ally_changeset)) { |
|
73 | + if (!empty($ally_changeset)) { |
|
74 | 74 | doquery("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;"); |
75 | 75 | sys_redirect('alliance.php?mode=admin&edit=ally'); |
76 | 76 | } |
77 | 77 | } |
78 | -elseif(sys_get_param_str('isSaveText')) |
|
78 | +elseif (sys_get_param_str('isSaveText')) |
|
79 | 79 | { |
80 | 80 | $text = sys_get_param_str_both('text'); |
81 | 81 | doquery("UPDATE {{alliance}} SET `{$text_list[$allyTextID]['db_field']}`='{$text['safe']}' WHERE `id`='{$ally['id']}';"); |
82 | 82 | $ally[$text_list[$allyTextID]['db_field']] = $text['unsafe']; |
83 | 83 | } |
84 | -elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) |
|
84 | +elseif (sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) |
|
85 | 85 | { |
86 | - if(!$isAllyOwner) |
|
86 | + if (!$isAllyOwner) |
|
87 | 87 | { |
88 | 88 | SnTemplate::messageBox($lang['Denied_access'], $lang['ally_admin']); |
89 | 89 | } |
90 | 90 | |
91 | 91 | $newLeader = db_user_by_id($idNewLeader, false, `ally_id`); |
92 | - if($newLeader['ally_id'] == $user['ally_id']) |
|
92 | + if ($newLeader['ally_id'] == $user['ally_id']) |
|
93 | 93 | { |
94 | 94 | SN::db_transaction_start(); |
95 | 95 | db_user_set_by_id($user['id'], "`ally_rank_id`='0'"); |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | sys_redirect('alliance.php'); |
100 | 100 | } |
101 | 101 | } |
102 | -elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) |
|
102 | +elseif (sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) |
|
103 | 103 | { |
104 | - if(!$isAllyOwner) |
|
104 | + if (!$isAllyOwner) |
|
105 | 105 | { |
106 | 106 | SnTemplate::messageBox($lang['Denied_access'], $lang['ally_admin']); |
107 | 107 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'ally_name' => htmlspecialchars($ally['ally_name']), |
125 | 125 | 'ally_tag' => htmlspecialchars($ally['ally_tag']), |
126 | 126 | 'ally_web' => htmlspecialchars($ally['ally_web']), |
127 | - 'ally_request_notallow_0' => (( $ally['ally_request_notallow']) ? ' SELECTED' : ''), |
|
127 | + 'ally_request_notallow_0' => (($ally['ally_request_notallow']) ? ' SELECTED' : ''), |
|
128 | 128 | 'ally_request_notallow_1' => ((!$ally['ally_request_notallow']) ? ' SELECTED' : ''), |
129 | 129 | 'ally_owner_range' => htmlspecialchars($ally['ally_owner_range']), |
130 | 130 | 'hideNotOwner' => $ally['ally_owner'] != $user['id'] ? 'display: hide;' : '', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $userAllyAdmins = db_user_list("`ally_id`= {$ally['id']}", false, '`id`, `username`'); |
135 | 135 | unset($tmp); |
136 | - foreach($userAllyAdmins as $userAllyAdmin) |
|
136 | + foreach ($userAllyAdmins as $userAllyAdmin) |
|
137 | 137 | { |
138 | 138 | $tmp .= "<option value={$userAllyAdmin['id']}>{$userAllyAdmin['username']}</option>"; |
139 | 139 | } |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | $template->assign_var('adminMembers', $tmp); |
142 | 142 | } |
143 | 143 | |
144 | -foreach($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) |
|
144 | +foreach ($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) |
|
145 | 145 | { |
146 | - if(!$sn_ali_admin_action_locale['title']) |
|
146 | + if (!$sn_ali_admin_action_locale['title']) |
|
147 | 147 | { |
148 | 148 | continue; |
149 | 149 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Alliance\DBStaticAlly; |
4 | 4 | |
5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
6 | 6 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
7 | 7 | } |
8 | 8 | |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | } |
12 | 12 | |
13 | 13 | $d = sys_get_param_id('d'); |
14 | -if($d) { |
|
14 | +if ($d) { |
|
15 | 15 | doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;"); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $id_user = sys_get_param_id('id_user'); |
19 | -if($id_user) { |
|
19 | +if ($id_user) { |
|
20 | 20 | $ally_name_safe = SN::$db->db_escape($ally['ally_name']); |
21 | 21 | $ally_tag_safe = SN::$db->db_escape($ally['ally_tag']); |
22 | 22 | db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0"); |