aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_template.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-05-07 21:44:23 +0000
committerNils Adermann <naderman@naderman.de>2006-05-07 21:44:23 +0000
commitf83b7e1581daf1911bfe9e9c69ff9961ef2a184d (patch)
tree0a7d633e290c8f54830843360b520e27151ca242 /phpBB/includes/functions_template.php
parent870cb6efd07f8f7034b1b5221b892c797dcde387 (diff)
downloadforums-f83b7e1581daf1911bfe9e9c69ff9961ef2a184d.tar
forums-f83b7e1581daf1911bfe9e9c69ff9961ef2a184d.tar.gz
forums-f83b7e1581daf1911bfe9e9c69ff9961ef2a184d.tar.bz2
forums-f83b7e1581daf1911bfe9e9c69ff9961ef2a184d.tar.xz
forums-f83b7e1581daf1911bfe9e9c69ff9961ef2a184d.zip
- added the template editor (doesn't use a hardcoded list of template filenames for categorisation anymore)
- fix some bugs related to storing template files in the database - allow templates stored in subfolders of the /styles/name/template/ folder git-svn-id: file:///svn/phpbb/trunk@5894 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_template.php')
-rw-r--r--phpBB/includes/functions_template.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php
index 80aa315fee..6def26f032 100644
--- a/phpBB/includes/functions_template.php
+++ b/phpBB/includes/functions_template.php
@@ -96,13 +96,13 @@ class template_compile
$php_blocks = $matches[1];
$code = preg_replace('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', '<!-- PHP -->', $code);
- preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', $code, $matches);
+ preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+?) -->#', $code, $matches);
$include_blocks = $matches[1];
- $code = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDE -->', $code);
+ $code = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+?) -->#', '<!-- INCLUDE -->', $code);
- preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.\\\\]+?) -->#', $code, $matches);
+ preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+?) -->#', $code, $matches);
$includephp_blocks = $matches[1];
- $code = preg_replace('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDEPHP -->', $code);
+ $code = preg_replace('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+?) -->#', '<!-- INCLUDEPHP -->', $code);
preg_match_all('#<!-- (.*?) (.*?)?[ ]?-->#', $code, $blocks);
$text_blocks = preg_split('#<!-- (.*?) (.*?)?[ ]?-->#', $code);
@@ -220,7 +220,6 @@ class template_compile
}
// This will handle the remaining root-level varrefs
-
// transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array
$text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks);
@@ -661,7 +660,7 @@ class template_compile
{
global $phpEx, $user;
- $filename = $this->template->cachepath . $this->template->filename[$handle] . '.' . $phpEx;
+ $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
if ($fp = @fopen($filename, 'wb'))
{