From fd24241044338f9210319398ae10bc6ad02983ea Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Aug 2009 11:15:24 +0000 Subject: [PATCH] Revert INC/DEC feature. It is not consistent with the other template variables - bad idea. ;) We will get to it though... but not now. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10064 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 - phpBB/docs/coding-guidelines.html | 4 ++-- phpBB/includes/functions_template.php | 30 --------------------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8610887904..e7df10eba0 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -282,7 +282,6 @@
  • [Feature] Separate PM Reply and PM Reply to all in prosilver.
  • [Feature] Place debug notices during captcha rendering in the error log - useful for debugging output already started errors.
  • [Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset...
  • -
  • [Feature] Added INC/DEC command to template syntax, applicable to DEFINES and normal template variables, including loops.
  • [Feature] Added function to generate email-hash. (Bug #49195)
  • diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 29fce50b54..8ac2e4e89d 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1176,7 +1176,7 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; <!-- DEFINE $SOME_VAR = 'my_file.html' --> <!-- INCLUDE {$SOME_VAR} --> - +

    PHP

    A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:

    diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index f22a48bddb..1d3a4d74f8 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -191,14 +191,6 @@ class template_compile $compile_blocks[] = 'compile_tag_define($block_val[2], false) . ' ?>'; break; - case 'INC': - $compile_blocks[] = 'compile_tag_counter($block_val[2], '++') . ' ?>'; - break; - - case 'DEC': - $compile_blocks[] = 'compile_tag_counter($block_val[2], '--') . ' ?>'; - break; - case 'INCLUDE': $temp = array_shift($include_blocks); @@ -634,28 +626,6 @@ class template_compile return (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ' = ' . $match[4] . ';'; } - - /** - * Compile INC/DEC tags - * INC/DEC tags support defined template variables as well as normal template variables - * @access private - */ - function compile_tag_counter($tag_args, $operation = '++') - { - preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Z])([A-Z0-9\-_]+)#s', $tag_args, $varrefs); - - if (empty($varrefs[0])) - { - return ''; - } - - // Build token - $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_rootref[\'' . $varrefs[3] . '\']'); - - // Increase or decrease token ;) - return "echo {$token}{$operation};"; - } - /** * Compile INCLUDE tag * @access private