Some fixes to the template code

- this handles the case where file caching is used and no cached
version exists


git-svn-id: file:///svn/phpbb/trunk@5331 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2005-12-13 20:58:28 +00:00
parent e4defede57
commit 9298082dde
2 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@ class template_compile
/** /**
* constuctor * constuctor
*/ */
function template_compile($template) function template_compile(&$template)
{ {
$this->template = &$template; $this->template = &$template;
} }

View file

@ -229,12 +229,12 @@ class template
{ {
if ($row['template_filename'] == $this->filename[$handle]) if ($row['template_filename'] == $this->filename[$handle])
{ {
$this->_tpl_load_file($handle); $compile->_tpl_load_file($handle);
} }
else else
{ {
$this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename']; $this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename'];
$this->_tpl_load_file($row['template_filename']); $compile->_tpl_load_file($row['template_filename']);
unset($this->compiled_code[$row['template_filename']]); unset($this->compiled_code[$row['template_filename']]);
unset($this->files[$row['template_filename']]); unset($this->files[$row['template_filename']]);
} }
@ -242,8 +242,8 @@ class template
if ($row['template_filename'] == $this->filename[$handle]) if ($row['template_filename'] == $this->filename[$handle])
{ {
$this->compiled_code[$handle] = $this->compile(trim($row['template_data'])); $this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
$this->compile_write($handle, $this->compiled_code[$handle]); $compile->compile_write($handle, $this->compiled_code[$handle]);
} }
else else
{ {
@ -251,7 +251,7 @@ class template
if (!file_exists($this->cachepath . $row['template_filename'] . '.' . (($this->static_lang) ? $user->data['user_lang'] . '.' : '') . $phpEx)) if (!file_exists($this->cachepath . $row['template_filename'] . '.' . (($this->static_lang) ? $user->data['user_lang'] . '.' : '') . $phpEx))
{ {
$this->filename[$row['template_filename']] = $row['template_filename']; $this->filename[$row['template_filename']] = $row['template_filename'];
$this->compile_write($row['template_filename'], $this->compile(trim($row['template_data']))); $compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
unset($this->filename[$row['template_filename']]); unset($this->filename[$row['template_filename']]);
} }
} }