Index: trunk/core/kernel/parser/template.php =================================================================== diff -u -N -r4490 -r4567 --- trunk/core/kernel/parser/template.php (.../template.php) (revision 4490) +++ trunk/core/kernel/parser/template.php (.../template.php) (revision 4567) @@ -88,19 +88,20 @@ function SetThemePath() { - if ( defined('SPECIAL_TEMPLATES_FOLDER') ) - { + if (defined('SPECIAL_TEMPLATES_FOLDER')) { $sub_folder = SPECIAL_TEMPLATES_FOLDER; } - elseif( $this->Application->IsAdmin() ) - { + elseif ($this->Application->IsAdmin()) { $sub_folder = '/admin/templates'; } - else - { - $current_theme = $this->Application->GetVar('m_theme'); - $theme_folder = $this->Application->DB->GetOne('SELECT Name FROM '.TABLE_PREFIX.'Theme WHERE ThemeId = '.$current_theme); - $sub_folder = '/themes/'.$theme_folder; + else { + $theme =& $this->Application->recallObject('theme.current'); + if ($theme->isLoaded()) { + $sub_folder = '/themes/'.$theme->GetDBField('Name'); + } + else { + die('No Primary Theme Selected'); + } } safeDefine('THEMES_PATH', $sub_folder); }