diff options
author | David M <davidmj@users.sourceforge.net> | 2007-04-28 00:53:31 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2007-04-28 00:53:31 +0000 |
commit | 7f24d83b156542f78ae20d7c0235f1426eb0cad7 (patch) | |
tree | 99a4d69b07d90cc4a5bd704bed663a39c76cb408 /phpBB/install/install_install.php | |
parent | 7fcfd0c17d0f53ce4f196c881f9ace9d184d7777 (diff) | |
download | forums-7f24d83b156542f78ae20d7c0235f1426eb0cad7.tar forums-7f24d83b156542f78ae20d7c0235f1426eb0cad7.tar.gz forums-7f24d83b156542f78ae20d7c0235f1426eb0cad7.tar.bz2 forums-7f24d83b156542f78ae20d7c0235f1426eb0cad7.tar.xz forums-7f24d83b156542f78ae20d7c0235f1426eb0cad7.zip |
installer tries to install language specific imageset entries
git-svn-id: file:///svn/phpbb/trunk@7414 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install/install_install.php')
-rwxr-xr-x | phpBB/install/install_install.php | 76 |
1 files changed, 70 insertions, 6 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 5808b10557..f4960cdb32 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1607,23 +1607,87 @@ class install_install extends module if (is_dir($path) && !is_link($path) && file_exists($path . '/iso.txt')) { - $lang_pack = file("{$phpbb_root_path}language/$path/iso.txt"); + $lang_file = file("{$phpbb_root_path}language/$path/iso.txt"); - $sql_ary = array( + $lang_pack = array( 'lang_iso' => basename($path), 'lang_dir' => basename($path), - 'lang_english_name' => trim(htmlspecialchars($lang_pack[0])), - 'lang_local_name' => trim(htmlspecialchars($lang_pack[1], ENT_COMPAT, 'UTF-8')), - 'lang_author' => trim(htmlspecialchars($lang_pack[2], ENT_COMPAT, 'UTF-8')), + 'lang_english_name' => trim(htmlspecialchars($lang_file[0])), + 'lang_local_name' => trim(htmlspecialchars($lang_file[1], ENT_COMPAT, 'UTF-8')), + 'lang_author' => trim(htmlspecialchars($lang_file[2], ENT_COMPAT, 'UTF-8')), ); - $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack)); if ($db->sql_error_triggered) { $error = $db->sql_error($db->sql_error_sql); $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); } + + $sql_ary = array(); + + $sql = 'SELECT * + FROM ' . STYLES_IMAGESET_TABLE; + $result = $db->sql_query($sql); + + while ($imageset_row = $db->sql_fetchrow($result)) + { + if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg")) + { + $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"); + foreach ($cfg_data_imageset_data as $image_name => $value) + { + if (strpos($value, '*') !== false) + { + if (substr($value, -1, 1) === '*') + { + list($image_filename, $image_height) = explode('*', $value); + $image_width = 0; + } + else + { + list($image_filename, $image_height, $image_width) = explode('*', $value); + } + } + else + { + $image_filename = $value; + $image_height = $image_width = 0; + } + + if (strpos($image_name, 'img_') === 0 && $image_filename) + { + $image_name = substr($image_name, 4); + if (in_array($image_name, $valid_localized)) + { + $sql_ary[] = array( + 'image_name' => $image_name, + 'image_filename' => $image_filename, + 'image_height' => $image_height, + 'image_width' => $image_width, + 'imageset_id' => $imageset_row['imageset_id'], + 'image_lang' => $lang_pack['iso'], + ); + } + } + } + } + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary); + + if ($db->sql_error_triggered) + { + $error = $db->sql_error($db->sql_error_sql); + $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); + } + + $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE); + } } } closedir($dir); |