@@ -582,9 +582,9 @@ discard block |
||
| 582 | 582 | 2 => 0.01, |
| 583 | 583 | ), |
| 584 | 584 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 585 | - [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2,], |
|
| 586 | - [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1,], |
|
| 587 | - [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0,], |
|
| 585 | + [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2, ], |
|
| 586 | + [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1, ], |
|
| 587 | + [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0, ], |
|
| 588 | 588 | ], |
| 589 | 589 | ), |
| 590 | 590 | FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES => array( |
@@ -596,9 +596,9 @@ discard block |
||
| 596 | 596 | 2 => 0.025, |
| 597 | 597 | ), |
| 598 | 598 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 599 | - [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2,], |
|
| 600 | - [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1,], |
|
| 601 | - [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0,], |
|
| 599 | + [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2, ], |
|
| 600 | + [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1, ], |
|
| 601 | + [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0, ], |
|
| 602 | 602 | ], |
| 603 | 603 | ), |
| 604 | 604 | FLT_EXPEDITION_OUTCOME_FOUND_DM => array( |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | UNIT_PLANS => 'plans', |
| 1266 | 1266 | ], |
| 1267 | 1267 | |
| 1268 | - GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet',], |
|
| 1268 | + GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet', ], |
|
| 1269 | 1269 | |
| 1270 | 1270 | ), |
| 1271 | 1271 | ); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | renderFooter(); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;; |
|
| 320 | + $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ; |
|
| 321 | 321 | |
| 322 | 322 | sn_db_disconnect(); |
| 323 | 323 | |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | } |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | -SN::$afterInit[] = function () { |
|
| 632 | +SN::$afterInit[] = function() { |
|
| 633 | 633 | SN::$gc->pimp->add()->tpl_render_topnav($t = 'sn_tpl_render_topnav', [], null); |
| 634 | 634 | }; |
| 635 | 635 | |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | 'QUE_ID' => QUE_RESEARCH, |
| 701 | 701 | 'QUE_HTML' => 'topnav', |
| 702 | 702 | |
| 703 | - 'RESEARCH_ONGOING' => (boolean)$user['que'], |
|
| 703 | + 'RESEARCH_ONGOING' => (boolean) $user['que'], |
|
| 704 | 704 | |
| 705 | 705 | 'TIME_TEXT' => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'], |
| 706 | 706 | $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds'] |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | 'LANG' => $language ? $language : '', |
| 995 | 995 | 'referral' => $id_ref ? '&id_ref=' . $id_ref : '', |
| 996 | 996 | |
| 997 | - 'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''), |
|
| 997 | + 'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''), |
|
| 998 | 998 | 'FILENAME' => basename($_SERVER['PHP_SELF']), |
| 999 | 999 | )); |
| 1000 | 1000 | |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Load template source from file |
|
| 59 | - * @access private |
|
| 60 | - */ |
|
| 58 | + * Load template source from file |
|
| 59 | + * @access private |
|
| 60 | + */ |
|
| 61 | 61 | function _tpl_load_file($handle, $store_in_db = false) |
| 62 | 62 | { |
| 63 | 63 | // Try and open template for read |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 104 | - * the ones that exist in zend_language_scanner.l |
|
| 105 | - * @access private |
|
| 106 | - */ |
|
| 103 | + * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 104 | + * the ones that exist in zend_language_scanner.l |
|
| 105 | + * @access private |
|
| 106 | + */ |
|
| 107 | 107 | function remove_php_tags(&$code) |
| 108 | 108 | { |
| 109 | 109 | // This matches the information gathered from the internal PHP lexer |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | - * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 121 | - * @access private |
|
| 122 | - */ |
|
| 120 | + * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 121 | + * @access private |
|
| 122 | + */ |
|
| 123 | 123 | function compile($code, $no_echo = false, $echo_var = '') |
| 124 | 124 | { |
| 125 | 125 | if ($echo_var) |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | - * Compile variables |
|
| 292 | - * @access private |
|
| 293 | - */ |
|
| 291 | + * Compile variables |
|
| 292 | + * @access private |
|
| 293 | + */ |
|
| 294 | 294 | function compile_var_tags(&$text_blocks) |
| 295 | 295 | { |
| 296 | 296 | // including $lang variable |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
| 366 | - * Compile blocks |
|
| 367 | - * @access private |
|
| 368 | - */ |
|
| 366 | + * Compile blocks |
|
| 367 | + * @access private |
|
| 368 | + */ |
|
| 369 | 369 | function compile_tag_block($tag_args) |
| 370 | 370 | { |
| 371 | 371 | $no_nesting = false; |
@@ -451,14 +451,14 @@ discard block |
||
| 451 | 451 | $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; |
| 452 | 452 | |
| 453 | 453 | /** |
| 454 | - * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory |
|
| 455 | - * <code> |
|
| 456 | - * if (!$offset) |
|
| 457 | - * { |
|
| 458 | - * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 459 | - * } |
|
| 460 | - * </code> |
|
| 461 | - */ |
|
| 454 | + * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory |
|
| 455 | + * <code> |
|
| 456 | + * if (!$offset) |
|
| 457 | + * { |
|
| 458 | + * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 459 | + * } |
|
| 460 | + * </code> |
|
| 461 | + */ |
|
| 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;'; |
@@ -469,10 +469,10 @@ discard block |
||
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | /** |
| 472 | - * Compile IF tags - much of this is from Smarty with |
|
| 473 | - * some adaptions for our block level methods |
|
| 474 | - * @access private |
|
| 475 | - */ |
|
| 472 | + * Compile IF tags - much of this is from Smarty with |
|
| 473 | + * some adaptions for our block level methods |
|
| 474 | + * @access private |
|
| 475 | + */ |
|
| 476 | 476 | function compile_tag_if($tag_args, $elseif) |
| 477 | 477 | { |
| 478 | 478 | // Tokenize args for 'if' tag. |
@@ -627,9 +627,9 @@ discard block |
||
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | /** |
| 630 | - * Compile DEFINE tags |
|
| 631 | - * @access private |
|
| 632 | - */ |
|
| 630 | + * Compile DEFINE tags |
|
| 631 | + * @access private |
|
| 632 | + */ |
|
| 633 | 633 | function compile_tag_define($tag_args, $op) |
| 634 | 634 | { |
| 635 | 635 | preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); |
@@ -680,9 +680,9 @@ discard block |
||
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /** |
| 683 | - * Compile INCLUDE tag |
|
| 684 | - * @access private |
|
| 685 | - */ |
|
| 683 | + * Compile INCLUDE tag |
|
| 684 | + * @access private |
|
| 685 | + */ |
|
| 686 | 686 | function compile_tag_include($tag_args) |
| 687 | 687 | { |
| 688 | 688 | // Process dynamic includes |
@@ -695,19 +695,19 @@ discard block |
||
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | /** |
| 698 | - * Compile INCLUDE_PHP tag |
|
| 699 | - * @access private |
|
| 700 | - */ |
|
| 698 | + * Compile INCLUDE_PHP tag |
|
| 699 | + * @access private |
|
| 700 | + */ |
|
| 701 | 701 | function compile_tag_include_php($tag_args) |
| 702 | 702 | { |
| 703 | 703 | return "\$this->_php_include('$tag_args');"; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | /** |
| 707 | - * parse expression |
|
| 708 | - * This is from Smarty |
|
| 709 | - * @access private |
|
| 710 | - */ |
|
| 707 | + * parse expression |
|
| 708 | + * This is from Smarty |
|
| 709 | + * @access private |
|
| 710 | + */ |
|
| 711 | 711 | function _parse_is_expr($is_arg, $tokens) |
| 712 | 712 | { |
| 713 | 713 | $expr_end = 0; |
@@ -800,14 +800,14 @@ discard block |
||
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | /** |
| 803 | - * Generates a reference to the array of data values for the given |
|
| 804 | - * (possibly nested) block namespace. This is a string of the form: |
|
| 805 | - * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 806 | - * |
|
| 807 | - * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 808 | - * NOTE: does not expect a trailing "." on the blockname. |
|
| 809 | - * @access private |
|
| 810 | - */ |
|
| 803 | + * Generates a reference to the array of data values for the given |
|
| 804 | + * (possibly nested) block namespace. This is a string of the form: |
|
| 805 | + * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 806 | + * |
|
| 807 | + * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 808 | + * NOTE: does not expect a trailing "." on the blockname. |
|
| 809 | + * @access private |
|
| 810 | + */ |
|
| 811 | 811 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
| 812 | 812 | { |
| 813 | 813 | // Get an array of the blocks involved. |
@@ -843,9 +843,9 @@ discard block |
||
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | /** |
| 846 | - * Write compiled file to cache directory |
|
| 847 | - * @access private |
|
| 848 | - */ |
|
| 846 | + * Write compiled file to cache directory |
|
| 847 | + * @access private |
|
| 848 | + */ |
|
| 849 | 849 | function compile_write($handle, $data) |
| 850 | 850 | { |
| 851 | 851 | $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX; |
@@ -868,9 +868,9 @@ discard block |
||
| 868 | 868 | |
| 869 | 869 | // Gorlum's minifier BOF |
| 870 | 870 | /** |
| 871 | - * Minifies template w/i PHP code by removing extra spaces |
|
| 872 | - * @access private |
|
| 873 | - */ |
|
| 871 | + * Minifies template w/i PHP code by removing extra spaces |
|
| 872 | + * @access private |
|
| 873 | + */ |
|
| 874 | 874 | function minify($html) |
| 875 | 875 | { |
| 876 | 876 | if(!SN::$config->tpl_minifier) |
@@ -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 = []; |