diff options
author | Nils Adermann <naderman@naderman.de> | 2007-05-20 14:32:23 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2007-05-20 14:32:23 +0000 |
commit | 40e43384d7c1748160c390856b2ef88a4d57d67e (patch) | |
tree | 64d8c1af268dd0feb221e1d5b7e206cc0fedcc64 /phpBB/style.php | |
parent | 2f9992bc3abdce909c5e203873a79b1e4786cb00 (diff) | |
download | forums-40e43384d7c1748160c390856b2ef88a4d57d67e.tar forums-40e43384d7c1748160c390856b2ef88a4d57d67e.tar.gz forums-40e43384d7c1748160c390856b2ef88a4d57d67e.tar.bz2 forums-40e43384d7c1748160c390856b2ef88a4d57d67e.tar.xz forums-40e43384d7c1748160c390856b2ef88a4d57d67e.zip |
- style.php uses default language fallback for the imageset like session.php now
- style.php removes placeholders for non-existant images instead of leaving them alone
- automatically try to load a localised part of an imageset if the folder exists and no images for that language were found in the database, thanks PhilippK
git-svn-id: file:///svn/phpbb/trunk@7654 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/style.php')
-rw-r--r-- | phpBB/style.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/style.php b/phpBB/style.php index a5a3b44778..9be0d6a0dc 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -96,10 +96,12 @@ if ($id && $sid) $user['user_lang'] = $config['default_lang']; } + $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang']; + $sql = 'SELECT * FROM ' . STYLES_IMAGESET_DATA_TABLE . ' WHERE imageset_id = ' . $theme['imageset_id'] . " - AND image_lang IN('" . $db->sql_escape($user['user_lang']) . "', '')"; + AND image_lang IN('" . $db->sql_escape($user_image_lang) . "', '')"; $result = $db->sql_query($sql, 3600); $img_array = array(); @@ -174,7 +176,7 @@ if ($id && $sid) '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme', '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template', '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset', - '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user['user_lang'], + '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang, '{T_STYLESHEET_NAME}' => $theme['theme_name'], '{S_USER_LANG}' => $user['user_lang'] ); @@ -190,8 +192,11 @@ if ($id && $sid) foreach ($matches[1] as $i => $img) { $img = strtolower($img); + $find[] = $matches[0][$i]; + if (!isset($img_array[$img])) { + $replace[] = ''; continue; } @@ -223,7 +228,6 @@ if ($id && $sid) default: continue; } - $find[] = $matches[0][$i]; } if (sizeof($find)) |