diff options
Diffstat (limited to 'phpBB/install/install_install.php')
-rwxr-xr-x | phpBB/install/install_install.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 6530876ee4..4ce0b27bfd 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -87,6 +87,7 @@ class install_install extends module case 'final' : $this->load_schema($mode, $sub); $this->add_modules($mode, $sub); + $this->add_language($mode, $sub); $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); @@ -1355,6 +1356,40 @@ class install_install extends module } /** + * Populate the language tables + */ + function add_language($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx; + + $dir = @opendir($phpbb_root_path . 'language'); + while (($file = readdir($dir)) !== false) + { + $path = $phpbb_root_path . 'language/' . $file; + + if (is_dir($path) && !is_link($path) && file_exists($path . '/iso.txt')) + { + $lang_pack = file("{$phpbb_root_path}language/$path/iso.txt"); + $sql_ary = 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])), + 'lang_author' => trim(htmlspecialchars($lang_pack[2])), + ); + + $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $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__); + } + } + } + } + + /** * Add search robots to the database */ function add_bots($mode, $sub) |