aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php34
1 files changed, 11 insertions, 23 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index d23c55fa8..2e7a47b4b 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -584,8 +584,16 @@ function redirect( $url , $msg = '', $refresh_time = 0)
{
global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug;
- if (!isset($lang_info)) {
+ if (!isset($lang_info))
+ {
+ $user = build_user( $conf['guest_id'], true);
include_once(get_language_filepath('common.lang.php'));
+ list($tmpl, $thm) = explode('/', $conf['default_template']);
+ $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
+ }
+ else
+ {
+ $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme']);
}
if (empty($msg))
@@ -602,26 +610,6 @@ function redirect( $url , $msg = '', $refresh_time = 0)
$url_link = $url;
$title = 'redirection';
- unset($template);
- if ( isset($user['template']) )
- {
- $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']);
- }
- else
- {
- list($tmpl, $thm) = explode('/', $conf['default_template']);
- global $themeconf;
- include(
- PHPWG_ROOT_PATH
- .'template/'.$tmpl
- .'/theme/'.$thm
- .'/themeconf.inc.php'
- );
- $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl);
- $user['is_the_guest']=true;
- $user['id']=$conf['guest_id'];
- }
-
$template->set_filenames( array( 'redirect' => 'redirect.tpl' ) );
include( PHPWG_ROOT_PATH.'include/page_header.php' );
@@ -921,9 +909,9 @@ function str_translate_to_ascii7bits($str)
*/
function get_themeconf($key)
{
- global $themeconf;
+ global $template;
- return isset($themeconf[$key]) ? $themeconf[$key] : '';
+ return $template->get_themeconf($key);
}
/**