diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2003-04-13 12:28:57 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2003-04-13 12:28:57 +0000 |
commit | 2248698e538e9f01549f79c74e17acce3dfe229b (patch) | |
tree | 4f5c13fb8d4ce759f27d4f4238369a11801f8b4c /phpBB | |
parent | 2918db79d5a71390800673df1f5e7e07090e3b07 (diff) | |
download | forums-2248698e538e9f01549f79c74e17acce3dfe229b.tar forums-2248698e538e9f01549f79c74e17acce3dfe229b.tar.gz forums-2248698e538e9f01549f79c74e17acce3dfe229b.tar.bz2 forums-2248698e538e9f01549f79c74e17acce3dfe229b.tar.xz forums-2248698e538e9f01549f79c74e17acce3dfe229b.zip |
faster (for me), especially for topics with a bunch of attachments (due to the nested block vars).
git-svn-id: file:///svn/phpbb/trunk@3825 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/template.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 74790c6e96..888cdb2905 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -284,22 +284,18 @@ class Template { // Nested block. $blocks = explode('.', $blockname); $blockcount = sizeof($blocks) - 1; - $str = '$this->_tpldata'; - for ($i = 0; $i < $blockcount; $i++) + $str = &$this->_tpldata; + for ($i = 0; $i < $blockcount; $i++) { - $str .= '[\'' . $blocks[$i] . '.\']'; - eval('$lastiteration = sizeof(' . $str . ') - 1;'); - $str .= '[' . $lastiteration . ']'; - } + $str = &$str[$blocks[$i] . '.']; + $str = &$str[sizeof($str) - 1]; + } // Now we add the block that we're actually assigning to. // We're adding a new iteration to this block with the given // variable assignments. - $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;'; - - // Now we evaluate this assignment we've built up. - eval($str); + $str[$blocks[$blockcount] . '.'][] = $vararray; } else { |