mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-18 22:58:10 +01:00
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
This commit is contained in:
parent
2918db79d5
commit
2248698e53
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user