@@ -7,9 +7,9 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | |
19 | 19 | AdminCheckLevel(AUTH_LEVEL_ADMINISTRATOR); |
20 | 20 | |
21 | -$template = gettemplate('admin/adm_payment', true); |
|
21 | +$template = gettemplate('admin/adm_payment', true); |
|
22 | 22 | |
23 | 23 | $payer_list = array( |
24 | 24 | -1 => $lang['adm_pay_filter_all'], |
25 | 25 | ); |
26 | 26 | $query = doquery("SELECT payment_user_id, payment_user_name FROM `{{payment}}` GROUP BY payment_user_id ORDER BY payment_user_name"); |
27 | -while($row = db_fetch($query)) { |
|
27 | +while ($row = db_fetch($query)) { |
|
28 | 28 | $payer_list[$row['payment_user_id']] = '[' . $row['payment_user_id'] . '] ' . $row['payment_user_name']; |
29 | 29 | } |
30 | 30 | tpl_assign_select($template, 'payer', $payer_list); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | '' => $lang['adm_pay_filter_all'], |
34 | 34 | ); |
35 | 35 | $query = doquery("SELECT distinct payment_module_name FROM `{{payment}}` ORDER BY payment_module_name"); |
36 | -while($row = db_fetch($query)) { |
|
36 | +while ($row = db_fetch($query)) { |
|
37 | 37 | $module_list[$row['payment_module_name']] = $row['payment_module_name']; |
38 | 38 | } |
39 | 39 | tpl_assign_select($template, 'module', $module_list); |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | ($flt_module ? "AND payment_module_name = '{$flt_module}' " : '') . |
54 | 54 | " ORDER BY payment_id desc"); |
55 | 55 | |
56 | -while($row = db_fetch($query)) { |
|
56 | +while ($row = db_fetch($query)) { |
|
57 | 57 | $row2 = array(); |
58 | - foreach($row as $key => $value) { |
|
58 | + foreach ($row as $key => $value) { |
|
59 | 59 | $row2[strtoupper($key)] = $value; |
60 | 60 | } |
61 | 61 | $template->assign_block_vars('payment', $row2); |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | $message = ''; |
23 | 23 | $message_status = ERR_ERROR; |
24 | 24 | |
25 | -if($points = sys_get_param_float('points')) { |
|
25 | +if ($points = sys_get_param_float('points')) { |
|
26 | 26 | // If points not empty... |
27 | - if($username = sys_get_param_str_unsafe('id_user')) { |
|
27 | + if ($username = sys_get_param_str_unsafe('id_user')) { |
|
28 | 28 | $row = db_user_by_id($username, false, 'id, username', true, true); |
29 | - if(!isset($row['id'])) { |
|
29 | + if (!isset($row['id'])) { |
|
30 | 30 | $row = db_user_by_username($username, false, 'id, username', true, true); |
31 | 31 | } |
32 | - if(is_array($row) && isset($row['id'])) { |
|
32 | + if (is_array($row) && isset($row['id'])) { |
|
33 | 33 | // Does anything post to DB? |
34 | - if(rpg_points_change( |
|
34 | + if (rpg_points_change( |
|
35 | 35 | $row['id'], |
36 | 36 | RPG_ADMIN, |
37 | 37 | $points, |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | // Points not empty but destination is not set - this means error |
50 | 50 | $message = $lang['adm_dm_no_dest']; |
51 | 51 | } |
52 | -} elseif($id_user) { |
|
52 | +} elseif ($id_user) { |
|
53 | 53 | // Points is empty but destination is set - this again means error |
54 | 54 | $message = $lang['adm_dm_no_quant']; |
55 | 55 | } |
56 | 56 | |
57 | -if(!$isNoError) { |
|
57 | +if (!$isNoError) { |
|
58 | 58 | $template->assign_vars(array( |
59 | 59 | 'ID_USER' => $id_user, |
60 | 60 | 'POINTS' => $points, |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | )); |
63 | 63 | }; |
64 | 64 | |
65 | -if($message) { |
|
65 | +if ($message) { |
|
66 | 66 | $template->assign_block_vars('result', array('MESSAGE' => $message, 'STATUS' => $message_status ? $message_status : ERR_NONE)); |
67 | 67 | } |
68 | 68 |
@@ -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 | AdminCheckLevel(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, |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | global $config, $lang, $user; |
19 | 19 | |
20 | -if($user['authlevel'] < 3) { |
|
20 | +if ($user['authlevel'] < 3) { |
|
21 | 21 | sys_redirect(SN_ROOT_VIRTUAL . 'admin/banned.php'); |
22 | 22 | } |
23 | 23 | |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | $sort = sys_get_param_int('sort', SORT_ID); |
42 | 42 | $sort = $sort_fields[$sort] ? $sort : SORT_ID; |
43 | 43 | |
44 | -if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid')) && ($user_selected = db_user_by_id($user_id, false, 'id, username, authlevel'))) { |
|
45 | - if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
46 | - switch($action) { |
|
44 | +if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid')) && ($user_selected = db_user_by_id($user_id, false, 'id, username, authlevel'))) { |
|
45 | + if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
46 | + switch ($action) { |
|
47 | 47 | case ACTION_DELETE: |
48 | 48 | DeleteSelectedUser($user_id); |
49 | 49 | sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}"); |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | |
65 | 65 | $multi_ip = array(); |
66 | 66 | $ip_query = db_user_list_admin_multiaccounts(); |
67 | -while($ip = db_fetch($ip_query)) { |
|
67 | +while ($ip = db_fetch($ip_query)) { |
|
68 | 68 | $multi_ip[$ip['user_lastip']] = $ip['ip_count']; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $geoip = geoip_status(); |
72 | 72 | |
73 | 73 | $query = db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page); |
74 | -while($user_row = db_fetch($query)) { |
|
75 | - if($user_row['banaday']) { |
|
74 | +while ($user_row = db_fetch($query)) { |
|
75 | + if ($user_row['banaday']) { |
|
76 | 76 | $ban_details = doquery("SELECT * FROM {{banned}} WHERE `ban_user_id` = {$user_row['id']} ORDER BY ban_id DESC LIMIT 1", true); |
77 | 77 | } |
78 | 78 | |
79 | 79 | $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array(); |
80 | - foreach($geoip_info as $key => $value) { |
|
80 | + foreach ($geoip_info as $key => $value) { |
|
81 | 81 | $geoip_info[strtoupper($key)] = $value; |
82 | 82 | unset($geoip_info[$key]); |
83 | 83 | } |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 | |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | function adm_lng_assign_string($lang_id, $locale_string_name, $value) { |
21 | 21 | global $locale_string_template, $languages_info, $languages, $domain; |
22 | 22 | |
23 | - if(is_array($value)) { |
|
24 | - foreach($value as $sub_key => $sub_value) { |
|
23 | + if (is_array($value)) { |
|
24 | + foreach ($value as $sub_key => $sub_value) { |
|
25 | 25 | adm_lng_assign_string($lang_id, "{$locale_string_name}[{$sub_key}]", $sub_value); |
26 | 26 | } |
27 | - } elseif($value) { |
|
28 | - if(!isset($locale_string_template[$locale_string_name])) { |
|
27 | + } elseif ($value) { |
|
28 | + if (!isset($locale_string_template[$locale_string_name])) { |
|
29 | 29 | $locale_string_template[$locale_string_name] = array(); |
30 | 30 | } |
31 | 31 | $locale_string_template[$locale_string_name] = array_merge($locale_string_template[$locale_string_name], array("[{$lang_id}]" => htmlentities($value, ENT_COMPAT, 'utf-8'))); |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | global $domain, $lang_id; |
47 | 47 | |
48 | 48 | $return = "{$ident}'{$string_name}' => "; |
49 | - if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
49 | + if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
50 | 50 | $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"; |
51 | 51 | } else { |
52 | 52 | $return .= "array(\r\n"; |
53 | - foreach($string_value as $arr_name => $arr_data) { |
|
53 | + foreach ($string_value as $arr_name => $arr_data) { |
|
54 | 54 | $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . ' '); |
55 | 55 | } |
56 | 56 | $return .= "{$ident}),\r\n"; |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | |
104 | 104 | $string_name_new = false; |
105 | 105 | |
106 | - if(isset($honor_constants[$domain][$string_name_prefix])) { |
|
106 | + if (isset($honor_constants[$domain][$string_name_prefix])) { |
|
107 | 107 | $found_constants = array_keys($constants, $string_name); |
108 | - foreach($found_constants as $constant_name) { |
|
108 | + foreach ($found_constants as $constant_name) { |
|
109 | 109 | $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]); |
110 | - foreach($honor_prefix_list as $honor_prefix) { |
|
111 | - if(strpos($constant_name, $honor_prefix) === 0) { |
|
110 | + foreach ($honor_prefix_list as $honor_prefix) { |
|
111 | + if (strpos($constant_name, $honor_prefix) === 0) { |
|
112 | 112 | $string_name_new = $constant_name; |
113 | 113 | break; |
114 | 114 | } |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | |
119 | 119 | $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'"; |
120 | 120 | fwrite($file_handler, "{$ident}{$string_name_new} => "); |
121 | - if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
121 | + if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { |
|
122 | 122 | fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"); |
123 | 123 | } else { |
124 | 124 | $string_name_prefix = $string_name_prefix . "[{$string_name}]"; |
125 | 125 | fwrite($file_handler, "array(\r\n"); |
126 | - foreach($string_value as $arr_name => $arr_data) { |
|
126 | + foreach ($string_value as $arr_name => $arr_data) { |
|
127 | 127 | adm_lng_write_string($arr_name, $arr_data, $ident . ' ', $string_name_prefix); |
128 | 128 | } |
129 | 129 | fwrite($file_handler, "{$ident}),\r\n"); |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | $languages_info = lng_get_list(); |
144 | 144 | $domain = sys_get_param_str('domain'); |
145 | 145 | |
146 | -if($domain) { |
|
146 | +if ($domain) { |
|
147 | 147 | $lang_new = sys_get_param('lang_new'); |
148 | - if(!empty($lang_new)) { |
|
148 | + if (!empty($lang_new)) { |
|
149 | 149 | $constants = get_defined_constants(true); |
150 | 150 | $constants = $constants['user']; |
151 | 151 | ksort($constants); |
152 | - foreach($languages_info as $lang_id => $land_data) { |
|
152 | + foreach ($languages_info as $lang_id => $land_data) { |
|
153 | 153 | $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w'); |
154 | 154 | fwrite($file_handler, "<?php\r\n\r\n/*\r\n############################################################################# |
155 | 155 | # Filename: {$domain}.mo.php |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | # Website: http://www.supernova.ws |
158 | 158 | # Description: Massive Multiplayer Online Browser Space Startegy Game\r\n#\r\n"); |
159 | 159 | |
160 | - foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
160 | + foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
161 | 161 | $lang_copyright = str_replace(array('©', '"', '<', '>'), array('©', '"', '<', '>'), $lang_copyright); |
162 | 162 | fwrite($file_handler, "# {$lang_copyright}\r\n"); |
163 | 163 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version " . SN_VERSION . "\r\n*\r\n*/\r\n |
166 | 166 | /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n |
167 | 167 | \$a_lang_array = array(\r\n"); |
168 | - foreach($lang_new as $string_name => $string_value) { |
|
168 | + foreach ($lang_new as $string_name => $string_value) { |
|
169 | 169 | adm_lng_write_string($string_name, $string_value); |
170 | 170 | } |
171 | 171 | fwrite($file_handler, ");\r\n"); |
@@ -176,21 +176,21 @@ discard block |
||
176 | 176 | die(); |
177 | 177 | } |
178 | 178 | |
179 | - foreach($languages_info as $lang_id => $lang_data) { |
|
179 | + foreach ($languages_info as $lang_id => $lang_data) { |
|
180 | 180 | $template->assign_block_vars('language', $lang_data); |
181 | 181 | $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php"; |
182 | 182 | $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : '')); |
183 | - foreach($languages[$lang_id] as $locale_string_name => $cork) { |
|
183 | + foreach ($languages[$lang_id] as $locale_string_name => $cork) { |
|
184 | 184 | adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]); |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - foreach($locale_string_template as $locale_string_name => $locale_string_list) { |
|
188 | + foreach ($locale_string_template as $locale_string_name => $locale_string_list) { |
|
189 | 189 | $template->assign_block_vars('string', array( |
190 | 190 | 'NAME' => $locale_string_name, |
191 | 191 | )); |
192 | 192 | |
193 | - foreach($languages_info as $lang_id => $cork2) { |
|
193 | + foreach ($languages_info as $lang_id => $cork2) { |
|
194 | 194 | $template->assign_block_vars('string.locale', array( |
195 | 195 | 'LANG' => $lang_id, |
196 | 196 | 'VALUE' => $locale_string_list["[{$lang_id}]"], |
@@ -206,17 +206,17 @@ discard block |
||
206 | 206 | $dir = dir($path); |
207 | 207 | while (false !== ($lang_id = $dir->read())) { |
208 | 208 | $full_path = $path . $lang_id; |
209 | - if($lang_id[0] != "." && is_dir($full_path)) { |
|
209 | + if ($lang_id[0] != "." && is_dir($full_path)) { |
|
210 | 210 | $lang_file_list = dir($full_path); |
211 | 211 | while (false !== ($filename = $lang_file_list->read())) { |
212 | 212 | $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.'))); |
213 | - if(!$lang_domain) { |
|
213 | + if (!$lang_domain) { |
|
214 | 214 | continue; |
215 | 215 | } |
216 | 216 | |
217 | 217 | $file_ext = strtolower(substr($filename, strpos($filename, '.'))); |
218 | - if($lang_domain != 'language') { |
|
219 | - if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) { |
|
218 | + if ($lang_domain != 'language') { |
|
219 | + if ($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) { |
|
220 | 220 | $language_domains[$lang_domain] = $lang_domain; |
221 | 221 | $languages[$lang_id][$lang_domain] = $lang_domain; |
222 | 222 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | $dir->close(); |
228 | 228 | |
229 | - foreach($language_domains as $lang_domain) { |
|
229 | + foreach ($language_domains as $lang_domain) { |
|
230 | 230 | $template->assign_block_vars('domain', array( |
231 | 231 | 'NAME' => $lang_domain, |
232 | 232 | )); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | |
18 | -if(!sn_module_get_active_count('payment')) { |
|
18 | +if (!sn_module_get_active_count('payment')) { |
|
19 | 19 | sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php'); |
20 | 20 | } |
21 | 21 | |
@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | $message = ''; |
29 | 29 | $message_status = ERR_ERROR; |
30 | 30 | |
31 | -if($points = sys_get_param_float('points')) { |
|
31 | +if ($points = sys_get_param_float('points')) { |
|
32 | 32 | try { |
33 | 33 | $username = sys_get_param_str_unsafe('id_user'); |
34 | - if(empty($username)) { |
|
34 | + if (empty($username)) { |
|
35 | 35 | throw new Exception($lang['adm_mm_no_dest']); |
36 | 36 | } |
37 | 37 | |
38 | 38 | $an_account = new Account(classSupernova::$auth->account->db); |
39 | - if(!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) { |
|
39 | + if (!$an_account->db_get_by_id($username) && !$an_account->db_get_by_name($username) && !$an_account->db_get_by_email($username)) { |
|
40 | 40 | throw new Exception(sprintf($lang['adm_mm_user_none'], $username)); |
41 | 41 | } |
42 | 42 | |
43 | - if(!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf( |
|
43 | + if (!$an_account->metamatter_change(RPG_ADMIN, $points, sprintf( |
|
44 | 44 | $lang['adm_matter_change_log_record'], |
45 | 45 | $an_account->account_id, db_escape($an_account->account_name), |
46 | 46 | $user['id'], db_escape($user['username']), |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // $message = $lang['adm_mm_no_quant']; |
60 | 60 | } |
61 | 61 | |
62 | -if($message_status == ERR_ERROR) { |
|
62 | +if ($message_status == ERR_ERROR) { |
|
63 | 63 | $template->assign_vars(array( |
64 | 64 | 'ID_USER' => $username, |
65 | 65 | 'POINTS' => $points, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | )); |
68 | 68 | }; |
69 | 69 | |
70 | -if($message) { |
|
70 | +if ($message) { |
|
71 | 71 | $template->assign_block_vars('result', array('MESSAGE' => $message, 'STATUS' => $message_status ? $message_status : ERR_NONE)); |
72 | 72 | } |
73 | 73 |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | * |
9 | 9 | */ |
10 | 10 | |
11 | -define('INSIDE' , true); |
|
12 | -define('INSTALL' , false); |
|
11 | +define('INSIDE', true); |
|
12 | +define('INSTALL', false); |
|
13 | 13 | define('IN_ADMIN', true); |
14 | 14 | |
15 | 15 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | $template->assign_block_vars('int_type_selected', $allowed_types[-1]); |
31 | -foreach($sn_message_class_list as $key => $value) |
|
31 | +foreach ($sn_message_class_list as $key => $value) |
|
32 | 32 | { |
33 | - if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) |
|
33 | + if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) |
|
34 | 34 | { |
35 | 35 | continue; |
36 | 36 | } |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | |
44 | 44 | |
45 | 45 | $message_delete = sys_get_param_id('msg_del'); |
46 | -if(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) |
|
46 | +if (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) |
|
47 | 47 | { |
48 | 48 | $message_delete = implode(', ', $message_delete); |
49 | 49 | } |
50 | 50 | |
51 | -if($message_delete) |
|
51 | +if ($message_delete) |
|
52 | 52 | { |
53 | 53 | doquery("DELETE FROM {{messages}} WHERE `message_id` in ({$message_delete});"); |
54 | 54 | $template->assign_block_vars('result', array('MESSAGE' => sprintf($lang['mlst_messages_deleted'], $message_delete))); |
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | -if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) |
|
58 | +if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) |
|
59 | 59 | { |
60 | 60 | $delete_date = "{$year}-{$month}-{$day}"; |
61 | 61 | doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')" . ($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : '')); |
@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | |
69 | 69 | $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max); |
70 | 70 | |
71 | -if(sys_get_param('page_prev') && $int_page_current > 1) |
|
71 | +if (sys_get_param('page_prev') && $int_page_current > 1) |
|
72 | 72 | { |
73 | 73 | $int_page_current--; |
74 | 74 | } |
75 | -elseif(sys_get_param('page_next') && $int_page_current < $page_max) |
|
75 | +elseif (sys_get_param('page_next') && $int_page_current < $page_max) |
|
76 | 76 | { |
77 | 77 | $int_page_current++; |
78 | 78 | } |
79 | 79 | |
80 | -for($i = 1; $i <= $page_max; $i++) |
|
80 | +for ($i = 1; $i <= $page_max; $i++) |
|
81 | 81 | { |
82 | 82 | $template->assign_block_vars('page', array('NUMBER' => $i)); |
83 | 83 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $StartRec = ($int_page_current - 1) * 25; |
86 | 86 | |
87 | 87 | $Messages = db_message_list_admin_by_type($int_type_selected, $StartRec); |
88 | -while($row = db_fetch($Messages)) |
|
88 | +while ($row = db_fetch($Messages)) |
|
89 | 89 | { |
90 | 90 | $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8'); |
91 | 91 | $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -define('INSIDE' , true); |
|
3 | -define('INSTALL' , false); |
|
2 | +define('INSIDE', true); |
|
3 | +define('INSTALL', false); |
|
4 | 4 | define('IN_ADMIN', true); |
5 | 5 | |
6 | 6 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $username_unsafe = sys_get_param_str_unsafe('username'); |
25 | 25 | $username = sys_get_param_escaped('username'); |
26 | 26 | |
27 | -if($galaxy_src) |
|
27 | +if ($galaxy_src) |
|
28 | 28 | { |
29 | 29 | sn_db_transaction_start(); |
30 | 30 | $errors = array(); |
@@ -34,41 +34,41 @@ discard block |
||
34 | 34 | $planet = sys_o_get_updated($owner, array('galaxy' => $galaxy_src, 'system' => $system_src, 'planet' => $planet_src, 'planet_type' => 1), SN_TIME_NOW); |
35 | 35 | $que = $planet['que']; |
36 | 36 | $planet = $planet['planet']; |
37 | - if(!$planet) |
|
37 | + if (!$planet) |
|
38 | 38 | { |
39 | 39 | $errors[] = $lang['adm_pl_comp_err_0']; |
40 | 40 | } |
41 | 41 | |
42 | - if($planet['destruyed']) |
|
42 | + if ($planet['destruyed']) |
|
43 | 43 | { |
44 | 44 | $errors[] = $lang['adm_pl_comp_err_1']; |
45 | 45 | } |
46 | 46 | |
47 | - if($planet['id_owner'] != $owner['id'] || !$username) |
|
47 | + if ($planet['id_owner'] != $owner['id'] || !$username) |
|
48 | 48 | { |
49 | 49 | $errors[] = $lang['adm_pl_comp_err_4']; |
50 | 50 | } |
51 | 51 | |
52 | 52 | $destination = sys_o_get_updated($owner, array('galaxy' => $galaxy_dst, 'system' => $system_dst, 'planet' => $planet_dst, 'planet_type' => 1), SN_TIME_NOW); |
53 | 53 | $destination = $destination['planet']; |
54 | - if(!$destination) |
|
54 | + if (!$destination) |
|
55 | 55 | { |
56 | 56 | $errors[] = $lang['adm_pl_comp_err_2']; |
57 | 57 | } |
58 | 58 | |
59 | - if($planet['id'] == $destination['id']) |
|
59 | + if ($planet['id'] == $destination['id']) |
|
60 | 60 | { |
61 | 61 | $errors[] = $lang['adm_pl_comp_err_5']; |
62 | 62 | } |
63 | 63 | |
64 | - if($planet['id_owner'] != $destination['id_owner']) |
|
64 | + if ($planet['id_owner'] != $destination['id_owner']) |
|
65 | 65 | { |
66 | 66 | $errors[] = $lang['adm_pl_comp_err_3']; |
67 | 67 | } |
68 | 68 | |
69 | - if(!empty($errors)) |
|
69 | + if (!empty($errors)) |
|
70 | 70 | { |
71 | - foreach($errors as $error) |
|
71 | + foreach ($errors as $error) |
|
72 | 72 | { |
73 | 73 | $template->assign_block_vars('error', array( |
74 | 74 | 'TEXT' => $error, |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | killer_add_planet($planet); |
83 | 83 | |
84 | 84 | $moon = DBStaticPlanet::db_planet_by_gspt($galaxy_src, $system_src, $planet_src, PT_MOON, true); |
85 | - if($moon) |
|
85 | + if ($moon) |
|
86 | 86 | { |
87 | 87 | $moon = sys_o_get_updated($owner, $moon, SN_TIME_NOW); |
88 | 88 | $moon = $moon['planet']; |
89 | 89 | killer_add_planet($moon); |
90 | 90 | } |
91 | 91 | |
92 | - foreach(sn_get_groups('resources_loot') as $resource_id) |
|
92 | + foreach (sn_get_groups('resources_loot') as $resource_id) |
|
93 | 93 | { |
94 | 94 | $resource_name = pname_resource_name($resource_id); |
95 | 95 | $template->assign_var("{$resource_name}_cost", $final_cost[$resource_id]); |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | $template->assign_var("{$resource_name}_bonus", $final_cost[$resource_id]); |
98 | 98 | } |
99 | 99 | |
100 | - if($_GET['btn_confirm']) |
|
100 | + if ($_GET['btn_confirm']) |
|
101 | 101 | { |
102 | 102 | $time = SN_TIME_NOW + PERIOD_DAY; |
103 | 103 | |
104 | 104 | DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $planet['id']); |
105 | 105 | DBStaticPlanet::db_planet_set_by_id($planet['id'], "id_owner = 0, destruyed = {$time}"); |
106 | - if($moon) |
|
106 | + if ($moon) |
|
107 | 107 | { |
108 | 108 | DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $moon['id']); |
109 | 109 | DBStaticPlanet::db_planet_set_by_id($moon['id'], "id_owner = 0, destruyed = {$time}"); |
@@ -145,34 +145,34 @@ discard block |
||
145 | 145 | } |
146 | 146 | */ |
147 | 147 | |
148 | - foreach(sn_get_groups('structures') as $unit_id) |
|
148 | + foreach (sn_get_groups('structures') as $unit_id) |
|
149 | 149 | { |
150 | 150 | $build_level = mrc_get_level($user, $planet, $unit_id, true, true); |
151 | - if($build_level > 0) |
|
151 | + if ($build_level > 0) |
|
152 | 152 | { |
153 | 153 | $unit_cost = get_unit_param($unit_id, 'cost'); |
154 | 154 | $build_factor = $unit_cost['factor'] != 1 ? (1 - pow($unit_cost['factor'], $build_level)) / (1 - $unit_cost['factor']) : $unit_cost['factor']; |
155 | - foreach($sn_group_resources_loot as $resource_id) |
|
155 | + foreach ($sn_group_resources_loot as $resource_id) |
|
156 | 156 | { |
157 | 157 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $build_factor) : 0; |
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - foreach(sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
162 | + foreach (sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
163 | 163 | { |
164 | 164 | $unit_count = mrc_get_level($user, $planet, $unit_id, true, true); |
165 | - if($unit_count > 0) |
|
165 | + if ($unit_count > 0) |
|
166 | 166 | { |
167 | 167 | $unit_cost = get_unit_param($unit_id, 'cost'); |
168 | - foreach($sn_group_resources_loot as $resource_id) |
|
168 | + foreach ($sn_group_resources_loot as $resource_id) |
|
169 | 169 | { |
170 | 170 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $unit_count) : 0; |
171 | 171 | } |
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | - foreach($sn_group_resources_loot as $resource_id) |
|
175 | + foreach ($sn_group_resources_loot as $resource_id) |
|
176 | 176 | { |
177 | 177 | $final_cost[$resource_id] += floor(mrc_get_level($user, $planet, $resource_id, true, true)); |
178 | 178 | } |