diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-02-04 18:31:22 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-02-04 18:31:22 +0000 |
commit | 92a27156d84c44d16ead9163cbae74224724914a (patch) | |
tree | dddfb19a7c6c89cb704b35c87c3cd1690cfc0e37 /phpBB/includes/functions.php | |
parent | cc5e68b05d22cd650e4a8923fda2d8d7b0371dfe (diff) | |
download | forums-92a27156d84c44d16ead9163cbae74224724914a.tar forums-92a27156d84c44d16ead9163cbae74224724914a.tar.gz forums-92a27156d84c44d16ead9163cbae74224724914a.tar.bz2 forums-92a27156d84c44d16ead9163cbae74224724914a.tar.xz forums-92a27156d84c44d16ead9163cbae74224724914a.zip |
Another change to the way {LANG} is handled for images ... last one, ... hopefully :)
git-svn-id: file:///svn/phpbb/trunk@2054 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 48cddc3ff1..732ff50585 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -242,26 +242,6 @@ function init_userprefs($userdata) global $board_config, $theme, $images; global $template, $lang, $phpEx, $phpbb_root_path; - if( !$board_config['override_user_style'] ) - { - if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) ) - { - $theme = setup_style($userdata['user_style']); - if( !$theme ) - { - $theme = setup_style($board_config['default_style']); - } - } - else - { - $theme = setup_style($board_config['default_style']); - } - } - else - { - $theme = setup_style($board_config['default_style']); - } - if( $userdata['user_id'] != ANONYMOUS ) { if( !empty($userdata['user_lang'])) @@ -297,15 +277,28 @@ function init_userprefs($userdata) include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } - while( list($key, $value) = @each($images) ) + // + // Set up style + // + if( !$board_config['override_user_style'] ) { - if( strstr($value, "{LANG}") ) + if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) ) { - $new_value = str_replace("{LANG}", $board_config['default_lang'], $value); - - $images[$key] = ( file_exists($new_value) ) ? $new_value : str_replace("{LANG}", "english", $value); + $theme = setup_style($userdata['user_style']); + if( !$theme ) + { + $theme = setup_style($board_config['default_style']); + } + } + else + { + $theme = setup_style($board_config['default_style']); } } + else + { + $theme = setup_style($board_config['default_style']); + } return; } @@ -317,12 +310,12 @@ function setup_style($style) $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; - if(!$result = $db->sql_query($sql)) + if( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, "Couldn't query database for theme info."); } - if( !$row = $db->sql_fetchrow($result) ) + if( !($row = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, "Couldn't get theme data for themes_id=$style."); } @@ -342,9 +335,16 @@ function setup_style($style) message_die(CRITICAL_ERROR, "Couldn't open $template_name template config file"); } + if( file_exists($current_template_path . '/images/lang_' . $board_config['default_lang']) ) + { + while( list($key, $value) = @each($images) ) + { + $images[$key] = str_replace("{LANG}", 'lang_' . $board_config['default_lang'], $value); + } + } } - return($row); + return $row; } function generate_activation_key() |