@@ -359,7 +359,7 @@ |
||
359 | 359 | ); |
360 | 360 | } |
361 | 361 | |
362 | - updPatchApply(1, function () { |
|
362 | + updPatchApply(1, function() { |
|
363 | 363 | $q = upd_do_query("SELECT `messageid`, `user` FROM `{{chat}}`", true); |
364 | 364 | while ($row = db_fetch($q)) { |
365 | 365 | if (strpos($row['user'], 'a:') !== 0) { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | |
86 | 86 | $template->assign_block_vars('user', array( |
87 | 87 | 'ID' => $user_row['id'], |
88 | - 'NAME' => $renderedNick = player_nick_render_to_html($user_row, ['player_rank' => true, 'vacancy' => true, 'birthday' => true, 'award' => true, NICK_RANK_NO_TEXT => true,]), |
|
88 | + 'NAME' => $renderedNick = player_nick_render_to_html($user_row, ['player_rank' => true, 'vacancy' => true, 'birthday' => true, 'award' => true, NICK_RANK_NO_TEXT => true, ]), |
|
89 | 89 | 'NAME_HTML' => htmlentities($user_row['username'], ENT_QUOTES, 'UTF-8'), |
90 | 90 | 'IP' => $user_row['user_lastip'], |
91 | 91 | 'IP_MULTI' => intval($multi_ip[$user_row['user_lastip']]), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | || |
126 | 126 | (!empty($uni_galaxyRowPlanet['destruyed']) && CheckAbandonPlanetState($uni_galaxyRowPlanet)) |
127 | 127 | ) { |
128 | - $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet,]); |
|
128 | + $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet, ]); |
|
129 | 129 | continue; |
130 | 130 | } |
131 | 131 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | 'IS_CAPITAL' => $uni_galaxyRowUser['id_planet'] == $uni_galaxyRowPlanet['id'], |
243 | 243 | |
244 | 244 | 'USER_ID' => $uni_galaxyRowUser['id'], |
245 | - 'USER_NAME' => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true,]), |
|
245 | + 'USER_NAME' => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true, ]), |
|
246 | 246 | 'USER_NAME_JS' => js_safe_string($renderedNick), |
247 | 247 | 'USER_RANK' => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'], |
248 | 248 | 'USER_BANNED' => $uni_galaxyRowUser['banaday'], |
@@ -139,7 +139,7 @@ |
||
139 | 139 | $levelPoints = $this->valueStorage->getValue(UNIT_SERVER_FLEET_NOOB_POINTS); |
140 | 140 | !$levelPoints ? $levelPoints = 5000 * $this->valueStorage->getValue(UNIT_SERVER_SPEED_MINING) : false; |
141 | 141 | |
142 | - for($level = 0; $level <= PLAYER_RANK_MAX; $level++) { |
|
142 | + for ($level = 0; $level <= PLAYER_RANK_MAX; $level++) { |
|
143 | 143 | $this->playerLevels[$level] = $levelPoints; |
144 | 144 | $levelPoints *= $multiplier; |
145 | 145 | } |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | $time_server = $time_local - $time_diff |
11 | 11 | */ |
12 | 12 | |
13 | -if($font_size = sys_get_param_str('font_size')) { |
|
14 | - if(strpos($font_size, '%') !== false) { |
|
13 | +if ($font_size = sys_get_param_str('font_size')) { |
|
14 | + if (strpos($font_size, '%') !== false) { |
|
15 | 15 | // Размер шрифта в процентах |
16 | 16 | $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX) . '%'; |
17 | - } elseif(strpos($font_size, 'px') !== false) { |
|
17 | + } elseif (strpos($font_size, 'px') !== false) { |
|
18 | 18 | // Размер шрифта в пикселях |
19 | 19 | $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX) . 'px'; |
20 | 20 | } else { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | SN::$user_options[PLAYER_OPTION_BASE_FONT_SIZE] = $font_size; |
27 | 27 | } else { |
28 | 28 | $user_time_diff = playerTimeDiff::user_time_diff_get(); |
29 | - if($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) { |
|
29 | + if ($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) { |
|
30 | 30 | $time_diff = intval($user_time_diff[PLAYER_OPTION_TIME_DIFF]); |
31 | 31 | } else { |
32 | 32 | $user_time_diff = playerTimeDiff::user_time_diff_probe(); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 | |
15 | -if(SN::$config->game_mode == GAME_BLITZ) { |
|
15 | +if (SN::$config->game_mode == GAME_BLITZ) { |
|
16 | 16 | messageBox($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10); |
17 | 17 | die(); |
18 | 18 | } |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | $template = gettemplate('search', true); |
27 | 27 | |
28 | -if($searchtext && $type) |
|
28 | +if ($searchtext && $type) |
|
29 | 29 | { |
30 | - switch($type) |
|
30 | + switch ($type) |
|
31 | 31 | { |
32 | 32 | case "planetname": |
33 | 33 | // $search = db_planet_list_search($searchtext); |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | break; |
44 | 44 | } |
45 | 45 | |
46 | - while($row = db_fetch($search)) |
|
46 | + while ($row = db_fetch($search)) |
|
47 | 47 | { |
48 | - if($type=='playername' || $type=='planetname') |
|
48 | + if ($type == 'playername' || $type == 'planetname') |
|
49 | 49 | { |
50 | 50 | $template->assign_block_vars('search_result', array( |
51 | 51 | 'PLAYER_ID' => $row['uid'], |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
63 | 63 | )); |
64 | 64 | } |
65 | - elseif($type=='ally') |
|
65 | + elseif ($type == 'ally') |
|
66 | 66 | { |
67 | 67 | $template->assign_block_vars('search_result', array( |
68 | 68 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 'ally' => 'sys_alliance', |
82 | 82 | ); |
83 | 83 | |
84 | -foreach($search_type as $type_id => $type_lang) |
|
84 | +foreach ($search_type as $type_id => $type_lang) |
|
85 | 85 | { |
86 | 86 | $template->assign_block_vars('type', array( |
87 | 87 | 'ID' => $type_id, |
@@ -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 | } |
@@ -188,16 +188,16 @@ discard block |
||
188 | 188 | |
189 | 189 | function sn_maintenance_pack_user_list($user_list) { |
190 | 190 | $user_list = explode(',', $user_list); |
191 | - foreach($user_list as $key => $user_id) { |
|
192 | - if(!ceil(floatval($user_id))) { |
|
191 | + foreach ($user_list as $key => $user_id) { |
|
192 | + if (!ceil(floatval($user_id))) { |
|
193 | 193 | unset($user_list[$key]); |
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | 197 | $result = array(); |
198 | - if(!empty($user_list)) { |
|
198 | + if (!empty($user_list)) { |
|
199 | 199 | $query = doquery("SELECT `id` FROM {{users}} WHERE `id` in (" . implode(',', $user_list) . ")"); |
200 | - while($row = db_fetch($query)) { |
|
200 | + while ($row = db_fetch($query)) { |
|
201 | 201 | $result[] = $row['id']; |
202 | 202 | } |
203 | 203 | } |
@@ -212,11 +212,11 @@ discard block |
||
212 | 212 | $old_server_status == GAME_DISABLE_NONE ? SN::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false; |
213 | 213 | sn_db_transaction_commit(); |
214 | 214 | |
215 | -foreach($ques as $que_transaction) { |
|
215 | +foreach ($ques as $que_transaction) { |
|
216 | 216 | sn_db_transaction_start(); |
217 | 217 | |
218 | 218 | !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; |
219 | - foreach($que_transaction as $que) { |
|
219 | + foreach ($que_transaction as $que) { |
|
220 | 220 | set_time_limit(120); |
221 | 221 | $QryResult = doquery($que); |
222 | 222 | //$msg .= '<hr>' . $que . '<hr>'; |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | |
16 | 16 | $constants = get_defined_constants(true); |
17 | 17 | $rpgConstants = array(); |
18 | -foreach($constants['user'] as $constantName => $constantValue) { |
|
19 | - if(substr($constantName, 0, 4) == 'RPG_') { |
|
18 | +foreach ($constants['user'] as $constantName => $constantValue) { |
|
19 | + if (substr($constantName, 0, 4) == 'RPG_') { |
|
20 | 20 | $rpgConstants[$constantValue] = $constantName; |
21 | 21 | } |
22 | 22 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC; |
34 | 34 | "); |
35 | 35 | |
36 | -while($row = SN::$db->db_fetch($result)) { |
|
36 | +while ($row = SN::$db->db_fetch($result)) { |
|
37 | 37 | $row['CONSTANT'] = $rpgConstants[$row['REASON']]; |
38 | 38 | |
39 | 39 | $row['DM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['DM_AMOUNT']); |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC; |
56 | 56 | "); |
57 | 57 | |
58 | -while($row = SN::$db->db_fetch($result)) { |
|
59 | - if(empty($spent[$row['BALANCE']])) { |
|
58 | +while ($row = SN::$db->db_fetch($result)) { |
|
59 | + if (empty($spent[$row['BALANCE']])) { |
|
60 | 60 | $spent[$row['BALANCE']] = array(); |
61 | 61 | } |
62 | 62 | |
@@ -66,16 +66,15 @@ discard block |
||
66 | 66 | $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row); |
67 | 67 | } |
68 | 68 | |
69 | -foreach($spent as &$row) { |
|
69 | +foreach ($spent as &$row) { |
|
70 | 70 | @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT']; |
71 | 71 | @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT']; |
72 | 72 | @$row['TOTAL_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_AMOUNT']); |
73 | 73 | @$row['TOTAL_COUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_COUNT']); |
74 | 74 | } |
75 | 75 | |
76 | -usort($spent, function ($a, $b) { |
|
77 | - return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : |
|
78 | - ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0); |
|
76 | +usort($spent, function($a, $b) { |
|
77 | + return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0); |
|
79 | 78 | }); |
80 | 79 | |
81 | 80 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | protected static $is_init = false; |
20 | 20 | |
21 | 21 | protected static function init() { |
22 | - if(!empty(static::$db)) { |
|
22 | + if (!empty(static::$db)) { |
|
23 | 23 | return; |
24 | 24 | } |
25 | 25 | static::$db = SN::$db; |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | $provider_id_safe = intval($provider_id_unsafe); |
67 | 67 | !is_array($account_list) ? $account_list = array($account_list) : false; |
68 | 68 | |
69 | - foreach($account_list as $provider_account_id_unsafe) { |
|
69 | + foreach ($account_list as $provider_account_id_unsafe) { |
|
70 | 70 | $provider_account_id_safe = intval($provider_account_id_unsafe); |
71 | 71 | |
72 | 72 | // TODO - Здесь могут отсутствовать аккаунты - проверять провайдером |
73 | 73 | $query = static::$db->doquery("SELECT `user_id` FROM {{account_translate}} WHERE `provider_id` = {$provider_id_safe} AND `provider_account_id` = {$provider_account_id_safe} FOR UPDATE"); |
74 | - while($row = static::$db->db_fetch($query)) { |
|
74 | + while ($row = static::$db->db_fetch($query)) { |
|
75 | 75 | $account_translation[$row['user_id']][$provider_id_unsafe][$provider_account_id_unsafe] = true; |
76 | 76 | } |
77 | 77 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} " . |
98 | 98 | ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : '') . |
99 | 99 | "ORDER BY `timestamp` FOR UPDATE"); |
100 | - while($row = static::$db->db_fetch($query)) { |
|
100 | + while ($row = static::$db->db_fetch($query)) { |
|
101 | 101 | $account_translation[$row['user_id']][$row['provider_id']][$row['provider_account_id']] = $row; |
102 | 102 | } |
103 | 103 |