f('db_user'),$ses->f('db_pass'), $ses->f('db_host'),$ses->f('db_name')); $blog = new blog($con,$ses->f('db_prefix'),NULL); if ($blog->addPost($ses->f('user_id'),__('First post'),'first-post','', '
'.__('This is the first post. Please edit it.').'
','',1, 'html',true,true,true,$ses->f('lang'),false) == false) { $first_post = false; } else { $first_post = true; } $end_check->addItem('first',$first_post, __('Creation of first entry.'), __('Creation of first entry failed.') ); # Création du fichier de configuration $configfile = dirname(__FILE__).'/../conf/config.php'; $config = implode('',file($configfile.'.in')); $config = str_replace('%%DB_USER%%',$ses->f('db_user'),$config); $config = str_replace('%%DB_PASS%%',$ses->f('db_pass'),$config); $config = str_replace('%%DB_HOST%%',$ses->f('db_host'),$config); $config = str_replace('%%DB_BASE%%',$ses->f('db_name'),$config); $config = str_replace('%%DB_PREFIX%%',$ses->f('db_prefix'),$config); if (($fp = @fopen($configfile,'w')) !== false) { fwrite($fp,$config,strlen($config)); fclose($fp); $wconf = true; files::secureFile($configfile); } else { $wconf = false; } $end_check->addItem('conf',$wconf, __('Creation of config file.'), __('Creation of config file failed.') ); $user_id = $ses->f('user_id'); $user_pwd = $ses->f('user_pwd'); if ($end_check->checkAll()) { $ses->destroy(); } require dirname(__FILE__).'/__top.php'; echo ''.__('An error occured while finishing installation.').'
'; } else { @unlink($configfile.'.in'); echo ''.__('You successfully installed DotClear. Have fun.').'
'; echo ''; } $con->close(); ?>