@@ -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 | SnTemplate::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(!is_numeric($user_id)) { |
|
191 | + foreach ($user_list as $key => $user_id) { |
|
192 | + if (!is_numeric($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->pass()->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>'; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -define('INSIDE' , true); |
|
4 | -define('INSTALL' , false); |
|
3 | +define('INSIDE', true); |
|
4 | +define('INSTALL', false); |
|
5 | 5 | define('IN_ADMIN', true); |
6 | 6 | |
7 | 7 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
12 | 12 | |
13 | 13 | $planet_active = sys_get_param_int('planet_active'); |
14 | -if(!$planet_active) { |
|
14 | +if (!$planet_active) { |
|
15 | 15 | $planet_type = sys_get_param_int('planet_type', 1); |
16 | 16 | $planet_type = $planet_type == 3 ? 3 : 1; |
17 | 17 | } else { |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $page_title = |
42 | 42 | $lang['adm_planet_list_title'] . ': ' . |
43 | - ($planet_active ? $lang['adm_planet_active'] : |
|
44 | - ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
43 | + ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') |
|
45 | 44 | ); |
46 | 45 | $template->assign_vars(array( |
47 | 46 | 'PAGE_TITLE' => $page_title, |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1); |
19 | 19 | } |
20 | 20 | |
21 | -if($user['authlevel'] < 3) |
|
21 | +if ($user['authlevel'] < 3) |
|
22 | 22 | { |
23 | 23 | AdminMessage($lang['adm_err_denied']); |
24 | 24 | } |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | $template = SnTemplate::gettemplate('admin/adm_user_stat', true); |
27 | 27 | |
28 | 28 | $dt_from = sys_get_param_date_sql('dt_from', '2000-01-01'); |
29 | -if(strlen($dt_from) == 4) |
|
29 | +if (strlen($dt_from) == 4) |
|
30 | 30 | { |
31 | 31 | $dt_from .= '-01'; |
32 | 32 | } |
33 | 33 | $dt_to = sys_get_param_date_sql('dt_to', date('Y-m-d', SN_TIME_NOW + PERIOD_DAY)); |
34 | -if(strlen($dt_to) == 4) |
|
34 | +if (strlen($dt_to) == 4) |
|
35 | 35 | { |
36 | 36 | $dt_to .= '-01'; |
37 | 37 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $interval = $min_max_dates['max_register'] - $min_max_dates['min_register']; |
45 | 45 | |
46 | -switch(true) |
|
46 | +switch (true) |
|
47 | 47 | { |
48 | 48 | case $interval >= PERIOD_YEAR * 4: |
49 | 49 | $sql_group_format = "%Y"; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | DATE_FORMAT(account_register_time, '%a') AS DoW, |
83 | 83 | DATE_FORMAT(DATE_ADD(account_register_time, INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next |
84 | 84 | FROM {{account}} WHERE 1 " . $sql_date2 . " GROUP BY {$sql_group_by2}"); |
85 | -while($row = db_fetch($query)) |
|
85 | +while ($row = db_fetch($query)) |
|
86 | 86 | { |
87 | 87 | $stat_date[$row['the_date']] = array( |
88 | 88 | 'DATE' => $row['the_date'], |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $sql_group_by = "DATE_FORMAT(FROM_UNIXTIME(register_time), '{$sql_group_format}')"; |
99 | 99 | $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date, DATE_FORMAT(DATE_ADD(FROM_UNIXTIME(register_time), INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next |
100 | 100 | FROM {{users}} WHERE user_as_ally IS NULL " . $sql_date . " GROUP BY {$sql_group_by}"); |
101 | -while($row = db_fetch($query)) |
|
101 | +while ($row = db_fetch($query)) |
|
102 | 102 | { |
103 | 103 | $stat_date[$row['the_date']]['REGISTERED'] = $row['the_count']; |
104 | 104 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | " AND onlinetime <= register_time + " . PERIOD_DAY . |
110 | 110 | ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_DAY . |
111 | 111 | $sql_date . " GROUP BY {$sql_group_by}"); |
112 | -while($row = db_fetch($query)) |
|
112 | +while ($row = db_fetch($query)) |
|
113 | 113 | { |
114 | 114 | $stat_date[$row['the_date']]['REJECTED'] = $row['the_count']; |
115 | 115 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ' AND onlinetime <= register_time + ' . PERIOD_WEEK . |
120 | 120 | ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_WEEK . |
121 | 121 | $sql_date . " GROUP BY {$sql_group_by}"); |
122 | -while($row = db_fetch($query)) |
|
122 | +while ($row = db_fetch($query)) |
|
123 | 123 | { |
124 | 124 | $stat_date[$row['the_date']]['LEAVED'] = $row['the_count']; |
125 | 125 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_DAY . |
129 | 129 | ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_DAY . |
130 | 130 | $sql_date . " GROUP BY {$sql_group_by}"); |
131 | -while($row = db_fetch($query)) |
|
131 | +while ($row = db_fetch($query)) |
|
132 | 132 | { |
133 | 133 | $stat_date[$row['the_date']]['ACTIVE'] = $row['the_count']; |
134 | 134 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_WEEK . |
139 | 139 | ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_WEEK . |
140 | 140 | $sql_date . " GROUP BY {$sql_group_by}"); |
141 | -while($row = db_fetch($query)) |
|
141 | +while ($row = db_fetch($query)) |
|
142 | 142 | { |
143 | 143 | $stat_date[$row['the_date']]['DORMANT'] = $row['the_count']; |
144 | 144 | } |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | uasort($stat_date, 'admin_date_sort'); |
147 | 147 | |
148 | 148 | $total = array(); |
149 | -foreach($stat_date as $key => &$value) |
|
149 | +foreach ($stat_date as $key => &$value) |
|
150 | 150 | { |
151 | 151 | $value['TOTAL'] = $value['REJECTED'] + $value['LEAVED']; |
152 | 152 | $value['LEAVED_PERCENT'] = $value['REGISTERED'] ? round($value['TOTAL'] / $value['REGISTERED'] * 100) : 0; |
153 | 153 | $value['ACTIVE_PERCENT'] = $value['REGISTERED'] ? round($value['ACTIVE'] / $value['REGISTERED'] * 100) : 0; |
154 | 154 | $value['DORMANT_PERCENT'] = $value['REGISTERED'] ? round($value['DORMANT'] / $value['REGISTERED'] * 100) : 0; |
155 | - foreach($value as $key2 => $value2) |
|
155 | + foreach ($value as $key2 => $value2) |
|
156 | 156 | { |
157 | 157 | $total[$key2] += $value2; |
158 | 158 | } |
@@ -13,8 +13,7 @@ |
||
13 | 13 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 | |
15 | 15 | |
16 | -function admin_date_sort($a, $b) |
|
17 | -{ |
|
16 | +function admin_date_sort($a, $b) { |
|
18 | 17 | return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1); |
19 | 18 | } |
20 | 19 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $scan_galaxy = sys_get_param_int('galaxy'); |
32 | 32 | $scan_system = sys_get_param_int('system'); |
33 | 33 | $scan_planet = sys_get_param_int('planet'); |
34 | -$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
34 | +$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
35 | 35 | $id = sys_get_param_id('id'); |
36 | 36 | |
37 | 37 | $source_galaxy = $planetrow['galaxy']; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $sensorRange = GetPhalanxRange($sensorLevel); |
42 | 42 | |
43 | 43 | $system_distance = abs($source_system - $scan_system); |
44 | -if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
44 | +if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
45 | 45 | { |
46 | 46 | SnTemplate::messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
47 | 47 | } |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type); |
57 | -if(!$planet_scanned['id']) |
|
57 | +if (!$planet_scanned['id']) |
|
58 | 58 | { |
59 | 59 | SnTemplate::messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
60 | 60 | } |
61 | 61 | |
62 | -if($planet_scanned['destruyed']) |
|
62 | +if ($planet_scanned['destruyed']) |
|
63 | 63 | { |
64 | 64 | SnTemplate::messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
65 | 65 | } |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = [ |
@@ -25,7 +25,9 @@ |
||
25 | 25 | * DO NOT CHANGE |
26 | 26 | */ |
27 | 27 | |
28 | -if (!defined('INSIDE')) die(); |
|
28 | +if (!defined('INSIDE')) { |
|
29 | + die(); |
|
30 | +} |
|
29 | 31 | |
30 | 32 | $a_lang_array = [ |
31 | 33 | 'opt_account' => 'Account', |
@@ -25,7 +25,9 @@ |
||
25 | 25 | * DO NOT CHANGE |
26 | 26 | */ |
27 | 27 | |
28 | -if (!defined('INSIDE')) die(); |
|
28 | +if (!defined('INSIDE')) { |
|
29 | + die(); |
|
30 | +} |
|
29 | 31 | |
30 | 32 | $a_lang_array = [ |
31 | 33 | 'msg_page_header' => 'Personal messages', |
@@ -24,7 +24,9 @@ |
||
24 | 24 | * DO NOT CHANGE |
25 | 25 | */ |
26 | 26 | |
27 | -if (!defined('INSIDE')) die(); |
|
27 | +if (!defined('INSIDE')) { |
|
28 | + die(); |
|
29 | +} |
|
28 | 30 | |
29 | 31 | $a_lang_array = [ |
30 | 32 | 'opt_account' => 'Профиль', |
@@ -23,7 +23,9 @@ |
||
23 | 23 | * DO NOT CHANGE |
24 | 24 | */ |
25 | 25 | |
26 | -if (!defined('INSIDE')) die(); |
|
26 | +if (!defined('INSIDE')) { |
|
27 | + die(); |
|
28 | +} |
|
27 | 29 | |
28 | 30 | $a_lang_array = [ |
29 | 31 | 'msg_page_header' => 'Личные сообщения', |