@@ -1,58 +1,58 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function dump($value,$varname = "",$level=0,$dumper = "") |
|
| 3 | +function dump($value, $varname = "", $level = 0, $dumper = "") |
|
| 4 | 4 | { |
| 5 | 5 | if ($varname) $varname .= " = "; |
| 6 | 6 | |
| 7 | - if ($level==-1) |
|
| 7 | + if ($level == -1) |
|
| 8 | 8 | { |
| 9 | - $trans[' ']='∴'; |
|
| 10 | - $trans["\t"]='⇒'; |
|
| 11 | - $trans["\n"]='¶;'; |
|
| 12 | - $trans["\r"]='⇐'; |
|
| 13 | - $trans["\0"]='⊕'; |
|
| 14 | - return strtr(htmlspecialchars($value),$trans); |
|
| 9 | + $trans[' '] = '∴'; |
|
| 10 | + $trans["\t"] = '⇒'; |
|
| 11 | + $trans["\n"] = '¶;'; |
|
| 12 | + $trans["\r"] = '⇐'; |
|
| 13 | + $trans["\0"] = '⊕'; |
|
| 14 | + return strtr(htmlspecialchars($value), $trans); |
|
| 15 | 15 | } |
| 16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
| 16 | + if ($level == 0) $dumper = '<pre>'.$varname; |
|
| 17 | 17 | |
| 18 | 18 | $type = gettype($value); |
| 19 | 19 | $dumper .= $type; |
| 20 | 20 | |
| 21 | - if ($type=='string') |
|
| 21 | + if ($type == 'string') |
|
| 22 | 22 | { |
| 23 | 23 | $dumper .= '('.strlen($value).')'; |
| 24 | - $value = dump($value,"",-1); |
|
| 24 | + $value = dump($value, "", -1); |
|
| 25 | 25 | } |
| 26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
| 27 | - elseif ($type=='object') |
|
| 26 | + elseif ($type == 'boolean') $value = ($value ? 'true' : 'false'); |
|
| 27 | + elseif ($type == 'object') |
|
| 28 | 28 | { |
| 29 | - $props= get_class_vars(get_class($value)); |
|
| 29 | + $props = get_class_vars(get_class($value)); |
|
| 30 | 30 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
| 31 | - foreach($props as $key=>$val) |
|
| 31 | + foreach ($props as $key=>$val) |
|
| 32 | 32 | { |
| 33 | - $dumper .= "\n".str_repeat("\t",$level+1).$key.' => '; |
|
| 34 | - $dumper .= dump($value->$key,"",$level+1); |
|
| 33 | + $dumper .= "\n".str_repeat("\t", $level + 1).$key.' => '; |
|
| 34 | + $dumper .= dump($value->$key, "", $level + 1); |
|
| 35 | 35 | } |
| 36 | - $value= ''; |
|
| 36 | + $value = ''; |
|
| 37 | 37 | } |
| 38 | - elseif ($type=='array') |
|
| 38 | + elseif ($type == 'array') |
|
| 39 | 39 | { |
| 40 | 40 | $dumper .= '('.count($value).')'; |
| 41 | - foreach($value as $key=>$val) |
|
| 41 | + foreach ($value as $key=>$val) |
|
| 42 | 42 | { |
| 43 | - $dumper .= "\n".str_repeat("\t",$level+1).dump($key,"",-1).' => '; |
|
| 44 | - $dumper .= dump($val,"",$level+1); |
|
| 43 | + $dumper .= "\n".str_repeat("\t", $level + 1).dump($key, "", -1).' => '; |
|
| 44 | + $dumper .= dump($val, "", $level + 1); |
|
| 45 | 45 | } |
| 46 | - $value= ''; |
|
| 46 | + $value = ''; |
|
| 47 | 47 | } |
| 48 | 48 | $dumper .= " <b>$value</b>"; |
| 49 | - if ($level==0) $dumper .= '</pre>'; |
|
| 49 | + if ($level == 0) $dumper .= '</pre>'; |
|
| 50 | 50 | return $dumper; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | function pdump($value, $varname = '') |
| 54 | 54 | { |
| 55 | - print('<span style="text-align: left">' . dump($value, $varname) . '</span>'); |
|
| 55 | + print('<span style="text-align: left">'.dump($value, $varname).'</span>'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | function debug($value, $varname = '') |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $output_buffer .= $string; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -if(substr(getcwd(), -4) != 'docs') |
|
| 70 | +if (substr(getcwd(), -4) != 'docs') |
|
| 71 | 71 | { |
| 72 | 72 | $path_prefix = 'docs/'; |
| 73 | 73 | } |
@@ -80,22 +80,22 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $filename = 'changelog'; |
| 82 | 82 | |
| 83 | -$input = file_get_contents($path_prefix . $filename . '.txt'); |
|
| 83 | +$input = file_get_contents($path_prefix.$filename.'.txt'); |
|
| 84 | 84 | //$input = iconv('CP1251', 'UTF-8', $input); |
| 85 | 85 | |
| 86 | 86 | $input = preg_replace("/\r\n\d\d\d\d\-\d\d\-\d\d\ \d\d\:\d\d/", "[D] $0", $input); |
| 87 | 87 | |
| 88 | -while(strpos($input, "\r\n\r\n") !== false) |
|
| 88 | +while (strpos($input, "\r\n\r\n") !== false) |
|
| 89 | 89 | { |
| 90 | 90 | $input = str_replace("\r\n\r\n", "\r\n", $input); |
| 91 | 91 | } |
| 92 | -while(strpos($input, "~~~") !== false) |
|
| 92 | +while (strpos($input, "~~~") !== false) |
|
| 93 | 93 | { |
| 94 | 94 | $input = str_replace("~~~", "~~", $input); |
| 95 | 95 | } |
| 96 | 96 | $input = str_replace("\r\n~~", "~~", $input); |
| 97 | 97 | |
| 98 | -while(strpos($input, "===") !== false) |
|
| 98 | +while (strpos($input, "===") !== false) |
|
| 99 | 99 | { |
| 100 | 100 | $input = str_replace("===", "==", $input); |
| 101 | 101 | } |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | $prev_chapter_is_header = false; |
| 107 | 107 | $output = array(); |
| 108 | 108 | $buffer = array(); |
| 109 | -foreach($input as &$chapter) |
|
| 109 | +foreach ($input as &$chapter) |
|
| 110 | 110 | { |
| 111 | 111 | $chapter = preg_split("/(\r\n[\[])/", $chapter, -1, PREG_SPLIT_NO_EMPTY); // , PREG_SPLIT_DELIM_CAPTURE |
| 112 | 112 | |
| 113 | - if(count($chapter) == 1 && !$prev_chapter_is_header) |
|
| 113 | + if (count($chapter) == 1 && !$prev_chapter_is_header) |
|
| 114 | 114 | { |
| 115 | - if(!empty($chapter)) |
|
| 115 | + if (!empty($chapter)) |
|
| 116 | 116 | { |
| 117 | 117 | $output[] = $buffer; |
| 118 | 118 | $buffer = array(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | else |
| 124 | 124 | { |
| 125 | 125 | $prev_chapter_is_header = false; |
| 126 | - foreach($chapter as &$note) |
|
| 126 | + foreach ($chapter as &$note) |
|
| 127 | 127 | { |
| 128 | 128 | $note = explode("\r\n", $note); |
| 129 | 129 | $new_note = true; |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $note_out = array(); |
| 133 | 133 | |
| 134 | - foreach($note as &$line) |
|
| 134 | + foreach ($note as &$line) |
|
| 135 | 135 | { |
| 136 | - if(!$line) |
|
| 136 | + if (!$line) |
|
| 137 | 137 | { |
| 138 | 138 | continue; |
| 139 | 139 | } |
| 140 | - if($new_note) |
|
| 140 | + if ($new_note) |
|
| 141 | 141 | { |
| 142 | 142 | // 78 - 3 = 75 |
| 143 | 143 | $note_out['style'] = $line[0]; |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $buf_str .= $line; |
| 148 | - if(mb_strlen($line, 'utf-8') < ($new_note ? 75 : 79)) |
|
| 148 | + if (mb_strlen($line, 'utf-8') < ($new_note ? 75 : 79)) |
|
| 149 | 149 | { |
| 150 | - if(!isset($note_out['name'])) |
|
| 150 | + if (!isset($note_out['name'])) |
|
| 151 | 151 | { |
| 152 | 152 | $note_out['name'] = $buf_str; |
| 153 | 153 | } |
@@ -201,31 +201,31 @@ discard block |
||
| 201 | 201 | 'D' => 'date', |
| 202 | 202 | ); |
| 203 | 203 | |
| 204 | -foreach($output as $chapter) |
|
| 204 | +foreach ($output as $chapter) |
|
| 205 | 205 | { |
| 206 | - if(!$chapter) |
|
| 206 | + if (!$chapter) |
|
| 207 | 207 | { |
| 208 | 208 | continue; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | buf_print("<h1>{$chapter['name']}</h1>\r\n"); |
| 212 | - foreach($chapter['content'] as $block) |
|
| 212 | + foreach ($chapter['content'] as $block) |
|
| 213 | 213 | { |
| 214 | - buf_print("<div class=\"{$styles[$block['style']]}\">" . ($block['style'] != 'D' ? "[{$block['style']}] " : '')); |
|
| 215 | - buf_print(preg_replace("/\s{2,10}/", " ", $block['name']) . '<br />'); |
|
| 216 | - if(isset($block['lines'])) |
|
| 214 | + buf_print("<div class=\"{$styles[$block['style']]}\">".($block['style'] != 'D' ? "[{$block['style']}] " : '')); |
|
| 215 | + buf_print(preg_replace("/\s{2,10}/", " ", $block['name']).'<br />'); |
|
| 216 | + if (isset($block['lines'])) |
|
| 217 | 217 | { |
| 218 | 218 | $last_spaces = ''; |
| 219 | 219 | $depth = array(); |
| 220 | - foreach($block['lines'] as $line) |
|
| 220 | + foreach ($block['lines'] as $line) |
|
| 221 | 221 | { |
| 222 | - if(preg_match("/^(\s+)(\d*|\s)\.*\s*(.*)/", $line, $matches)) |
|
| 222 | + if (preg_match("/^(\s+)(\d*|\s)\.*\s*(.*)/", $line, $matches)) |
|
| 223 | 223 | { |
| 224 | 224 | //$line = strlen($matches[1]) . '/' . $matches[2] . '/' . $matches[3]; |
| 225 | 225 | $line = $matches[3]; |
| 226 | - if(strlen($matches[1]) > strlen($last_spaces)) |
|
| 226 | + if (strlen($matches[1]) > strlen($last_spaces)) |
|
| 227 | 227 | { |
| 228 | - if($matches[2]) |
|
| 228 | + if ($matches[2]) |
|
| 229 | 229 | { |
| 230 | 230 | buf_print("<ol>\r\n"); |
| 231 | 231 | } |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | $last_spaces = $matches[1]; |
| 238 | 238 | $depth[] = $matches[2]; |
| 239 | 239 | } |
| 240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
| 240 | + elseif (strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
| 241 | 241 | { |
| 242 | - if(array_pop($depth)) |
|
| 242 | + if (array_pop($depth)) |
|
| 243 | 243 | { |
| 244 | 244 | buf_print("</ol>\r\n"); |
| 245 | 245 | } |
@@ -250,14 +250,14 @@ discard block |
||
| 250 | 250 | $last_spaces = $matches[1]; |
| 251 | 251 | buf_print('<li>'); |
| 252 | 252 | } |
| 253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
| 253 | + elseif (strlen($last_spaces) == strlen($matches[1])) |
|
| 254 | 254 | { |
| 255 | - if($matches[2] == '' && $depth[count($depth) - 1] != '') |
|
| 255 | + if ($matches[2] == '' && $depth[count($depth) - 1] != '') |
|
| 256 | 256 | { |
| 257 | 257 | buf_print("</ol>\r\n"); |
| 258 | 258 | buf_print("<ul>\r\n"); |
| 259 | 259 | } |
| 260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
| 260 | + elseif ($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
| 261 | 261 | { |
| 262 | 262 | buf_print("</ul>\r\n"); |
| 263 | 263 | buf_print("<ol>\r\n"); |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | $line = preg_replace("/\s{2,10}/", " ", $line); |
| 270 | - buf_print($line . "<br />\r\n"); |
|
| 270 | + buf_print($line."<br />\r\n"); |
|
| 271 | 271 | } |
| 272 | - while(count($depth)) |
|
| 272 | + while (count($depth)) |
|
| 273 | 273 | { |
| 274 | - if(array_pop($depth)) |
|
| 274 | + if (array_pop($depth)) |
|
| 275 | 275 | { |
| 276 | 276 | buf_print("</ol>\r\n"); |
| 277 | 277 | } |
@@ -286,11 +286,11 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | buf_print("</body>\r\n</html>\r\n"); |
| 288 | 288 | |
| 289 | -$html = file_get_contents($path_prefix . 'html/' . $filename . '.html'); |
|
| 290 | -if($html != $output_buffer) |
|
| 289 | +$html = file_get_contents($path_prefix.'html/'.$filename.'.html'); |
|
| 290 | +if ($html != $output_buffer) |
|
| 291 | 291 | { |
| 292 | - file_put_contents($path_prefix . 'html/' . $filename . '.html', $output_buffer); |
|
| 293 | - if(!$path_prefix) |
|
| 292 | + file_put_contents($path_prefix.'html/'.$filename.'.html', $output_buffer); |
|
| 293 | + if (!$path_prefix) |
|
| 294 | 294 | { |
| 295 | 295 | print($output_buffer); |
| 296 | 296 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | $allow_anonymous = true; |
| 16 | -include('includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 16 | +include('includes/init.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 17 | 17 | |
| 18 | 18 | lng_include('overview'); |
| 19 | 19 | |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 4 | 4 | |
| 5 | -if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 5 | +if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 6 | 6 | { |
| 7 | 7 | define('BE_DEBUG', true); |
| 8 | 8 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $sym_defender = $_POST['defender'] ? $_POST['defender'] : array(); |
| 15 | 15 | $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array(); |
| 16 | 16 | |
| 17 | -if($replay) |
|
| 17 | +if ($replay) |
|
| 18 | 18 | { |
| 19 | 19 | $unpacked = sn_ube_simulator_decode_replay($replay); |
| 20 | 20 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $sym_attacker = array(1 => $sym_attacker); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if($_POST['submit'] || $execute) |
|
| 30 | +if ($_POST['submit'] || $execute) |
|
| 31 | 31 | { |
| 32 | 32 | $replay = sn_ube_simulator_encode_replay($sym_defender, 'D'); |
| 33 | 33 | $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A'); |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | $template = gettemplate('simulator', true); |
| 41 | 41 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
| 42 | 42 | |
| 43 | - foreach($techs_and_officers as $tech_id) |
|
| 43 | + foreach ($techs_and_officers as $tech_id) |
|
| 44 | 44 | { |
| 45 | - if(!$sym_attacker[1][$tech_id]) |
|
| 45 | + if (!$sym_attacker[1][$tech_id]) |
|
| 46 | 46 | { |
| 47 | 47 | $sym_attacker[1][$tech_id] = mrc_get_level($user, null, $tech_id); |
| 48 | 48 | } |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | UNIT_GOVERNORS => array(MRC_FORTIFIER), |
| 57 | 57 | UNIT_DEFENCE => sn_get_groups('defense_active'), |
| 58 | 58 | ); |
| 59 | - foreach($show_groups as $unit_group_id => $unit_group) |
|
| 59 | + foreach ($show_groups as $unit_group_id => $unit_group) |
|
| 60 | 60 | { |
| 61 | 61 | $template->assign_block_vars('simulator', array( |
| 62 | 62 | 'GROUP' => $unit_group_id, |
| 63 | 63 | 'NAME' => classLocale::$lang['tech'][$unit_group_id], |
| 64 | 64 | )); |
| 65 | 65 | |
| 66 | - foreach($unit_group as $unit_id) |
|
| 66 | + foreach ($unit_group as $unit_id) |
|
| 67 | 67 | { |
| 68 | 68 | $tab++; |
| 69 | 69 | |
@@ -12,27 +12,27 @@ discard block |
||
| 12 | 12 | define('INSTALL', false); |
| 13 | 13 | define('IN_ADMIN', true); |
| 14 | 14 | |
| 15 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 15 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 16 | 16 | |
| 17 | -if($user['authlevel'] < 3) { |
|
| 17 | +if ($user['authlevel'] < 3) { |
|
| 18 | 18 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -if($delete = sys_get_param_id('delete')) { |
|
| 21 | +if ($delete = sys_get_param_id('delete')) { |
|
| 22 | 22 | db_log_delete_by_id($delete); |
| 23 | -} elseif(sys_get_param_str('delete_update_info')) { |
|
| 23 | +} elseif (sys_get_param_str('delete_update_info')) { |
|
| 24 | 24 | db_log_delete_update_and_stat_calc(); |
| 25 | -} elseif(sys_get_param_str('deleteall') == 'yes') { |
|
| 25 | +} elseif (sys_get_param_str('deleteall') == 'yes') { |
|
| 26 | 26 | // doquery("TRUNCATE TABLE `{{logs}}`"); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if($detail = sys_get_param_id('detail')) { |
|
| 29 | +if ($detail = sys_get_param_id('detail')) { |
|
| 30 | 30 | $template = gettemplate('admin/adm_log_main_detail', true); |
| 31 | 31 | |
| 32 | 32 | $errorInfo = db_log_get_by_id($detail); |
| 33 | 33 | $error_dump = unserialize($errorInfo['log_dump']); |
| 34 | - if(is_array($error_dump)) { |
|
| 35 | - foreach($error_dump as $key => $value) { |
|
| 34 | + if (is_array($error_dump)) { |
|
| 35 | + foreach ($error_dump as $key => $value) { |
|
| 36 | 36 | $v = array( |
| 37 | 37 | 'VAR_NAME' => $key, |
| 38 | 38 | 'VAR_VALUE' => $key == 'query_log' ? $value : dump($value, $key) |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $i = 0; |
| 49 | 49 | $query = db_log_list_get_last_100(); |
| 50 | - while($u = db_fetch($query)) { |
|
| 50 | + while ($u = db_fetch($query)) { |
|
| 51 | 51 | $i++; |
| 52 | 52 | $v = array(); |
| 53 | - foreach($u as $key => $value) { |
|
| 53 | + foreach ($u as $key => $value) { |
|
| 54 | 54 | $v[strtoupper($key)] = $value; |
| 55 | 55 | } |
| 56 | 56 | $template->assign_block_vars('error', $v); |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | define('INSTALL', false); |
| 15 | 15 | define('IN_ADMIN', true); |
| 16 | 16 | |
| 17 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 17 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 18 | 18 | |
| 19 | -if($user['authlevel'] < 1) { |
|
| 19 | +if ($user['authlevel'] < 1) { |
|
| 20 | 20 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | $template = gettemplate("admin/admin_ban", true); |
| 29 | 29 | |
| 30 | 30 | $player_banned_row = db_user_by_username($name_unsafe); |
| 31 | -if($mode == 'banit' && $action) { |
|
| 32 | - if($player_banned_row) { |
|
| 31 | +if ($mode == 'banit' && $action) { |
|
| 32 | + if ($player_banned_row) { |
|
| 33 | 33 | $reas = $_POST['why']; |
| 34 | 34 | $days = $_POST['days']; |
| 35 | 35 | $hour = $_POST['hour']; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $adm_bn_thpl = classLocale::$lang['adm_bn_thpl']; |
| 50 | 50 | $DoneMessage = "{$adm_bn_thpl} {$name_output} {$adm_bn_isbn}"; |
| 51 | 51 | |
| 52 | - if($is_vacation) { |
|
| 52 | + if ($is_vacation) { |
|
| 53 | 53 | $DoneMessage .= classLocale::$lang['adm_bn_vctn']; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | AdminMessage($DoneMessage, classLocale::$lang['adm_ban_title']); |
| 62 | -} elseif($mode == 'unbanit' && $action) { |
|
| 62 | +} elseif ($mode == 'unbanit' && $action) { |
|
| 63 | 63 | sys_admin_player_ban_unset($user, $player_banned_row, ($reason = sys_get_param_str('why')) ? $reason : classLocale::$lang['sys_unbanned']); |
| 64 | 64 | |
| 65 | - $DoneMessage = classLocale::$lang['adm_unbn_thpl'] . " " . $name_output . " " . classLocale::$lang['adm_unbn_isbn']; |
|
| 65 | + $DoneMessage = classLocale::$lang['adm_unbn_thpl']." ".$name_output." ".classLocale::$lang['adm_unbn_isbn']; |
|
| 66 | 66 | AdminMessage($DoneMessage, classLocale::$lang['adm_unbn_ttle']); |
| 67 | 67 | }; |
| 68 | 68 | |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | define('INSTALL', false); |
| 13 | 13 | define('IN_ADMIN', true); |
| 14 | 14 | |
| 15 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 15 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 16 | 16 | |
| 17 | -if($user['authlevel'] < 3) { |
|
| 17 | +if ($user['authlevel'] < 3) { |
|
| 18 | 18 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | $query = db_payment_list_payers(); |
| 28 | -while($row = db_fetch($query)) { |
|
| 29 | - $payer_list[$row['payment_user_id']] = '[' . $row['payment_user_id'] . '] ' . $row['payment_user_name']; |
|
| 28 | +while ($row = db_fetch($query)) { |
|
| 29 | + $payer_list[$row['payment_user_id']] = '['.$row['payment_user_id'].'] '.$row['payment_user_name']; |
|
| 30 | 30 | } |
| 31 | 31 | tpl_assign_select($template, 'payer', $payer_list); |
| 32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | $query = db_payment_list_modules(); |
| 38 | -while($row = db_fetch($query)) { |
|
| 38 | +while ($row = db_fetch($query)) { |
|
| 39 | 39 | $module_list[$row['payment_module_name']] = $row['payment_module_name']; |
| 40 | 40 | } |
| 41 | 41 | tpl_assign_select($template, 'module', $module_list); |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $query = db_payment_list_get($flt_payer, $flt_status, $flt_test, $flt_module); |
| 52 | 52 | |
| 53 | -while($row = db_fetch($query)) { |
|
| 53 | +while ($row = db_fetch($query)) { |
|
| 54 | 54 | $row2 = array(); |
| 55 | - foreach($row as $key => $value) { |
|
| 55 | + foreach ($row as $key => $value) { |
|
| 56 | 56 | $row2[strtoupper($key)] = $value; |
| 57 | 57 | } |
| 58 | 58 | $template->assign_block_vars('payment', $row2); |
@@ -9,18 +9,18 @@ |
||
| 9 | 9 | * @copyright 2008 by Chlorel for XNova |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -define('INSIDE' , true); |
|
| 13 | -define('INSTALL' , false); |
|
| 12 | +define('INSIDE', true); |
|
| 13 | +define('INSTALL', false); |
|
| 14 | 14 | define('IN_ADMIN', true); |
| 15 | -require_once('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 15 | +require_once('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 16 | 16 | |
| 17 | 17 | // if($user['authlevel'] < 1) |
| 18 | -if($user['authlevel'] < 3) |
|
| 18 | +if ($user['authlevel'] < 3) |
|
| 19 | 19 | { |
| 20 | 20 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -if(SN_TIME_NOW >= classSupernova::$config->db_loadAll('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadAll('var_stat_update_end')) |
|
| 23 | +if (SN_TIME_NOW >= classSupernova::$config->db_loadAll('var_stat_update_admin_forced') && SN_TIME_NOW >= classSupernova::$config->db_loadAll('var_stat_update_end')) |
|
| 24 | 24 | { |
| 25 | 25 | classSupernova::$config->db_saveItem('var_stat_update_admin_forced', SN_TIME_NOW + 120); |
| 26 | 26 | |
@@ -4,16 +4,16 @@ discard block |
||
| 4 | 4 | define('INSTALL', false); |
| 5 | 5 | define('IN_ADMIN', true); |
| 6 | 6 | |
| 7 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 7 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 8 | 8 | |
| 9 | 9 | // if($user['authlevel'] < 2) |
| 10 | -if($user['authlevel'] < 3) |
|
| 10 | +if ($user['authlevel'] < 3) |
|
| 11 | 11 | { |
| 12 | 12 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 13 | 13 | } |
| 14 | 14 | AdminMessage('Временно не работает'); |
| 15 | 15 | |
| 16 | -require("includes/admin_planet_edit.inc" . DOT_PHP_EX); |
|
| 16 | +require("includes/admin_planet_edit.inc".DOT_PHP_EX); |
|
| 17 | 17 | |
| 18 | 18 | $template = gettemplate('admin/admin_planet_edit', true); |
| 19 | 19 | |
@@ -21,30 +21,30 @@ discard block |
||
| 21 | 21 | $planet_id = sys_get_param_id('planet_id'); |
| 22 | 22 | |
| 23 | 23 | $unit_list = sys_get_param('unit_list'); |
| 24 | -if(sys_get_param('change_data') && !empty($unit_list)) |
|
| 24 | +if (sys_get_param('change_data') && !empty($unit_list)) |
|
| 25 | 25 | { |
| 26 | 26 | $query_string = array(); |
| 27 | - foreach($unit_list as $unit_id => $unit_amount) |
|
| 27 | + foreach ($unit_list as $unit_id => $unit_amount) |
|
| 28 | 28 | { |
| 29 | - if($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) |
|
| 29 | + if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) |
|
| 30 | 30 | { |
| 31 | 31 | $query_string[] = $unit_query_string; |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if(!empty($query_string)) |
|
| 35 | + if (!empty($query_string)) |
|
| 36 | 36 | { |
| 37 | 37 | db_planet_set_by_id($planet_id, implode(', ', $query_string)); |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -if($planet_id) |
|
| 41 | +if ($planet_id) |
|
| 42 | 42 | { |
| 43 | 43 | $edit_planet_row = db_planet_by_id($planet_id); |
| 44 | 44 | admin_planet_edit_template($template, $edit_planet_row, $mode); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -foreach($admin_planet_edit_mode_list as $page_mode => $mode_locale) |
|
| 47 | +foreach ($admin_planet_edit_mode_list as $page_mode => $mode_locale) |
|
| 48 | 48 | { |
| 49 | 49 | $template->assign_block_vars('page_menu', array( |
| 50 | 50 | 'ID' => $page_mode, |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $template->assign_vars(array( |
| 56 | 56 | 'MODE' => $mode, |
| 57 | 57 | 'PLANET_ID' => $planet_id, |
| 58 | - 'PLANET_NAME' => empty($edit_planet_row) ? '' : classLocale::$lang['sys_planet_type'][$edit_planet_row['planet_type']] . ' ' . uni_render_planet($edit_planet_row), |
|
| 58 | + 'PLANET_NAME' => empty($edit_planet_row) ? '' : classLocale::$lang['sys_planet_type'][$edit_planet_row['planet_type']].' '.uni_render_planet($edit_planet_row), |
|
| 59 | 59 | 'PAGE_HINT' => classLocale::$lang['adm_planet_edit_hint'], |
| 60 | 60 | )); |
| 61 | 61 | |
@@ -1,11 +1,11 @@ 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 | -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 | { |
| 10 | 10 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 11 | 11 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $username_unsafe = sys_get_param_str_unsafe('username'); |
| 26 | 26 | $username = sys_get_param_escaped('username'); |
| 27 | 27 | |
| 28 | -if($galaxy_src) |
|
| 28 | +if ($galaxy_src) |
|
| 29 | 29 | { |
| 30 | 30 | sn_db_transaction_start(); |
| 31 | 31 | $errors = array(); |
@@ -35,41 +35,41 @@ discard block |
||
| 35 | 35 | $planet = sys_o_get_updated($owner, array('galaxy' => $galaxy_src, 'system' => $system_src, 'planet' => $planet_src, 'planet_type' => 1), SN_TIME_NOW); |
| 36 | 36 | $que = $planet['que']; |
| 37 | 37 | $planet = $planet['planet']; |
| 38 | - if(!$planet) |
|
| 38 | + if (!$planet) |
|
| 39 | 39 | { |
| 40 | 40 | $errors[] = classLocale::$lang['adm_pl_comp_err_0']; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if($planet['destruyed']) |
|
| 43 | + if ($planet['destruyed']) |
|
| 44 | 44 | { |
| 45 | 45 | $errors[] = classLocale::$lang['adm_pl_comp_err_1']; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if($planet['id_owner'] != $owner['id'] || !$username) |
|
| 48 | + if ($planet['id_owner'] != $owner['id'] || !$username) |
|
| 49 | 49 | { |
| 50 | 50 | $errors[] = classLocale::$lang['adm_pl_comp_err_4']; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $destination = sys_o_get_updated($owner, array('galaxy' => $galaxy_dst, 'system' => $system_dst, 'planet' => $planet_dst, 'planet_type' => 1), SN_TIME_NOW); |
| 54 | 54 | $destination = $destination['planet']; |
| 55 | - if(!$destination) |
|
| 55 | + if (!$destination) |
|
| 56 | 56 | { |
| 57 | 57 | $errors[] = classLocale::$lang['adm_pl_comp_err_2']; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if($planet['id'] == $destination['id']) |
|
| 60 | + if ($planet['id'] == $destination['id']) |
|
| 61 | 61 | { |
| 62 | 62 | $errors[] = classLocale::$lang['adm_pl_comp_err_5']; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if($planet['id_owner'] != $destination['id_owner']) |
|
| 65 | + if ($planet['id_owner'] != $destination['id_owner']) |
|
| 66 | 66 | { |
| 67 | 67 | $errors[] = classLocale::$lang['adm_pl_comp_err_3']; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if(!empty($errors)) |
|
| 70 | + if (!empty($errors)) |
|
| 71 | 71 | { |
| 72 | - foreach($errors as $error) |
|
| 72 | + foreach ($errors as $error) |
|
| 73 | 73 | { |
| 74 | 74 | $template->assign_block_vars('error', array( |
| 75 | 75 | 'TEXT' => $error, |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | killer_add_planet($planet); |
| 84 | 84 | |
| 85 | 85 | $moon = db_planet_by_gspt($galaxy_src, $system_src, $planet_src, PT_MOON, true); |
| 86 | - if($moon) |
|
| 86 | + if ($moon) |
|
| 87 | 87 | { |
| 88 | 88 | $moon = sys_o_get_updated($owner, $moon, SN_TIME_NOW); |
| 89 | 89 | $moon = $moon['planet']; |
| 90 | 90 | killer_add_planet($moon); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - foreach(sn_get_groups('resources_loot') as $resource_id) |
|
| 93 | + foreach (sn_get_groups('resources_loot') as $resource_id) |
|
| 94 | 94 | { |
| 95 | 95 | $resource_name = pname_resource_name($resource_id); |
| 96 | 96 | $template->assign_var("{$resource_name}_cost", $final_cost[$resource_id]); |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | $template->assign_var("{$resource_name}_bonus", $final_cost[$resource_id]); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if($_GET['btn_confirm']) |
|
| 101 | + if ($_GET['btn_confirm']) |
|
| 102 | 102 | { |
| 103 | 103 | $time = SN_TIME_NOW + PERIOD_DAY; |
| 104 | 104 | |
| 105 | 105 | db_unit_list_delete($planet['id_owner'], LOC_PLANET, $planet['id']); |
| 106 | 106 | db_planet_set_by_id($planet['id'], "id_owner = 0, destruyed = {$time}"); |
| 107 | - if($moon) |
|
| 107 | + if ($moon) |
|
| 108 | 108 | { |
| 109 | 109 | db_unit_list_delete($planet['id_owner'], LOC_PLANET, $moon['id']); |
| 110 | 110 | db_planet_set_by_id($moon['id'], "id_owner = 0, destruyed = {$time}"); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | 'username' => $username, |
| 132 | 132 | )); |
| 133 | 133 | |
| 134 | -display(parsetemplate($template), classLocale::$lang['adm_pl_comp_title'], false, '', true ); |
|
| 134 | +display(parsetemplate($template), classLocale::$lang['adm_pl_comp_title'], false, '', true); |
|
| 135 | 135 | |
| 136 | 136 | function killer_add_planet($planet) |
| 137 | 137 | { |
@@ -146,34 +146,34 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | */ |
| 148 | 148 | |
| 149 | - foreach(sn_get_groups('structures') as $unit_id) |
|
| 149 | + foreach (sn_get_groups('structures') as $unit_id) |
|
| 150 | 150 | { |
| 151 | 151 | $build_level = mrc_get_level($user, $planet, $unit_id, true, true); |
| 152 | - if($build_level > 0) |
|
| 152 | + if ($build_level > 0) |
|
| 153 | 153 | { |
| 154 | 154 | $unit_cost = get_unit_param($unit_id, 'cost'); |
| 155 | 155 | $build_factor = $unit_cost['factor'] != 1 ? (1 - pow($unit_cost['factor'], $build_level)) / (1 - $unit_cost['factor']) : $unit_cost['factor']; |
| 156 | - foreach($sn_group_resources_loot as $resource_id) |
|
| 156 | + foreach ($sn_group_resources_loot as $resource_id) |
|
| 157 | 157 | { |
| 158 | 158 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $build_factor) : 0; |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - foreach(sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
| 163 | + foreach (sn_get_groups(array('defense', 'fleet')) as $unit_id) |
|
| 164 | 164 | { |
| 165 | 165 | $unit_count = mrc_get_level($user, $planet, $unit_id, true, true); |
| 166 | - if($unit_count > 0) |
|
| 166 | + if ($unit_count > 0) |
|
| 167 | 167 | { |
| 168 | 168 | $unit_cost = get_unit_param($unit_id, 'cost'); |
| 169 | - foreach($sn_group_resources_loot as $resource_id) |
|
| 169 | + foreach ($sn_group_resources_loot as $resource_id) |
|
| 170 | 170 | { |
| 171 | 171 | $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $unit_count) : 0; |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - foreach($sn_group_resources_loot as $resource_id) |
|
| 176 | + foreach ($sn_group_resources_loot as $resource_id) |
|
| 177 | 177 | { |
| 178 | 178 | $final_cost[$resource_id] += floor(mrc_get_level($user, $planet, $resource_id, true, true)); |
| 179 | 179 | } |