diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-03 22:10:23 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-03 22:10:23 +0000 |
commit | aa8a051a981954b1d15d116fd2192d1e4778c8f6 (patch) | |
tree | 7aed219c2db7e5ec84e30fad84b7942173f81247 /phpBB/includes/functions.php | |
parent | df716e1e837e121bac29c987ccf4f9a8c68c8af2 (diff) | |
download | forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.gz forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.bz2 forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.xz forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.zip |
Moved config, images vars to arrays and various other fixes
git-svn-id: file:///svn/phpbb/trunk@237 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c4d872de2a..ba203c9281 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -144,11 +144,9 @@ function make_jumpbox() // Initialise user settings on page load function init_userprefs($userdata) { - global $override_user_theme, $template, $sys_template; - global $default_lang, $default_theme, $date_format, $sys_timezone; - global $theme; + global $board_config, $theme, $template, $lang, $phpEx; - if(!$override_user_themes) + if(!$board_config['override_user_themes']) { if(($userdata['user_id'] != ANONYMOUS || $userdata['user_id'] != DELETED) && $userdata['user_theme']) { @@ -156,24 +154,24 @@ function init_userprefs($userdata) } else { - $theme = setuptheme($default_theme); + $theme = setuptheme($board_config['default_theme']); } } else { - $theme = setuptheme($override_user_theme); + $theme = setuptheme($board_config['override_user_themes']); } if($userdata['user_lang'] != '') { - $default_lang = $userdata['user_lang']; + $board_config['default_lang'] = $userdata['user_lang']; } if($userdata['user_dateformat'] != '') { - $date_format = $userdata['user_dateformat']; + $board_config['default_dateformat'] = $userdata['user_dateformat']; } if(isset($userdata['user_timezone'])) { - $sys_timezone = $userdata['user_timezone']; + $board_config['default_timezone'] = $userdata['user_timezone']; } // Setup user's Template if($userdata['user_template'] != '') @@ -182,35 +180,35 @@ function init_userprefs($userdata) } else { - $template = new Template("templates/".$sys_template); + $template = new Template("templates/".$board_config['default_template']); } - - // Include the appropriate language file ... if it exists. - if(!strstr($PHP_SELF, "admin")) + + // + // This is currently worthless since all the individual + // language variables will only be locally defined in this + // function and not accessible to the board code globally. + // This will be fixed by moving all $l_xxxx vars into a single + // $lang[''] array + // + if( file_exists("language/lang_".$board_config['default_lang'].".".$phpEx) ) { - if(file_exists('language/lang_'.$default_lang.'.'.$phpEx)) - { - include('language/lang_'.$default_lang.'.'.$phpEx); - } + include('language/lang_'.$board_config['default_lang'].'.'.$phpEx); } else { - if(strstr($PHP_SELF, "topicadmin")) - { - include('language/lang_'.$default_lang.'.'.$phpEx); - } - else - { - include('../language/lang_'.$default_lang.'.'.$phpEx); - } + include('language/lang_english'.$phpEx); } + return; } function setuptheme($theme) { global $db; - $sql = "SELECT * FROM ".THEMES_TABLE." WHERE themes_id = '$theme'"; + + $sql = "SELECT * + FROM ".THEMES_TABLE." + WHERE themes_id = '$theme'"; if(!$result = $db->sql_query($sql)) { |