@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | $img_name = classSupernova::$config->int_userbar_background; |
25 | 25 | break; |
26 | 26 | } |
27 | - $size = getimagesize(SN_ROOT_PHYSICAL . $img_name); |
|
28 | - $im = imagecreatefrompng(SN_ROOT_PHYSICAL . $img_name); |
|
27 | + $size = getimagesize(SN_ROOT_PHYSICAL.$img_name); |
|
28 | + $im = imagecreatefrompng(SN_ROOT_PHYSICAL.$img_name); |
|
29 | 29 | $image = imagecreatetruecolor($size[0], $size[1]); |
30 | 30 | imagecopy($image, $im, 0, 0, 0, 0, $size[0], $size[1]); |
31 | 31 | imagedestroy($im); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $txt_color2 = imagecolorallocatealpha($image, 255, 255, 255, 40); |
38 | 38 | |
39 | 39 | $fonts = array( |
40 | - 'userbar' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_userbar_font, |
|
41 | - 'universe' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontUniverse, |
|
42 | - 'raids' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontRaids, |
|
43 | - 'info' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontInfo, |
|
40 | + 'userbar' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_userbar_font, |
|
41 | + 'universe' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontUniverse, |
|
42 | + 'raids' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontRaids, |
|
43 | + 'info' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontInfo, |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | if ($id) { |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $b_user = $user['username']; |
53 | 53 | $b_ally = $user['ally_name']; |
54 | 54 | $b_planet = $planet_row['name']; |
55 | - $b_xyz = "[" . $planet_row['galaxy'] . ":" . $planet_row['system'] . ":" . $planet_row['planet'] . "]"; |
|
56 | - $b_lvl = ($user['total_rank'] ? $user['total_rank'] : classSupernova::$config->users_amount) . "/" . classSupernova::$config->users_amount; |
|
55 | + $b_xyz = "[".$planet_row['galaxy'].":".$planet_row['system'].":".$planet_row['planet']."]"; |
|
56 | + $b_lvl = ($user['total_rank'] ? $user['total_rank'] : classSupernova::$config->users_amount)."/".classSupernova::$config->users_amount; |
|
57 | 57 | } else { |
58 | 58 | $b_user = classLocale::$lang['ov_banner_empty_id']; |
59 | 59 | $b_lvl = ''; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | imagettftext($image, 9, 0, 410 - $is[2], 35, $txt_color, $fonts['info'], $b_ally); |
89 | 89 | |
90 | 90 | // Player b_planet |
91 | - imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
92 | - imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
91 | + imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
92 | + imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
93 | 93 | |
94 | 94 | //StatPoint |
95 | - $b_points = classLocale::$lang['ov_points'] . ": " . pretty_number(!empty($user['total_points']) ? $user['total_points'] : 0); |
|
95 | + $b_points = classLocale::$lang['ov_points'].": ".pretty_number(!empty($user['total_points']) ? $user['total_points'] : 0); |
|
96 | 96 | $is = imagettfbbox(8, 0, $fonts['info'], $b_points); |
97 | 97 | imagettftext($image, 8, 0, 412 - $is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
98 | 98 | imagettftext($image, 8, 0, 410 - $is[2], 9, $txt_color, $fonts['info'], $b_points); |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | //Raids Total |
101 | 101 | imagettftext($image, 6, 0, 8, 37, $txt_shadow2, $fonts['raids'], classLocale::$lang['NumberOfRaids']); |
102 | 102 | imagettftext($image, 6, 0, 6, 35, $txt_color2, $fonts['raids'], classLocale::$lang['NumberOfRaids']); |
103 | - $b_points = ": " . pretty_number(!empty($user['raids']) ? $user['raids'] : 0); |
|
103 | + $b_points = ": ".pretty_number(!empty($user['raids']) ? $user['raids'] : 0); |
|
104 | 104 | imagettftext($image, 6, 0, 61, 37, $txt_shadow2, $fonts['raids'], $b_points); |
105 | 105 | imagettftext($image, 6, 0, 59, 35, $txt_color2, $fonts['raids'], $b_points); |
106 | 106 | |
107 | 107 | //Raids Won |
108 | 108 | imagettftext($image, 6, 0, 8, 47, $txt_shadow2, $fonts['raids'], classLocale::$lang['RaidsWin']); |
109 | 109 | imagettftext($image, 6, 0, 6, 45, $txt_color2, $fonts['raids'], classLocale::$lang['RaidsWin']); |
110 | - $b_points = ": " . pretty_number(!empty($user['raidswin']) ? $user['raidswin'] : 0); |
|
110 | + $b_points = ": ".pretty_number(!empty($user['raidswin']) ? $user['raidswin'] : 0); |
|
111 | 111 | imagettftext($image, 6, 0, 61, 47, $txt_shadow2, $fonts['raids'], $b_points); |
112 | 112 | imagettftext($image, 6, 0, 59, 45, $txt_color2, $fonts['raids'], $b_points); |
113 | 113 | |
114 | 114 | //Raids Lost |
115 | 115 | imagettftext($image, 6, 0, 8, 57, $txt_shadow2, $fonts['raids'], classLocale::$lang['RaidsLoose']); |
116 | 116 | imagettftext($image, 6, 0, 6, 55, $txt_color2, $fonts['raids'], classLocale::$lang['RaidsLoose']); |
117 | - $b_points = ": " . pretty_number(!empty($user['raidsloose']) ? $user['raidsloose'] : 0); |
|
117 | + $b_points = ": ".pretty_number(!empty($user['raidsloose']) ? $user['raidsloose'] : 0); |
|
118 | 118 | imagettftext($image, 6, 0, 61, 57, $txt_shadow2, $fonts['raids'], $b_points); |
119 | 119 | imagettftext($image, 6, 0, 59, 55, $txt_color2, $fonts['raids'], $b_points); |
120 | 120 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | $build_unit_list = sn_get_groups('tech'); |
70 | 70 | $artifact_id = ART_HEURISTIC_CHIP; |
71 | - $page_header = classLocale::$lang['tech'][UNIT_TECHNOLOGIES] . ($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
71 | + $page_header = classLocale::$lang['tech'][UNIT_TECHNOLOGIES].($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
72 | 72 | } elseif ($que_type == QUE_MERCENARY) { |
73 | 73 | $build_unit_list = sn_get_groups('mercenaries'); |
74 | 74 | $artifact_id = 0; |
75 | - $page_header = classLocale::$lang['tech'][UNIT_MERCENARIES] . ($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
75 | + $page_header = classLocale::$lang['tech'][UNIT_MERCENARIES].($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
76 | 76 | } else { |
77 | 77 | if (mrc_get_level($user, $planet, STRUC_FACTORY_HANGAR) == 0) { |
78 | 78 | message(classLocale::$lang['need_hangar'], classLocale::$lang['tech'][STRUC_FACTORY_HANGAR]); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
246 | 246 | * (isset($density_info[$resource_id]) ? $density_info[$resource_id] : 1))) |
247 | 247 | ) { |
248 | - $level_production_base['R' . $resource_id] = $resource_income; |
|
248 | + $level_production_base['R'.$resource_id] = $resource_income; |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | } |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
273 | 273 | * (isset($density_info[$resource_id]) ? $density_info[$resource_id] : 1))) |
274 | 274 | ) { |
275 | - $level_production['R' . $resource_id] = $resource_income; |
|
276 | - $level_production['D' . $resource_id] = $resource_income - $level_production_base[$resource_id]; |
|
275 | + $level_production['R'.$resource_id] = $resource_income; |
|
276 | + $level_production['D'.$resource_id] = $resource_income - $level_production_base[$resource_id]; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | $production['.']['resource'][] = $level_production; |
@@ -288,15 +288,15 @@ discard block |
||
288 | 288 | $level_start = $level_base_and_que > 1 ? $level_effective + $level_in_que - 1 : 1; |
289 | 289 | for ($i = 0; $i < 6; $i++) { |
290 | 290 | $level_production = array('LEVEL' => $level_start + $i); |
291 | - $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX] = get_player_max_expeditons($user, $level_start + $i); |
|
292 | - $level_production['D' . UNIT_PLAYER_EXPEDITIONS_MAX] = $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX] - $level_production_base[UNIT_PLAYER_EXPEDITIONS_MAX]; |
|
293 | - $level_production['R' . UNIT_PLAYER_COLONIES_MAX] = get_player_max_colonies($user, $level_start + $i); |
|
294 | - $level_production['D' . UNIT_PLAYER_COLONIES_MAX] = $level_production['R' . UNIT_PLAYER_COLONIES_MAX] - $level_production_base[UNIT_PLAYER_COLONIES_MAX]; |
|
291 | + $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX] = get_player_max_expeditons($user, $level_start + $i); |
|
292 | + $level_production['D'.UNIT_PLAYER_EXPEDITIONS_MAX] = $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX] - $level_production_base[UNIT_PLAYER_EXPEDITIONS_MAX]; |
|
293 | + $level_production['R'.UNIT_PLAYER_COLONIES_MAX] = get_player_max_colonies($user, $level_start + $i); |
|
294 | + $level_production['D'.UNIT_PLAYER_COLONIES_MAX] = $level_production['R'.UNIT_PLAYER_COLONIES_MAX] - $level_production_base[UNIT_PLAYER_COLONIES_MAX]; |
|
295 | 295 | $production['.']['resource'][] = $level_production; |
296 | 296 | |
297 | 297 | $level_production_base = array( |
298 | - UNIT_PLAYER_EXPEDITIONS_MAX => $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX], |
|
299 | - UNIT_PLAYER_COLONIES_MAX => $level_production['R' . UNIT_PLAYER_COLONIES_MAX], |
|
298 | + UNIT_PLAYER_EXPEDITIONS_MAX => $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX], |
|
299 | + UNIT_PLAYER_COLONIES_MAX => $level_production['R'.UNIT_PLAYER_COLONIES_MAX], |
|
300 | 300 | ); |
301 | 301 | } |
302 | 302 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -2,9 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | define('IN_ADMIN', true); |
4 | 4 | |
5 | -require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
|
5 | +require('../includes/init.'.substr(strrchr(__FILE__, '.'), 1)); |
|
6 | 6 | |
7 | -if($user['authlevel'] < 3) |
|
7 | +if ($user['authlevel'] < 3) |
|
8 | 8 | { |
9 | 9 | message(classLocale::$lang['sys_noalloaw'], classLocale::$lang['sys_noaccess']); |
10 | 10 | die(); |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | // [#] info_best_battles 1b0 |
21 | 21 | $best_reports = array(); |
22 | 22 | |
23 | -if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
23 | +if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
24 | 24 | $query = db_ube_report_get_best_battles(); |
25 | - while($row = db_fetch($query)) { |
|
25 | + while ($row = db_fetch($query)) { |
|
26 | 26 | $best_reports[] = $row['ube_report_id']; |
27 | 27 | } |
28 | 28 | } |
29 | -$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN (' . implode(',', $best_reports) . ')' : ''; |
|
29 | +$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN ('.implode(',', $best_reports).')' : ''; |
|
30 | 30 | |
31 | 31 | |
32 | 32 | $ques = array( |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | // Удаляем юниты без планет |
91 | 91 | 'DELETE un FROM {{unit}} AS un |
92 | 92 | LEFT JOIN {{planets}} AS pl ON pl.id = un.unit_location_id |
93 | - WHERE unit_location_type = ' . LOC_PLANET . ' AND pl.id IS NULL;', |
|
93 | + WHERE unit_location_type = ' . LOC_PLANET.' AND pl.id IS NULL;', |
|
94 | 94 | // Удаляем пустые юниты с 0 уровнем (кроме Капитана) |
95 | - 'DELETE FROM {{unit}} WHERE unit_location_type = ' . LOC_PLANET . ' AND unit_level = 0 AND unit_type <> ' . UNIT_CAPTAIN, |
|
95 | + 'DELETE FROM {{unit}} WHERE unit_location_type = '.LOC_PLANET.' AND unit_level = 0 AND unit_type <> '.UNIT_CAPTAIN, |
|
96 | 96 | // Удаляем очереди на ничьих планетах |
97 | 97 | 'DELETE q FROM {{que}} AS q |
98 | 98 | LEFT JOIN {{planets}} AS p ON p.id = q.que_planet_id |
99 | 99 | WHERE |
100 | - que_type IN (' . QUE_STRUCTURES . ', ' . QUE_HANGAR . ', ' . SUBQUE_FLEET . ', ' . SUBQUE_DEFENSE . ') |
|
100 | + que_type IN (' . QUE_STRUCTURES.', '.QUE_HANGAR.', '.SUBQUE_FLEET.', '.SUBQUE_DEFENSE.') |
|
101 | 101 | AND |
102 | 102 | (p.id_owner = 0 OR p.id_owner IS NULL);', |
103 | 103 | |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | // Удаляются сообщения, старше 4 недель, кроме личных и Альянсовских |
113 | 113 | 'DELETE FROM {{messages}} WHERE |
114 | 114 | UNIX_TIMESTAMP() - message_time > 4*7 * 24 * 60 * 60 AND |
115 | - message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ');', |
|
115 | + message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.');', |
|
116 | 116 | // Удаляются сообщения у пользователей, которые неактивны больше 4 недель - кроме личных и Альянсовских |
117 | 117 | 'DELETE m FROM `{{users}}` AS u |
118 | 118 | JOIN {{messages}} AS m ON m.message_owner = u.id |
119 | 119 | WHERE |
120 | - message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ') AND |
|
120 | + message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.') AND |
|
121 | 121 | authlevel = 0 AND user_as_ally IS NULL AND /* Не админы, Не Альянсы */ |
122 | 122 | UNIX_TIMESTAMP() - onlinetime > 4*7 *86400;', |
123 | 123 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | (log_dark_matter_timestamp, log_dark_matter_username, log_dark_matter_reason, log_dark_matter_amount, |
138 | 138 | log_dark_matter_comment, log_dark_matter_page, log_dark_matter_sender) |
139 | 139 | SELECT |
140 | - '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), " . RPG_CUMULATIVE . ", sum(ldm.log_dark_matter_amount), |
|
140 | + '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), ".RPG_CUMULATIVE.", sum(ldm.log_dark_matter_amount), |
|
141 | 141 | 'Баланс на {$pack_until}', 'admin/ajax_maintenance.php', ldm.log_dark_matter_sender |
142 | 142 | FROM |
143 | 143 | {{log_dark_matter}} AS ldm |
@@ -155,22 +155,22 @@ discard block |
||
155 | 155 | "REPLACE INTO `{{log_users_online}}` |
156 | 156 | (online_timestamp, online_count, online_aggregated) |
157 | 157 | SELECT |
158 | - FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ")), ceil(avg(online_count)), " . LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10 . " |
|
158 | + FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.")), ceil(avg(online_count)), ".LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10." |
|
159 | 159 | FROM |
160 | 160 | `{{log_users_online}}` |
161 | 161 | WHERE |
162 | - online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE . " |
|
162 | + online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE." |
|
163 | 163 | GROUP BY |
164 | - (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ");", |
|
164 | + (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.");", |
|
165 | 165 | |
166 | - "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE, |
|
166 | + "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE, |
|
167 | 167 | ), |
168 | 168 | |
169 | 169 | // Удаляем старые записи из логов |
170 | 170 | "DELETE FROM `{{logs}}` WHERE log_timestamp < '{$pack_until}';", |
171 | 171 | // Удаляем записи о маинтенансе, апдейте и пересчете статистики более чем недельной давности - они нам уже не нужны |
172 | 172 | 'DELETE FROM `{{logs}}` WHERE |
173 | - `log_code` IN (' . LOG_INFO_DB_CHANGE . ', ' . LOG_INFO_MAINTENANCE . ', ' . LOG_INFO_STAT_START . ', ' . LOG_INFO_STAT_PROCESS . ', ' . LOG_INFO_STAT_FINISH . ') |
|
173 | + `log_code` IN (' . LOG_INFO_DB_CHANGE.', '.LOG_INFO_MAINTENANCE.', '.LOG_INFO_STAT_START.', '.LOG_INFO_STAT_PROCESS.', '.LOG_INFO_STAT_FINISH.') |
|
174 | 174 | AND `log_timestamp` < DATE_SUB(NOW(),INTERVAL 7 DAY);', |
175 | 175 | |
176 | 176 | |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false; |
190 | 190 | sn_db_transaction_commit(); |
191 | 191 | |
192 | -foreach($ques as $que_transaction) { |
|
192 | +foreach ($ques as $que_transaction) { |
|
193 | 193 | sn_db_transaction_start(); |
194 | 194 | |
195 | 195 | !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; |
196 | - foreach($que_transaction as $que) { |
|
196 | + foreach ($que_transaction as $que) { |
|
197 | 197 | set_time_limit(120); |
198 | - if(is_callable($que)) { |
|
198 | + if (is_callable($que)) { |
|
199 | 199 | $QryResult = call_user_func($que); |
200 | 200 | } else { |
201 | 201 | $QryResult = doquery($que); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | //$que = str_replace('}}', '', $que); |
207 | 207 | |
208 | 208 | $msg .= |
209 | - '<li>' . htmlspecialchars($que) . |
|
210 | - ' --- <span style="' . ($QryResult ? 'ok">OK' : 'error">FAILED!') . '</span> ' . |
|
211 | - classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'] . |
|
209 | + '<li>'.htmlspecialchars($que). |
|
210 | + ' --- <span style="'.($QryResult ? 'ok">OK' : 'error">FAILED!').'</span> '. |
|
211 | + classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records']. |
|
212 | 212 | "</li>"; |
213 | 213 | |
214 | - classSupernova::$debug->warning($que . ' --- ' . ($QryResult ? 'OK' : 'FAILED!') . ' ' . classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE); |
|
214 | + classSupernova::$debug->warning($que.' --- '.($QryResult ? 'OK' : 'FAILED!').' '.classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | sn_db_transaction_commit(); |
@@ -239,5 +239,5 @@ discard block |
||
239 | 239 | |
240 | 240 | $adm_stat_title = classLocale::$lang['adm_stat_title']; |
241 | 241 | $result = $result ? "<li>{$adm_stat_title} - {$result}</li>" : ''; |
242 | -$result = '<div align="left"><ul>' . $msg . $result . '</ul></div>'; |
|
243 | -echo json_encode($result . ' ' . $totaltime); |
|
242 | +$result = '<div align="left"><ul>'.$msg.$result.'</ul></div>'; |
|
243 | +echo json_encode($result.' '.$totaltime); |
@@ -3,22 +3,22 @@ discard block |
||
3 | 3 | define('INSIDE', true); |
4 | 4 | define('INSTALL', false); |
5 | 5 | define('IN_ADMIN', true); |
6 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
6 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
7 | 7 | |
8 | -if($user['authlevel'] < 3) { |
|
8 | +if ($user['authlevel'] < 3) { |
|
9 | 9 | AdminMessage(classLocale::$lang['adm_err_denied']); |
10 | 10 | } |
11 | 11 | |
12 | 12 | lng_include('admin'); |
13 | 13 | |
14 | 14 | $user_id = sys_get_param_id('uid'); |
15 | -if(!($user_row = DBStaticUser::db_user_by_id($user_id))) { |
|
15 | +if (!($user_row = DBStaticUser::db_user_by_id($user_id))) { |
|
16 | 16 | AdminMessage(sprintf(classLocale::$lang['adm_dm_user_none'], $user_id)); |
17 | 17 | } |
18 | 18 | |
19 | 19 | $template = gettemplate('admin/admin_user', true); |
20 | 20 | |
21 | -if(!empty($user_row['user_last_browser_id'])) { |
|
21 | +if (!empty($user_row['user_last_browser_id'])) { |
|
22 | 22 | $user_row['browser_user_agent'] = db_browser_agent_get_by_id($user_row['user_last_browser_id']); |
23 | 23 | } |
24 | 24 | |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | 'raidsloose', |
55 | 55 | 'raidswin', |
56 | 56 | 'total_rank', |
57 | - 'total_points', ), |
|
57 | + 'total_points',), |
|
58 | 58 | ); |
59 | -foreach($formats as $callable => $field_list) { |
|
60 | - foreach($field_list as $field_name) { |
|
59 | +foreach ($formats as $callable => $field_list) { |
|
60 | + foreach ($field_list as $field_name) { |
|
61 | 61 | $user_row[$field_name] = call_user_func($callable, $user_row[$field_name]); |
62 | 62 | } |
63 | 63 | } |
@@ -2,31 +2,31 @@ discard block |
||
2 | 2 | |
3 | 3 | $classLocale = classLocale::$lang; |
4 | 4 | |
5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
6 | 6 | classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // Changing rank for single user |
10 | 10 | $id_user = sys_get_param_id('id_user'); |
11 | -if(isset($_GET['id_rank'])) { |
|
11 | +if (isset($_GET['id_rank'])) { |
|
12 | 12 | $id_rank = sys_get_param_int('id_rank'); |
13 | 13 | } |
14 | -if($id_user && isset($id_rank) && $user_admin) { |
|
14 | +if ($id_user && isset($id_rank) && $user_admin) { |
|
15 | 15 | DBStaticUser::db_user_set_by_id($id_user, "`ally_rank_id` = {$id_rank}"); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $id_kick = sys_get_param_id('kick'); |
19 | 19 | |
20 | -if($id_kick && $user_can_kick) { |
|
20 | +if ($id_kick && $user_can_kick) { |
|
21 | 21 | $u = DBStaticUser::db_user_by_id($id_kick, true); |
22 | - if($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) { |
|
22 | + if ($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) { |
|
23 | 23 | DBStaticUser::db_user_set_by_id($id_kick, '`ally_id`= null, `ally_name` = null, `ally_tag` = null, ally_register_time = 0, ally_rank_id = 0'); |
24 | 24 | db_ally_update_member_decrease($ally); |
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | 28 | $sort2 = sys_get_param_int('sort2'); |
29 | -if($sort2) { |
|
29 | +if ($sort2) { |
|
30 | 30 | $sort2s = "DESC"; |
31 | 31 | $sort2 = 0; |
32 | 32 | } else { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $sort1 = sys_get_param_int('sort1'); |
38 | -if($sort1 > 5 || $sort1 < 0) { |
|
38 | +if ($sort1 > 5 || $sort1 < 0) { |
|
39 | 39 | $sort1 = 0; |
40 | 40 | } |
41 | 41 | $sort1s = array( |
@@ -49,28 +49,28 @@ discard block |
||
49 | 49 | |
50 | 50 | $template = gettemplate('ali_members', true); |
51 | 51 | |
52 | -$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY " . sprintf($sort1s[$sort1], $sort2s), false, |
|
52 | +$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY ".sprintf($sort1s[$sort1], $sort2s), false, |
|
53 | 53 | 'id, username, galaxy, system, planet, onlinetime, ally_rank_id, ally_register_time, total_points'); |
54 | 54 | |
55 | 55 | // while ($userRow = db_fetch($userList)) |
56 | -foreach($userList as $userRow) { |
|
56 | +foreach ($userList as $userRow) { |
|
57 | 57 | $i++; |
58 | - if(!isset($ranks[$userRow['ally_rank_id']])) { |
|
58 | + if (!isset($ranks[$userRow['ally_rank_id']])) { |
|
59 | 59 | $userRow['ally_rank_id'] = 0; |
60 | 60 | } |
61 | 61 | |
62 | - if($ally['ally_owner'] == $userRow['id']) { |
|
62 | + if ($ally['ally_owner'] == $userRow['id']) { |
|
63 | 63 | $ally_range = ($ally['ally_owner_range']) ? $ally['ally_owner_range'] : classLocale::$lang['Founder']; |
64 | 64 | } else { |
65 | - if($user_admin) { |
|
66 | - $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user=' . $userRow['id'] . '&id_rank=\' + this.value">'; |
|
65 | + if ($user_admin) { |
|
66 | + $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user='.$userRow['id'].'&id_rank=\' + this.value">'; |
|
67 | 67 | |
68 | - foreach($ranks as $rankID => $rankArray) { |
|
69 | - $ally_range .= '<option value="' . $rankID . '"'; |
|
70 | - if($rankID == $userRow['ally_rank_id']) { |
|
68 | + foreach ($ranks as $rankID => $rankArray) { |
|
69 | + $ally_range .= '<option value="'.$rankID.'"'; |
|
70 | + if ($rankID == $userRow['ally_rank_id']) { |
|
71 | 71 | $ally_range .= " selected"; |
72 | 72 | } |
73 | - $ally_range .= '>' . $rankArray['name']; |
|
73 | + $ally_range .= '>'.$rankArray['name']; |
|
74 | 74 | $ally_range .= '</option>'; |
75 | 75 | } |
76 | 76 | $ally_range .= '</select>'; |
@@ -80,20 +80,20 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $last_active = time() - $userRow["onlinetime"]; |
83 | - if($user_admin) { |
|
84 | - if($last_active < 60) { |
|
83 | + if ($user_admin) { |
|
84 | + if ($last_active < 60) { |
|
85 | 85 | $tmp = "lime>{$classLocale['On']}"; |
86 | - } elseif($last_active < 60 * 60) { |
|
86 | + } elseif ($last_active < 60 * 60) { |
|
87 | 87 | $last_active = round($last_active / 60); |
88 | 88 | $tmp = "lime>{$last_active} {$classLocale['sys_min_short']}"; |
89 | - } elseif($last_active < 60 * 60 * 24) { |
|
89 | + } elseif ($last_active < 60 * 60 * 24) { |
|
90 | 90 | $last_active = round($last_active / (60 * 60)); |
91 | 91 | $tmp = "green>{$last_active} {$classLocale['sys_hrs_short']}"; |
92 | 92 | } else { |
93 | 93 | $last_active = round($last_active / (60 * 60 * 24)); |
94 | - if($last_active < 7) { |
|
94 | + if ($last_active < 7) { |
|
95 | 95 | $tmp = "yellow"; |
96 | - } elseif($last_active < 30) { |
|
96 | + } elseif ($last_active < 30) { |
|
97 | 97 | $tmp = "orange"; |
98 | 98 | } else { |
99 | 99 | $tmp = "red"; |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | $tmp .= ">{$last_active} {$classLocale['sys_day_short']}"; |
102 | 102 | } |
103 | 103 | } else { |
104 | - if($user_onlinestatus) { |
|
105 | - if($last_active < 60 * 5) { |
|
104 | + if ($user_onlinestatus) { |
|
105 | + if ($last_active < 60 * 5) { |
|
106 | 106 | $tmp = "lime>{$classLocale['On']}"; |
107 | - } elseif($last_active < 60 * 15) { |
|
107 | + } elseif ($last_active < 60 * 15) { |
|
108 | 108 | $tmp = "yellow>{$classLocale['ali_lessThen15min']}"; |
109 | 109 | } else { |
110 | 110 | $tmp = "red>{$classLocale['Off']}"; |
@@ -124,21 +124,21 @@ discard block |
||
124 | 124 | 'SYSTEM' => $userRow['system'], |
125 | 125 | 'PLANET' => $userRow['planet'], |
126 | 126 | 'POINTS' => pretty_number($userRow['total_points']), |
127 | - 'ONLINE' => '<font color=' . $tmp . '</font>', |
|
127 | + 'ONLINE' => '<font color='.$tmp.'</font>', |
|
128 | 128 | 'RANK' => $ally_range, |
129 | 129 | 'REGISTER_TIME' => date(FMT_DATE_TIME, $userRow['ally_register_time']), |
130 | 130 | 'SHOW_KICK' => $user['id'] != $userRow['id'] && $ally['ally_owner'] != $userRow['id'], |
131 | 131 | )); |
132 | 132 | } |
133 | 133 | |
134 | -if($i != $ally['ally_members']) { |
|
134 | +if ($i != $ally['ally_members']) { |
|
135 | 135 | db_ally_update_member_set($i, $ally); |
136 | 136 | } |
137 | 137 | |
138 | 138 | $template->assign_vars(array( |
139 | - 'mode' => $mode . ($edit ? "&edit=" . $edit : ''), |
|
139 | + 'mode' => $mode.($edit ? "&edit=".$edit : ''), |
|
140 | 140 | 'ADMIN_MODE' => $user_can_kick, |
141 | - 'dpath' => SN_ROOT_VIRTUAL . $dpath, |
|
141 | + 'dpath' => SN_ROOT_VIRTUAL.$dpath, |
|
142 | 142 | 'onlineMessage' => $user_admin ? classLocale::$lang['ali_sys_lastActive'] : classLocale::$lang['Online'], |
143 | 143 | 'memberCount' => count($userList), |
144 | 144 | 'memberslist' => $page_list, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $unit_level = $artifact_level_old = mrc_get_level($user, null, $unit_id, true); |
14 | 14 | if ($unit_level > 0) { |
15 | 15 | $db_changeset = array(); |
16 | - switch($unit_id) { |
|
16 | + switch ($unit_id) { |
|
17 | 17 | case ART_LHC: |
18 | 18 | case ART_HOOK_SMALL: |
19 | 19 | case ART_HOOK_MEDIUM: |
@@ -133,6 +133,6 @@ discard block |
||
133 | 133 | |
134 | 134 | sn_db_transaction_commit(); |
135 | 135 | message($message, "{$classLocale['tech'][UNIT_ARTIFACTS]} - {$classLocale['tech'][$unit_id]}", |
136 | - ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts' . DOT_PHP_EX . '#' . $unit_id), |
|
136 | + ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts'.DOT_PHP_EX.'#'.$unit_id), |
|
137 | 137 | 5); |
138 | 138 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | $crystal += $destroyed * $unit_info[P_COST][RES_CRYSTAL] / 4; |
78 | 78 | } |
79 | 79 | |
80 | - $return['structures'] = $structures; // Structures left after attack |
|
81 | - $return['metal'] = floor($metal); // Metal scraps |
|
80 | + $return['structures'] = $structures; // Structures left after attack |
|
81 | + $return['metal'] = floor($metal); // Metal scraps |
|
82 | 82 | $return['crystal'] = floor($crystal); // Crystal scraps |
83 | 83 | |
84 | 84 | return $return; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if (!empty($message)) { |
151 | - $message = classLocale::$lang['mip_defense_destroyed'] . $message . "{$classLocale['mip_recycled']}{$classLocale['Metal']}: {$attackResult['metal']}, {$classLocale['Crystal']}: {$attackResult['crystal']}<br>"; |
|
151 | + $message = classLocale::$lang['mip_defense_destroyed'].$message."{$classLocale['mip_recycled']}{$classLocale['Metal']}: {$attackResult['metal']}, {$classLocale['Crystal']}: {$attackResult['crystal']}<br>"; |
|
152 | 152 | |
153 | 153 | DBStaticPlanet::db_planet_set_by_id($target_planet_row['id'], "`metal` = `metal` + {$attackResult['metal']}, `crystal` = `crystal` + {$attackResult['crystal']}"); |
154 | 154 | } |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | empty($message) ? $message = classLocale::$lang['mip_no_defense'] : false; |
167 | 167 | |
168 | - DBStaticMessages::msg_send_simple_message($fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage . $message); |
|
169 | - DBStaticMessages::msg_send_simple_message($fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage . $message); |
|
168 | + DBStaticMessages::msg_send_simple_message($fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage.$message); |
|
169 | + DBStaticMessages::msg_send_simple_message($fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage.$message); |
|
170 | 170 | } |
171 | 171 | DBStaticFleetMissile::db_missile_delete($fleetRow); |
172 | 172 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |