From ca9107a7fc0f28877b658cc48d378fc3feaefacd Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 11 Apr 2006 19:50:15 +0000 Subject: merge -r1145:1146 from branches/branch-1_6 into trunk (bug 329 fixed). git-svn-id: http://piwigo.org/svn/trunk@1147 68402e56-0260-453c-a942-63ccdbb3a9ee --- install.php | 119 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 56 insertions(+), 63 deletions(-) diff --git a/install.php b/install.php index cafe5288b..8fe5b03ae 100644 --- a/install.php +++ b/install.php @@ -32,38 +32,6 @@ define('PHPWG_ROOT_PATH','./'); function guess_lang() { return 'en_UK.iso-8859-1'; - -// $languages = array(); -// $i = 0; -// if ($opendir = opendir(PHPWG_ROOT_PATH.'language/')) -// { -// while ( $file = readdir ( $opendir ) ) -// { -// if ( is_dir ( PHPWG_ROOT_PATH.'language/'.$file )&& !substr_count($file,'.')) -// { -// $languages[$i++] =$file; -// } -// } -// } - -// if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) -// { -// $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); -// for ($i = 0; $i < sizeof($accept_lang_ary); $i++) -// { -// for ($j=0; $j"; + $file_content = ''; @umask(0111); // writing the configuration file @@ -275,29 +253,40 @@ if ( isset( $_POST['install'] )) @fclose($fp); // tables creation, based on phpwebgallery_structure.sql - execute_sqlfile( PHPWG_ROOT_PATH.'install/phpwebgallery_structure.sql' - , 'phpwebgallery_' - , $table_prefix ); + execute_sqlfile( + PHPWG_ROOT_PATH.'install/phpwebgallery_structure.sql', + DEFAULT_PREFIX_TABLE, + $table_prefix + ); // We fill the tables with basic informations - execute_sqlfile( PHPWG_ROOT_PATH.'install/config.sql' - , 'phpwebgallery_' - , $table_prefix ); + execute_sqlfile( + PHPWG_ROOT_PATH.'install/config.sql', + DEFAULT_PREFIX_TABLE, + $table_prefix + ); - $query = 'UPDATE '.CONFIG_TABLE; - $query.= " SET value = '".$admin_mail."'"; - $query.= " WHERE param = 'mail_webmaster'"; - $query.= ';'; - mysql_query( $query ); + $query = ' +UPDATE '.CONFIG_TABLE.' + SET value = \''.$admin_mail.'\' + WHERE param = \'mail_webmaster\' +;'; + mysql_query($query); - $query = 'UPDATE '.CONFIG_TABLE; - $query.= " SET value = '".$language."'"; - $query.= " WHERE param = 'default_language'"; - $query.= ';'; - mysql_query( $query ); + $query = ' +UPDATE '.CONFIG_TABLE.' + SET value = \''.$language.'\' + WHERE param = \'default_language\' +;'; + mysql_query($query); - $query = 'INSERT INTO '.SITES_TABLE; - $query.= " (id,galleries_url) VALUES (1, '".PHPWG_ROOT_PATH."galleries/');"; - mysql_query( $query ); + $query = ' +INSERT + INTO '.SITES_TABLE.' + (id, galleries_url) + VALUES + (1, \''.PHPWG_ROOT_PATH.'galleries/\') +;'; + mysql_query($query); // webmaster admin user $query = ' @@ -392,7 +381,11 @@ $template->assign_vars( 'F_DB_HOST'=>$dbhost, 'F_DB_USER'=>$dbuser, 'F_DB_NAME'=>$dbname, - 'F_DB_PREFIX'=>$table_prefix, + 'F_DB_PREFIX' => ( + $table_prefix != DEFAULT_PREFIX_TABLE + ? $table_prefix + : DEFAULT_PREFIX_TABLE + ), 'F_ADMIN'=>$admin_name, 'F_ADMIN_EMAIL'=>$admin_mail, 'F_LANG_SELECT'=>language_select($language), -- cgit v1.2.3