@@ -8,8 +8,8 @@ |
||
8 | 8 | const MOON_MIN_SIZE = 1100; |
9 | 9 | const MOON_MAX_SIZE = 8999; |
10 | 10 | |
11 | - const MOON_DEBRIS_MIN = 1000000; // Minimum amount of debris to span a moon |
|
12 | - const MOON_CHANCE_MIN_PERCENT = 1; // Minimum chance to span a moon |
|
11 | + const MOON_DEBRIS_MIN = 1000000; // Minimum amount of debris to span a moon |
|
12 | + const MOON_CHANCE_MIN_PERCENT = 1; // Minimum chance to span a moon |
|
13 | 13 | const MOON_CHANCE_MAX_PERCENT = 30; // Maximum chance to span a moon |
14 | 14 | |
15 | 15 | /** |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use DBAL\OldDbChangeSet; |
4 | 4 | use Planet\DBStaticPlanet; |
5 | 5 | |
6 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
6 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
7 | 7 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
8 | 8 | } |
9 | 9 | |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | 'rpg_cost' => $rpg_cost, |
16 | 16 | )); |
17 | 17 | |
18 | -if(is_array($shipList)) { |
|
19 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
18 | +if (is_array($shipList)) { |
|
19 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
20 | 20 | $intError = MARKET_NO_DM; |
21 | 21 | } |
22 | 22 | |
@@ -33,30 +33,30 @@ discard block |
||
33 | 33 | $qry = array(); |
34 | 34 | $total = array(); |
35 | 35 | $db_changeset = array(); |
36 | - foreach($shipList as $shipID => &$shipCount) { |
|
36 | + foreach ($shipList as $shipID => &$shipCount) { |
|
37 | 37 | $shipCount = ceil(floatval($shipCount)); |
38 | - if(!$shipCount) { |
|
38 | + if (!$shipCount) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
42 | - if($shipCount < 0) { |
|
42 | + if ($shipCount < 0) { |
|
43 | 43 | $debug->warning('User supplied negative ship count on Black Market page', 'Hack Attempt', 307); |
44 | 44 | $intError = MARKET_NEGATIVE_SHIPS; |
45 | 45 | break; |
46 | 46 | } |
47 | 47 | |
48 | - if($mode == MARKET_SCRAPPER) { |
|
48 | + if ($mode == MARKET_SCRAPPER) { |
|
49 | 49 | $amount = mrc_get_level($user, $planetrow, $shipID, true, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
50 | - } elseif($mode == MARKET_STOCKMAN) { |
|
50 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
51 | 51 | $amount = $stock[$shipID]; |
52 | 52 | } |
53 | 53 | |
54 | - if($amount < $shipCount) { |
|
54 | + if ($amount < $shipCount) { |
|
55 | 55 | $intError = $error_no_stock; |
56 | 56 | break; |
57 | 57 | } |
58 | 58 | |
59 | - if(!in_array($shipID, sn_get_groups('fleet'))) { |
|
59 | + if (!in_array($shipID, sn_get_groups('fleet'))) { |
|
60 | 60 | $debug->warning('Hack Attempt', 'User supplied non-ship unit ID on Black Market page', 306); |
61 | 61 | $intError = MARKET_NOT_A_SHIP; |
62 | 62 | break; |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | $resTemp[RES_CRYSTAL] = floor($build_data[BUILD_CREATE][RES_CRYSTAL] * $shipCount * $config_rpg_scrape_crystal * (-$multiplier)); |
73 | 73 | $resTemp[RES_DEUTERIUM] = floor($build_data[BUILD_CREATE][RES_DEUTERIUM] * $shipCount * $config_rpg_scrape_deuterium * (-$multiplier)); |
74 | 74 | |
75 | - foreach($resTemp as $resID => $resCount) { |
|
75 | + foreach ($resTemp as $resID => $resCount) { |
|
76 | 76 | $total[$resID] += $resCount; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $message .= "<li>{$lang['tech'][$shipID]}: " . HelperString::numberFloorAndFormat($shipCount); |
80 | 80 | } |
81 | 81 | |
82 | - if($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | - foreach($total as $resID => $resCount) { |
|
84 | - if(mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
82 | + if ($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | + foreach ($total as $resID => $resCount) { |
|
84 | + if (mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
85 | 85 | $intError = MARKET_NO_RESOURCES; |
86 | 86 | $debug->warning('Trying to use bug in s/h market', 'S/H Ship Market', 301); |
87 | 87 | break; |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | |
92 | 92 | $intError = ($intError == MARKET_DEAL) && (array_sum($total) == 0) ? $error_zero_res : $intError; |
93 | 93 | |
94 | - if($intError == MARKET_DEAL) { |
|
94 | + if ($intError == MARKET_DEAL) { |
|
95 | 95 | $message .= '</ul>' . $lang["eco_mrk_{$submode}_res"] . '<ul>'; |
96 | - foreach($total as $resID => $resCount) { |
|
97 | - if(!$resCount) { |
|
96 | + foreach ($total as $resID => $resCount) { |
|
97 | + if (!$resCount) { |
|
98 | 98 | continue; |
99 | 99 | } |
100 | 100 | |
@@ -128,38 +128,38 @@ discard block |
||
128 | 128 | 'MESSAGE' => $lang['eco_mrk_errors'][$intError], |
129 | 129 | )); |
130 | 130 | |
131 | - foreach($shipList as $shipID => $shipCount) { |
|
131 | + foreach ($shipList as $shipID => $shipCount) { |
|
132 | 132 | $data['ships'][$shipID] = max(0, intval($shipCount)); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | $message = ''; |
137 | 137 | |
138 | -if(!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) { |
|
139 | - $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item){return mt_rand(1, 1000);}, sn_get_groups('fleet')))); |
|
138 | +if (!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) { |
|
139 | + $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item) {return mt_rand(1, 1000); }, sn_get_groups('fleet')))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | tpl_set_resource_info($template, $planetrow, array()); |
143 | 143 | |
144 | -if(!$array) { |
|
144 | +if (!$array) { |
|
145 | 145 | $array = array(); |
146 | 146 | } |
147 | 147 | |
148 | 148 | $group_fleet = sn_get_groups('fleet'); |
149 | -foreach($array as $key => $value) { |
|
150 | - if($mode == MARKET_SCRAPPER) { |
|
149 | +foreach ($array as $key => $value) { |
|
150 | + if ($mode == MARKET_SCRAPPER) { |
|
151 | 151 | $shipID = $value; |
152 | 152 | $amount = mrc_get_level($user, $planetrow, $shipID, false, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
153 | - } elseif($mode == MARKET_STOCKMAN) { |
|
153 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
154 | 154 | $shipID = $key; |
155 | 155 | $amount = $value; |
156 | 156 | } |
157 | 157 | |
158 | - if(!in_array($shipID, $group_fleet)) { |
|
158 | + if (!in_array($shipID, $group_fleet)) { |
|
159 | 159 | continue; |
160 | 160 | } |
161 | 161 | |
162 | - if($amount > 0) { |
|
162 | + if ($amount > 0) { |
|
163 | 163 | $build_data = eco_get_build_data($user, $planetrow, $shipID); |
164 | 164 | $template->assign_block_vars('ships', array( |
165 | 165 | 'ID' => $shipID, |
@@ -19,7 +19,7 @@ |
||
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | - if(!empty($paramList)) { |
|
22 | + if (!empty($paramList)) { |
|
23 | 23 | $strParams = implode('&', $paramList); |
24 | 24 | } |
25 | 25 |
@@ -239,7 +239,7 @@ |
||
239 | 239 | |
240 | 240 | $factory = $this->values[$id]; |
241 | 241 | |
242 | - $extended = function ($c) use ($callable, $factory) { |
|
242 | + $extended = function($c) use ($callable, $factory) { |
|
243 | 243 | return $callable($factory($c), $c); |
244 | 244 | }; |
245 | 245 |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | |
142 | 142 | preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches); |
143 | 143 | $include_blocks = $matches[1]; |
144 | - if($include_blocks) |
|
144 | + if ($include_blocks) |
|
145 | 145 | { |
146 | - foreach($include_blocks as &$included_file) |
|
146 | + foreach ($include_blocks as &$included_file) |
|
147 | 147 | { |
148 | 148 | $included_file .= '.tpl.html'; |
149 | 149 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $varname = $var_val[3]; |
309 | 309 | $new = $this->generate_block_varref($namespace, $varname, $var_val[2]); |
310 | 310 | |
311 | - if(!empty($var_val[4])) { |
|
311 | + if (!empty($var_val[4])) { |
|
312 | 312 | $new = \Ptl\PtlVariableDecorator::decorate($var_val[0], $new, $this->template); |
313 | 313 | } |
314 | 314 | |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | |
463 | 463 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
464 | 464 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
465 | - $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
466 | - $tag_template_php .= '$this->_block_value["'. $tag_args . '"] = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
465 | + $tag_template_php .= '$_' . $tag_args . '_val = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
466 | + $tag_template_php .= '$this->_block_value["' . $tag_args . '"] = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
467 | 467 | |
468 | 468 | return $tag_template_php; |
469 | 469 | } |
@@ -567,10 +567,10 @@ discard block |
||
567 | 567 | break; |
568 | 568 | |
569 | 569 | case 'is': |
570 | - $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1; |
|
570 | + $is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1; |
|
571 | 571 | $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); |
572 | 572 | |
573 | - $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); |
|
573 | + $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1)); |
|
574 | 574 | |
575 | 575 | array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens); |
576 | 576 | |
@@ -834,11 +834,11 @@ discard block |
||
834 | 834 | } |
835 | 835 | else if ($include_last_iterator) |
836 | 836 | { |
837 | - return '$_'. $blocks[$blockcount] . '_val'; |
|
837 | + return '$_' . $blocks[$blockcount] . '_val'; |
|
838 | 838 | } |
839 | 839 | else |
840 | 840 | { |
841 | - return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']'; |
|
841 | + return '$_' . $blocks[$blockcount - 1] . '_val[\'' . $blocks[$blockcount] . '\']'; |
|
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | if ($fp = @fopen($filename, 'wb')) |
856 | 856 | { |
857 | 857 | @flock($fp, LOCK_EX); |
858 | - @fwrite ($fp, $data); |
|
858 | + @fwrite($fp, $data); |
|
859 | 859 | @flock($fp, LOCK_UN); |
860 | 860 | @fclose($fp); |
861 | 861 | |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | */ |
874 | 874 | function minify($html) |
875 | 875 | { |
876 | - if(!SN::$config->tpl_minifier) |
|
876 | + if (!SN::$config->tpl_minifier) |
|
877 | 877 | { |
878 | 878 | return $html; |
879 | 879 | } |
@@ -885,14 +885,14 @@ discard block |
||
885 | 885 | //$html = preg_replace('/[\r\n\t]+/', ' ', $html); |
886 | 886 | $html = preg_replace('/>[\s]*</', '><', $html); // Strip spacechars between tags |
887 | 887 | $html = preg_replace('/[\s]+/', ' ', $html); // Replace several spacechars with one space |
888 | - if(!empty($pre[0])) |
|
888 | + if (!empty($pre[0])) |
|
889 | 889 | { |
890 | - foreach($pre[0] as $tag) |
|
890 | + foreach ($pre[0] as $tag) |
|
891 | 891 | { |
892 | 892 | $tag = preg_replace('/^\ *\/\/[^\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside |
893 | 893 | $tag = preg_replace('/[\ \t]{2,}/', ' ', $tag); // Replace several spaces by one |
894 | 894 | $tag = preg_replace('/\s{2,}/', "\r\n", $tag); // Replace several linefeeds by one |
895 | - $html = preg_replace('/#pre#/', $tag, $html,1); |
|
895 | + $html = preg_replace('/#pre#/', $tag, $html, 1); |
|
896 | 896 | } |
897 | 897 | } |
898 | 898 |
@@ -29,19 +29,19 @@ |
||
29 | 29 | 'ID' => self::PAGE_SORT_BY_RANK, |
30 | 30 | 'HTML_ID' => 'byTotalRank', |
31 | 31 | 'HTML_NAME' => '{ byTotalRank }', |
32 | - 'SQL_SORT' => ['u.total_rank',], |
|
32 | + 'SQL_SORT' => ['u.total_rank', ], |
|
33 | 33 | ], |
34 | 34 | self::PAGE_SORT_BY_ID => [ |
35 | 35 | 'ID' => self::PAGE_SORT_BY_ID, |
36 | 36 | 'HTML_ID' => 'byId', |
37 | 37 | 'HTML_NAME' => '{ byId }', |
38 | - 'SQL_SORT' => ['u.id',], |
|
38 | + 'SQL_SORT' => ['u.id', ], |
|
39 | 39 | ], |
40 | 40 | self::PAGE_SORT_BY_NAME => [ |
41 | 41 | 'ID' => self::PAGE_SORT_BY_NAME, |
42 | 42 | 'HTML_ID' => 'byName', |
43 | 43 | 'HTML_NAME' => '{ byName }', |
44 | - 'SQL_SORT' => ['u.username',], |
|
44 | + 'SQL_SORT' => ['u.username', ], |
|
45 | 45 | ], |
46 | 46 | |
47 | 47 | self::PAGE_SORT_BY_POINTS => [ |
@@ -13,8 +13,8 @@ |
||
13 | 13 | const SORT_BY_ACTIVITY = 1; |
14 | 14 | |
15 | 15 | private static $sorting = [ |
16 | - self::SORT_BY_PACKAGE => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED',], |
|
17 | - self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME',], |
|
16 | + self::SORT_BY_PACKAGE => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED', ], |
|
17 | + self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME', ], |
|
18 | 18 | ]; |
19 | 19 | |
20 | 20 | private static $sortFields = []; |
@@ -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,13 +118,13 @@ 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 | // fwrite($file_handler, "'" . addslashes($string_value[$lang_id]) . "',"); |
124 | 124 | } else { |
125 | 125 | $string_name_prefix = $string_name_prefix . "[{$string_name}]"; |
126 | 126 | fwrite($file_handler, "array(\r\n"); |
127 | - foreach($string_value as $arr_name => $arr_data) { |
|
127 | + foreach ($string_value as $arr_name => $arr_data) { |
|
128 | 128 | adm_lng_write_string($arr_name, $arr_data, $ident . ' ', $string_name_prefix); |
129 | 129 | } |
130 | 130 | fwrite($file_handler, "{$ident}),\r\n"); |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | $languages_info = lng_get_list(); |
145 | 145 | $domain = sys_get_param_str('domain'); |
146 | 146 | |
147 | -if($domain) { |
|
147 | +if ($domain) { |
|
148 | 148 | $lang_new = sys_get_param('lang_new'); |
149 | - if(!empty($lang_new) && is_array($lang_new)) { |
|
149 | + if (!empty($lang_new) && is_array($lang_new)) { |
|
150 | 150 | $constants = get_defined_constants(true); |
151 | 151 | $constants = $constants['user']; |
152 | 152 | ksort($constants); |
153 | - foreach($languages_info as $lang_id => $land_data) { |
|
153 | + foreach ($languages_info as $lang_id => $land_data) { |
|
154 | 154 | $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w'); |
155 | 155 | fwrite($file_handler, "<?php\r\n\r\n/*\r\n############################################################################# |
156 | 156 | # Filename: {$domain}.mo.php |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | # Website: http://www.supernova.ws |
159 | 159 | # Description: Massive Multiplayer Online Browser Space Strategy Game\r\n#\r\n"); |
160 | 160 | |
161 | - foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
161 | + foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) { |
|
162 | 162 | $lang_copyright = str_replace(array('©', '"', '<', '>'), array('©', '"', '<', '>'), $lang_copyright); |
163 | 163 | fwrite($file_handler, "# {$lang_copyright}\r\n"); |
164 | 164 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | /**\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 |
167 | 167 | /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n |
168 | 168 | \$a_lang_array = array(\r\n"); |
169 | - foreach($lang_new as $string_name => $string_value) { |
|
169 | + foreach ($lang_new as $string_name => $string_value) { |
|
170 | 170 | adm_lng_write_string($string_name, $string_value); |
171 | 171 | } |
172 | 172 | fwrite($file_handler, ");\r\n"); |
@@ -176,21 +176,21 @@ discard block |
||
176 | 176 | sys_redirect("admin_locale.php?domain={$domain}"); |
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 | )); |
@@ -96,8 +96,7 @@ |
||
96 | 96 | |
97 | 97 | $core_info = uni_create_planet_get_density($position_data, $user_row, $planet_sectors); |
98 | 98 | |
99 | - $planet_name_unsafe = !empty($options['force_name']) ? $options['force_name'] : |
|
100 | - ($user_row['username'] . ' ' . ( |
|
99 | + $planet_name_unsafe = !empty($options['force_name']) ? $options['force_name'] : ($user_row['username'] . ' ' . ( |
|
101 | 100 | $HomeWorld |
102 | 101 | ? SN::$lang['sys_capital'] |
103 | 102 | : ($planet_name_unsafe ? $planet_name_unsafe : SN::$lang['sys_colo_defaultname']) |