@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | var $block_else_level = array(); |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * constuctor |
|
| 50 | - */ |
|
| 49 | + * constuctor |
|
| 50 | + */ |
|
| 51 | 51 | function template_compile(&$template) |
| 52 | 52 | { |
| 53 | 53 | $this->template = &$template; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Load template source from file |
|
| 58 | - * @access private |
|
| 59 | - */ |
|
| 57 | + * Load template source from file |
|
| 58 | + * @access private |
|
| 59 | + */ |
|
| 60 | 60 | function _tpl_load_file($handle, $store_in_db = false) |
| 61 | 61 | { |
| 62 | 62 | // Try and open template for read |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 103 | - * the ones that exist in zend_language_scanner.l |
|
| 104 | - * @access private |
|
| 105 | - */ |
|
| 102 | + * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 103 | + * the ones that exist in zend_language_scanner.l |
|
| 104 | + * @access private |
|
| 105 | + */ |
|
| 106 | 106 | function remove_php_tags(&$code) |
| 107 | 107 | { |
| 108 | 108 | // This matches the information gathered from the internal PHP lexer |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 120 | - * @access private |
|
| 121 | - */ |
|
| 119 | + * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 120 | + * @access private |
|
| 121 | + */ |
|
| 122 | 122 | function compile($code, $no_echo = false, $echo_var = '') |
| 123 | 123 | { |
| 124 | 124 | global $config; |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Compile variables |
|
| 293 | - * @access private |
|
| 294 | - */ |
|
| 292 | + * Compile variables |
|
| 293 | + * @access private |
|
| 294 | + */ |
|
| 295 | 295 | function compile_var_tags(&$text_blocks) |
| 296 | 296 | { |
| 297 | 297 | // including $lang variable |
@@ -354,9 +354,9 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
| 357 | - * Compile blocks |
|
| 358 | - * @access private |
|
| 359 | - */ |
|
| 357 | + * Compile blocks |
|
| 358 | + * @access private |
|
| 359 | + */ |
|
| 360 | 360 | function compile_tag_block($tag_args) |
| 361 | 361 | { |
| 362 | 362 | $no_nesting = false; |
@@ -442,14 +442,14 @@ discard block |
||
| 442 | 442 | $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; |
| 443 | 443 | |
| 444 | 444 | /** |
| 445 | - * 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 |
|
| 446 | - * <code> |
|
| 447 | - * if (!$offset) |
|
| 448 | - * { |
|
| 449 | - * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 450 | - * } |
|
| 451 | - * </code> |
|
| 452 | - */ |
|
| 445 | + * 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 |
|
| 446 | + * <code> |
|
| 447 | + * if (!$offset) |
|
| 448 | + * { |
|
| 449 | + * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 450 | + * } |
|
| 451 | + * </code> |
|
| 452 | + */ |
|
| 453 | 453 | |
| 454 | 454 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
| 455 | 455 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
@@ -460,10 +460,10 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
| 463 | - * Compile IF tags - much of this is from Smarty with |
|
| 464 | - * some adaptions for our block level methods |
|
| 465 | - * @access private |
|
| 466 | - */ |
|
| 463 | + * Compile IF tags - much of this is from Smarty with |
|
| 464 | + * some adaptions for our block level methods |
|
| 465 | + * @access private |
|
| 466 | + */ |
|
| 467 | 467 | function compile_tag_if($tag_args, $elseif) |
| 468 | 468 | { |
| 469 | 469 | // Tokenize args for 'if' tag. |
@@ -618,9 +618,9 @@ discard block |
||
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | /** |
| 621 | - * Compile DEFINE tags |
|
| 622 | - * @access private |
|
| 623 | - */ |
|
| 621 | + * Compile DEFINE tags |
|
| 622 | + * @access private |
|
| 623 | + */ |
|
| 624 | 624 | function compile_tag_define($tag_args, $op) |
| 625 | 625 | { |
| 626 | 626 | preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); |
@@ -671,9 +671,9 @@ discard block |
||
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | /** |
| 674 | - * Compile INCLUDE tag |
|
| 675 | - * @access private |
|
| 676 | - */ |
|
| 674 | + * Compile INCLUDE tag |
|
| 675 | + * @access private |
|
| 676 | + */ |
|
| 677 | 677 | function compile_tag_include($tag_args) |
| 678 | 678 | { |
| 679 | 679 | // Process dynamic includes |
@@ -686,19 +686,19 @@ discard block |
||
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /** |
| 689 | - * Compile INCLUDE_PHP tag |
|
| 690 | - * @access private |
|
| 691 | - */ |
|
| 689 | + * Compile INCLUDE_PHP tag |
|
| 690 | + * @access private |
|
| 691 | + */ |
|
| 692 | 692 | function compile_tag_include_php($tag_args) |
| 693 | 693 | { |
| 694 | 694 | return "\$this->_php_include('$tag_args');"; |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | /** |
| 698 | - * parse expression |
|
| 699 | - * This is from Smarty |
|
| 700 | - * @access private |
|
| 701 | - */ |
|
| 698 | + * parse expression |
|
| 699 | + * This is from Smarty |
|
| 700 | + * @access private |
|
| 701 | + */ |
|
| 702 | 702 | function _parse_is_expr($is_arg, $tokens) |
| 703 | 703 | { |
| 704 | 704 | $expr_end = 0; |
@@ -763,13 +763,13 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | /** |
| 766 | - * Generates a reference to the given variable inside the given (possibly nested) |
|
| 767 | - * block namespace. This is a string of the form: |
|
| 768 | - * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' |
|
| 769 | - * It's ready to be inserted into an "echo" line in one of the templates. |
|
| 770 | - * NOTE: expects a trailing "." on the namespace. |
|
| 771 | - * @access private |
|
| 772 | - */ |
|
| 766 | + * Generates a reference to the given variable inside the given (possibly nested) |
|
| 767 | + * block namespace. This is a string of the form: |
|
| 768 | + * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' |
|
| 769 | + * It's ready to be inserted into an "echo" line in one of the templates. |
|
| 770 | + * NOTE: expects a trailing "." on the namespace. |
|
| 771 | + * @access private |
|
| 772 | + */ |
|
| 773 | 773 | function generate_block_varref($namespace, $varname, $echo = true, $defop = false) |
| 774 | 774 | { |
| 775 | 775 | // Strip the trailing period. |
@@ -787,14 +787,14 @@ discard block |
||
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | /** |
| 790 | - * Generates a reference to the array of data values for the given |
|
| 791 | - * (possibly nested) block namespace. This is a string of the form: |
|
| 792 | - * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 793 | - * |
|
| 794 | - * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 795 | - * NOTE: does not expect a trailing "." on the blockname. |
|
| 796 | - * @access private |
|
| 797 | - */ |
|
| 790 | + * Generates a reference to the array of data values for the given |
|
| 791 | + * (possibly nested) block namespace. This is a string of the form: |
|
| 792 | + * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 793 | + * |
|
| 794 | + * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 795 | + * NOTE: does not expect a trailing "." on the blockname. |
|
| 796 | + * @access private |
|
| 797 | + */ |
|
| 798 | 798 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
| 799 | 799 | { |
| 800 | 800 | // Get an array of the blocks involved. |
@@ -830,9 +830,9 @@ discard block |
||
| 830 | 830 | } |
| 831 | 831 | |
| 832 | 832 | /** |
| 833 | - * Write compiled file to cache directory |
|
| 834 | - * @access private |
|
| 835 | - */ |
|
| 833 | + * Write compiled file to cache directory |
|
| 834 | + * @access private |
|
| 835 | + */ |
|
| 836 | 836 | function compile_write($handle, $data) |
| 837 | 837 | { |
| 838 | 838 | $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX; |
@@ -855,9 +855,9 @@ discard block |
||
| 855 | 855 | |
| 856 | 856 | // Gorlum's minifier BOF |
| 857 | 857 | /** |
| 858 | - * Minifies template w/i PHP code by removing extra spaces |
|
| 859 | - * @access private |
|
| 860 | - */ |
|
| 858 | + * Minifies template w/i PHP code by removing extra spaces |
|
| 859 | + * @access private |
|
| 860 | + */ |
|
| 861 | 861 | function minify($html) |
| 862 | 862 | { |
| 863 | 863 | global $config; |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | class template |
| 26 | 26 | { |
| 27 | 27 | /** variable that holds all the data we'll be substituting into |
| 28 | - * the compiled templates. Takes form: |
|
| 29 | - * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value |
|
| 30 | - * if it's a root-level variable, it'll be like this: |
|
| 31 | - * --> $this->_tpldata[.][0][varname] == value |
|
| 32 | - */ |
|
| 28 | + * the compiled templates. Takes form: |
|
| 29 | + * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value |
|
| 30 | + * if it's a root-level variable, it'll be like this: |
|
| 31 | + * --> $this->_tpldata[.][0][varname] == value |
|
| 32 | + */ |
|
| 33 | 33 | var $_tpldata = array('.' => array(0 => array())); |
| 34 | 34 | var $_rootref; |
| 35 | 35 | // var $_block_counter = array(); |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | var $parsed = false; |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * Set template location |
|
| 64 | - * @access public |
|
| 65 | - */ |
|
| 63 | + * Set template location |
|
| 64 | + * @access public |
|
| 65 | + */ |
|
| 66 | 66 | function set_template() |
| 67 | 67 | { |
| 68 | 68 | global $phpbb_root_path, $user; |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * Set custom template location (able to use directory outside of phpBB) |
|
| 105 | - * @access public |
|
| 106 | - */ |
|
| 104 | + * Set custom template location (able to use directory outside of phpBB) |
|
| 105 | + * @access public |
|
| 106 | + */ |
|
| 107 | 107 | function set_custom_template($template_path, $template_name, $fallback_template_path = false) |
| 108 | 108 | { |
| 109 | 109 | global $phpbb_root_path, $user; |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | - * Sets the template filenames for handles. $filename_array |
|
| 146 | - * should be a hash of handle => filename pairs. |
|
| 147 | - * @access public |
|
| 148 | - */ |
|
| 145 | + * Sets the template filenames for handles. $filename_array |
|
| 146 | + * should be a hash of handle => filename pairs. |
|
| 147 | + * @access public |
|
| 148 | + */ |
|
| 149 | 149 | function set_filenames($filename_array) |
| 150 | 150 | { |
| 151 | 151 | if (!is_array($filename_array)) |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
| 175 | - * Destroy template data set |
|
| 176 | - * @access public |
|
| 177 | - */ |
|
| 175 | + * Destroy template data set |
|
| 176 | + * @access public |
|
| 177 | + */ |
|
| 178 | 178 | function destroy() |
| 179 | 179 | { |
| 180 | 180 | $this->_tpldata = array('.' => array(0 => array())); |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * Reset/empty complete block |
|
| 186 | - * @access public |
|
| 187 | - */ |
|
| 185 | + * Reset/empty complete block |
|
| 186 | + * @access public |
|
| 187 | + */ |
|
| 188 | 188 | function destroy_block_vars($blockname) |
| 189 | 189 | { |
| 190 | 190 | if (strpos($blockname, '.') !== false) |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | - * Display handle |
|
| 216 | - * @access public |
|
| 217 | - */ |
|
| 215 | + * Display handle |
|
| 216 | + * @access public |
|
| 217 | + */ |
|
| 218 | 218 | function display($handle, $include_once = true) |
| 219 | 219 | { |
| 220 | 220 | global $user, $phpbb_hook, $lang, $config; |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | - * Display the handle and assign the output to a template variable or return the compiled result. |
|
| 252 | - * @access public |
|
| 253 | - */ |
|
| 251 | + * Display the handle and assign the output to a template variable or return the compiled result. |
|
| 252 | + * @access public |
|
| 253 | + */ |
|
| 254 | 254 | function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) |
| 255 | 255 | { |
| 256 | 256 | ob_start(); |
@@ -268,9 +268,9 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | - * Load a compiled template if possible, if not, recompile it |
|
| 272 | - * @access private |
|
| 273 | - */ |
|
| 271 | + * Load a compiled template if possible, if not, recompile it |
|
| 272 | + * @access private |
|
| 273 | + */ |
|
| 274 | 274 | function _tpl_load(&$handle) |
| 275 | 275 | { |
| 276 | 276 | global $user, $config; |
@@ -453,9 +453,9 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
| 456 | - * Assign key variable pairs from an array |
|
| 457 | - * @access public |
|
| 458 | - */ |
|
| 456 | + * Assign key variable pairs from an array |
|
| 457 | + * @access public |
|
| 458 | + */ |
|
| 459 | 459 | function assign_vars($vararray) |
| 460 | 460 | { |
| 461 | 461 | foreach ($vararray as $key => $val) |
@@ -467,9 +467,9 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | - * Assign a single variable to a single key |
|
| 471 | - * @access public |
|
| 472 | - */ |
|
| 470 | + * Assign a single variable to a single key |
|
| 471 | + * @access public |
|
| 472 | + */ |
|
| 473 | 473 | function assign_var($varname, $varval) |
| 474 | 474 | { |
| 475 | 475 | $this->_rootref[$varname] = $varval; |
@@ -478,9 +478,9 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /** |
| 481 | - * Assign key variable pairs from an array to a specified block |
|
| 482 | - * @access public |
|
| 483 | - */ |
|
| 481 | + * Assign key variable pairs from an array to a specified block |
|
| 482 | + * @access public |
|
| 483 | + */ |
|
| 484 | 484 | function assign_block_vars($blockname, $vararray) |
| 485 | 485 | { |
| 486 | 486 | if (strpos($blockname, '.') !== false) |
@@ -545,33 +545,33 @@ discard block |
||
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | /** |
| 548 | - * Change already assigned key variable pair (one-dimensional - single loop entry) |
|
| 549 | - * |
|
| 550 | - * An example of how to use this function: |
|
| 551 | - * {@example alter_block_array.php} |
|
| 552 | - * |
|
| 553 | - * @param string $blockname the blockname, for example 'loop' |
|
| 554 | - * @param array $vararray the var array to insert/add or merge |
|
| 555 | - * @param mixed $key Key to search for |
|
| 556 | - * |
|
| 557 | - * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position] |
|
| 558 | - * |
|
| 559 | - * int: Position [the position to change or insert at directly given] |
|
| 560 | - * |
|
| 561 | - * If key is false the position is set to 0 |
|
| 562 | - * If key is true the position is set to the last entry |
|
| 563 | - * |
|
| 564 | - * @param string $mode Mode to execute (valid modes are 'insert' and 'change') |
|
| 565 | - * |
|
| 566 | - * If insert, the vararray is inserted at the given position (position counting from zero). |
|
| 567 | - * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value). |
|
| 568 | - * |
|
| 569 | - * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) |
|
| 570 | - * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) |
|
| 571 | - * |
|
| 572 | - * @return bool false on error, true on success |
|
| 573 | - * @access public |
|
| 574 | - */ |
|
| 548 | + * Change already assigned key variable pair (one-dimensional - single loop entry) |
|
| 549 | + * |
|
| 550 | + * An example of how to use this function: |
|
| 551 | + * {@example alter_block_array.php} |
|
| 552 | + * |
|
| 553 | + * @param string $blockname the blockname, for example 'loop' |
|
| 554 | + * @param array $vararray the var array to insert/add or merge |
|
| 555 | + * @param mixed $key Key to search for |
|
| 556 | + * |
|
| 557 | + * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position] |
|
| 558 | + * |
|
| 559 | + * int: Position [the position to change or insert at directly given] |
|
| 560 | + * |
|
| 561 | + * If key is false the position is set to 0 |
|
| 562 | + * If key is true the position is set to the last entry |
|
| 563 | + * |
|
| 564 | + * @param string $mode Mode to execute (valid modes are 'insert' and 'change') |
|
| 565 | + * |
|
| 566 | + * If insert, the vararray is inserted at the given position (position counting from zero). |
|
| 567 | + * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value). |
|
| 568 | + * |
|
| 569 | + * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) |
|
| 570 | + * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) |
|
| 571 | + * |
|
| 572 | + * @return bool false on error, true on success |
|
| 573 | + * @access public |
|
| 574 | + */ |
|
| 575 | 575 | function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') |
| 576 | 576 | { |
| 577 | 577 | if (strpos($blockname, '.') !== false) |
@@ -655,9 +655,9 @@ discard block |
||
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | /** |
| 658 | - * Include a separate template |
|
| 659 | - * @access private |
|
| 660 | - */ |
|
| 658 | + * Include a separate template |
|
| 659 | + * @access private |
|
| 660 | + */ |
|
| 661 | 661 | function _tpl_include($filename, $include = true) |
| 662 | 662 | { |
| 663 | 663 | global $lang, $config; |
@@ -686,9 +686,9 @@ discard block |
||
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /** |
| 689 | - * Include a php-file |
|
| 690 | - * @access private |
|
| 691 | - */ |
|
| 689 | + * Include a php-file |
|
| 690 | + * @access private |
|
| 691 | + */ |
|
| 692 | 692 | function _php_include($filename) |
| 693 | 693 | { |
| 694 | 694 | global $phpbb_root_path; |
@@ -705,9 +705,9 @@ discard block |
||
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | /** |
| 708 | - * Assign key variable pairs from an array with block support |
|
| 709 | - * @access public |
|
| 710 | - */ |
|
| 708 | + * Assign key variable pairs from an array with block support |
|
| 709 | + * @access public |
|
| 710 | + */ |
|
| 711 | 711 | function assign_recursive($values, $name = '') |
| 712 | 712 | { |
| 713 | 713 | if(isset($values['.'])) |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | upd_do_query("UPDATE `{{planets}}` SET `crystal` = 0 WHERE `crystal` < 0;"); |
| 333 | 333 | upd_do_query("UPDATE `{{planets}}` SET `deuterium` = 0 WHERE `deuterium` < 0;"); |
| 334 | 334 | upd_alter_table('planets', array( |
| 335 | - "DROP COLUMN `b_building`", |
|
| 336 | - "DROP COLUMN `b_building_id`" |
|
| 335 | + "DROP COLUMN `b_building`", |
|
| 336 | + "DROP COLUMN `b_building_id`" |
|
| 337 | 337 | ), $update_tables['planets']['b_building']); |
| 338 | 338 | |
| 339 | 339 | upd_do_query("DELETE FROM {{config}} WHERE `config_name` IN ('noobprotection', 'noobprotectionmulti', 'noobprotectiontime', 'chat_admin_msgFormat');"); |
@@ -587,8 +587,8 @@ discard block |
||
| 587 | 587 | upd_do_query("UPDATE {{users}} AS u LEFT JOIN {{alliance}} AS a ON u.ally_id = a.id SET u.ally_name = a.ally_name, u.ally_tag = a.ally_tag WHERE u.ally_id IS NOT NULL;"); |
| 588 | 588 | |
| 589 | 589 | upd_alter_table('users', array( |
| 590 | - "ADD CONSTRAINT `FK_users_ally_id` FOREIGN KEY (`ally_id`) REFERENCES `{$config->db_prefix}alliance` (`id`) ON DELETE SET NULL ON UPDATE CASCADE", |
|
| 591 | - "ADD CONSTRAINT `FK_users_ally_name` FOREIGN KEY (`ally_name`) REFERENCES `{$config->db_prefix}alliance` (`ally_name`) ON DELETE SET NULL ON UPDATE CASCADE", |
|
| 590 | + "ADD CONSTRAINT `FK_users_ally_id` FOREIGN KEY (`ally_id`) REFERENCES `{$config->db_prefix}alliance` (`id`) ON DELETE SET NULL ON UPDATE CASCADE", |
|
| 591 | + "ADD CONSTRAINT `FK_users_ally_name` FOREIGN KEY (`ally_name`) REFERENCES `{$config->db_prefix}alliance` (`ally_name`) ON DELETE SET NULL ON UPDATE CASCADE", |
|
| 592 | 592 | ), !$update_foreigns['users']['FK_users_ally_id']); |
| 593 | 593 | } |
| 594 | 594 | |
@@ -1155,46 +1155,46 @@ discard block |
||
| 1155 | 1155 | upd_do_query('DELETE FROM {{statpoints}} WHERE id_owner NOT IN (SELECT id FROM {{users}}) OR id_ally NOT IN (SELECT id FROM {{alliance}});', true); |
| 1156 | 1156 | |
| 1157 | 1157 | upd_alter_table('statpoints', array( |
| 1158 | - "MODIFY COLUMN `stat_date` int(11) NOT NULL DEFAULT '0' FIRST", |
|
| 1159 | - "MODIFY COLUMN `id_owner` BIGINT(20) UNSIGNED DEFAULT NULL", |
|
| 1160 | - "MODIFY COLUMN `id_ally` BIGINT(20) UNSIGNED DEFAULT NULL", |
|
| 1161 | - "MODIFY COLUMN `stat_type` TINYINT UNSIGNED DEFAULT 0", |
|
| 1162 | - "MODIFY COLUMN `stat_code` TINYINT UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1163 | - |
|
| 1164 | - "MODIFY COLUMN `tech_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1165 | - "MODIFY COLUMN `tech_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1166 | - "MODIFY COLUMN `tech_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1167 | - "MODIFY COLUMN `tech_count` DECIMAL(65,0) UNSIGNED UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1168 | - |
|
| 1169 | - "MODIFY COLUMN `build_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1170 | - "MODIFY COLUMN `build_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1171 | - "MODIFY COLUMN `build_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1172 | - "MODIFY COLUMN `build_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1173 | - |
|
| 1174 | - "MODIFY COLUMN `defs_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1175 | - "MODIFY COLUMN `defs_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1176 | - "MODIFY COLUMN `defs_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1177 | - "MODIFY COLUMN `defs_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1178 | - |
|
| 1179 | - "MODIFY COLUMN `fleet_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1180 | - "MODIFY COLUMN `fleet_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1181 | - "MODIFY COLUMN `fleet_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1182 | - "MODIFY COLUMN `fleet_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1183 | - |
|
| 1184 | - "MODIFY COLUMN `res_rank` INT(11) UNSIGNED DEFAULT '0' COMMENT 'Rank by resources' AFTER `fleet_count`", |
|
| 1185 | - "MODIFY COLUMN `res_old_rank` INT(11) UNSIGNED DEFAULT '0' COMMENT 'Old rank by resources'AFTER `res_rank`", |
|
| 1186 | - "MODIFY COLUMN `res_points` DECIMAL(65,0) UNSIGNED DEFAULT '0' COMMENT 'Resource stat points' AFTER `res_old_rank`", |
|
| 1187 | - "MODIFY COLUMN `res_count` DECIMAL(65,0) UNSIGNED DEFAULT '0' COMMENT 'Resource count' AFTER `res_points`", |
|
| 1188 | - |
|
| 1189 | - "MODIFY COLUMN `total_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1190 | - "MODIFY COLUMN `total_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1191 | - "MODIFY COLUMN `total_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1192 | - "MODIFY COLUMN `total_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1193 | - |
|
| 1194 | - "ADD KEY `I_stats_id_ally` (`id_ally`)", |
|
| 1195 | - |
|
| 1196 | - "ADD CONSTRAINT `FK_stats_id_owner` FOREIGN KEY (`id_owner`) REFERENCES `{$config->db_prefix}users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE", |
|
| 1197 | - "ADD CONSTRAINT `FK_stats_id_ally` FOREIGN KEY (`id_ally`) REFERENCES `{$config->db_prefix}alliance` (`id`) ON DELETE CASCADE ON UPDATE CASCADE", |
|
| 1158 | + "MODIFY COLUMN `stat_date` int(11) NOT NULL DEFAULT '0' FIRST", |
|
| 1159 | + "MODIFY COLUMN `id_owner` BIGINT(20) UNSIGNED DEFAULT NULL", |
|
| 1160 | + "MODIFY COLUMN `id_ally` BIGINT(20) UNSIGNED DEFAULT NULL", |
|
| 1161 | + "MODIFY COLUMN `stat_type` TINYINT UNSIGNED DEFAULT 0", |
|
| 1162 | + "MODIFY COLUMN `stat_code` TINYINT UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1163 | + |
|
| 1164 | + "MODIFY COLUMN `tech_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1165 | + "MODIFY COLUMN `tech_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1166 | + "MODIFY COLUMN `tech_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1167 | + "MODIFY COLUMN `tech_count` DECIMAL(65,0) UNSIGNED UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1168 | + |
|
| 1169 | + "MODIFY COLUMN `build_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1170 | + "MODIFY COLUMN `build_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1171 | + "MODIFY COLUMN `build_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1172 | + "MODIFY COLUMN `build_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1173 | + |
|
| 1174 | + "MODIFY COLUMN `defs_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1175 | + "MODIFY COLUMN `defs_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1176 | + "MODIFY COLUMN `defs_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1177 | + "MODIFY COLUMN `defs_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1178 | + |
|
| 1179 | + "MODIFY COLUMN `fleet_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1180 | + "MODIFY COLUMN `fleet_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1181 | + "MODIFY COLUMN `fleet_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1182 | + "MODIFY COLUMN `fleet_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1183 | + |
|
| 1184 | + "MODIFY COLUMN `res_rank` INT(11) UNSIGNED DEFAULT '0' COMMENT 'Rank by resources' AFTER `fleet_count`", |
|
| 1185 | + "MODIFY COLUMN `res_old_rank` INT(11) UNSIGNED DEFAULT '0' COMMENT 'Old rank by resources'AFTER `res_rank`", |
|
| 1186 | + "MODIFY COLUMN `res_points` DECIMAL(65,0) UNSIGNED DEFAULT '0' COMMENT 'Resource stat points' AFTER `res_old_rank`", |
|
| 1187 | + "MODIFY COLUMN `res_count` DECIMAL(65,0) UNSIGNED DEFAULT '0' COMMENT 'Resource count' AFTER `res_points`", |
|
| 1188 | + |
|
| 1189 | + "MODIFY COLUMN `total_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1190 | + "MODIFY COLUMN `total_old_rank` INT(11) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1191 | + "MODIFY COLUMN `total_points` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1192 | + "MODIFY COLUMN `total_count` DECIMAL(65,0) UNSIGNED NOT NULL DEFAULT '0'", |
|
| 1193 | + |
|
| 1194 | + "ADD KEY `I_stats_id_ally` (`id_ally`)", |
|
| 1195 | + |
|
| 1196 | + "ADD CONSTRAINT `FK_stats_id_owner` FOREIGN KEY (`id_owner`) REFERENCES `{$config->db_prefix}users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE", |
|
| 1197 | + "ADD CONSTRAINT `FK_stats_id_ally` FOREIGN KEY (`id_ally`) REFERENCES `{$config->db_prefix}alliance` (`id`) ON DELETE CASCADE ON UPDATE CASCADE", |
|
| 1198 | 1198 | ), true); |
| 1199 | 1199 | } |
| 1200 | 1200 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: Gorlum |
|
| 5 | - * Date: 17.04.2015 |
|
| 6 | - * Time: 6:37 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: Gorlum |
|
| 5 | + * Date: 17.04.2015 |
|
| 6 | + * Time: 6:37 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | function sys_user_vacation($user) { |
| 10 | 10 | global $config; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | if (!defined('INSIDE')) |
| 30 | 30 | { |
| 31 | - die('Hack attempt!'); |
|
| 31 | + die('Hack attempt!'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $lang_info = array( |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | if (!defined('INSIDE')) |
| 30 | 30 | { |
| 31 | - die('Hack attempt!'); |
|
| 31 | + die('Hack attempt!'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $lang_info = array( |
@@ -1,26 +1,26 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * chat.php |
|
| 4 | - * Main chat window |
|
| 5 | - * |
|
| 6 | - * Changelog: |
|
| 7 | - * 4.0 copyright © 2009-2012 Gorlum for http://supernova.ws |
|
| 8 | - * [!] Another rewrite |
|
| 9 | - * [+] preMVC-compatible |
|
| 10 | - * 3.0 copyright © 2009-2011 Gorlum for http://supernova.ws |
|
| 11 | - * [!] Almost full rewrote |
|
| 12 | - * [+] Complies with PCG1 |
|
| 13 | - * 2.0 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 14 | - * [+] Rewrote to remove unnecessary code dupes |
|
| 15 | - * 1.5 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 16 | - * [~] More DDoS-realted fixes |
|
| 17 | - * 1.4 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 18 | - * [~] DDoS-realted fixes |
|
| 19 | - * 1.3 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 20 | - * [~] Security checks for SQL-injection |
|
| 21 | - * 1.2 by Ihor |
|
| 22 | - * 1.0 Shoutbox copyright © 2008 by e-Zobar for XNova |
|
| 23 | - **/ |
|
| 3 | + * chat.php |
|
| 4 | + * Main chat window |
|
| 5 | + * |
|
| 6 | + * Changelog: |
|
| 7 | + * 4.0 copyright © 2009-2012 Gorlum for http://supernova.ws |
|
| 8 | + * [!] Another rewrite |
|
| 9 | + * [+] preMVC-compatible |
|
| 10 | + * 3.0 copyright © 2009-2011 Gorlum for http://supernova.ws |
|
| 11 | + * [!] Almost full rewrote |
|
| 12 | + * [+] Complies with PCG1 |
|
| 13 | + * 2.0 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 14 | + * [+] Rewrote to remove unnecessary code dupes |
|
| 15 | + * 1.5 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 16 | + * [~] More DDoS-realted fixes |
|
| 17 | + * 1.4 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 18 | + * [~] DDoS-realted fixes |
|
| 19 | + * 1.3 copyright © 2009-2010 Gorlum for http://supernova.ws |
|
| 20 | + * [~] Security checks for SQL-injection |
|
| 21 | + * 1.2 by Ihor |
|
| 22 | + * 1.0 Shoutbox copyright © 2008 by e-Zobar for XNova |
|
| 23 | + **/ |
|
| 24 | 24 | /* |
| 25 | 25 | $sn_mvc['model']['chat'][] = 'sn_chat_model'; |
| 26 | 26 | $sn_mvc['model']['chat_add'][] = 'sn_chat_add_model'; |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * DB ACS functions |
|
| 4 | - */ |
|
| 3 | + * DB ACS functions |
|
| 4 | + */ |
|
| 5 | 5 | |
| 6 | 6 | /* ACS ****************************************************************************************************************/ |
| 7 | 7 | /** |