aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/bbcode.php4
-rw-r--r--phpBB/includes/functions_messenger.php2
-rw-r--r--phpBB/includes/template.php11
3 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 693523dcbb..f58852c00b 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -128,7 +128,7 @@ class bbcode
*/
function bbcode_cache_init()
{
- global $user, $phpbb_root_path;
+ global $phpbb_root_path, $template, $user;
if (empty($this->template_filename))
{
@@ -137,7 +137,7 @@ class bbcode
if (!@file_exists($this->template_filename))
{
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
+ if (isset($template->orig_tpl_inherits_id) && $template->orig_tpl_inherits_id)
{
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
if (!@file_exists($this->template_filename))
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 0fcf33f999..0d1c215cb1 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -199,7 +199,7 @@ class messenger
$template_path .= $template_lang . '/email';
}
- $tpl->set_custom_template($template_path, $template_lang . '_email');
+ $tpl->set_custom_template($template_path, $template_lang . '_email', 'email');
$tpl->set_filenames(array(
'body' => $template_file . '.txt',
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index 80434aca4c..648af61c00 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -90,7 +90,7 @@ class template
* Set custom template location (able to use directory outside of phpBB)
* @access public
*/
- function set_custom_template($template_path, $template_name)
+ function set_custom_template($template_path, $template_name, $template_mode = 'template')
{
global $phpbb_root_path, $user;
@@ -102,8 +102,13 @@ class template
$this->root = $template_path;
$this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
- $user->theme['template_storedb'] = false;
- $user->theme['template_inherits_id'] = false;
+
+ // As the template-engine is used for more than the template (emails, etc.), we should not set $user->theme in all cases, but only on the real template.
+ if ($template_mode == 'template')
+ {
+ $user->theme['template_storedb'] = false;
+ $user->theme['template_inherits_id'] = false;
+ }
$this->_rootref = &$this->_tpldata['.'][0];