示例#1
0
    $output .= $option['close'];
    return $output;
}
if (empty($_POST['submit'])) {
    // show the install page
    if (file_exists('site.config.php')) {
        if (!is_writable('site.config.php')) {
            die('make site.config.php writable');
        }
    } else {
        die('create site.config.php first, be sure it is writable');
    }
    $output = file_get_contents('install.html');
    $output = preg_replace('#%(.+?)\\.lang#', '\\1', $output);
    $output = preg_replace('#%(.+?)\\.name#', '\\1', $output);
    $output = ereg_replace('%database.options', replacedbtypes($database->getAllSupportedDatabases()), $output);
    echo $output;
} else {
    if ($_POST['submit'] == 'install') {
        if (empty($POST['activatemail'])) {
            header('install.php');
        }
        // install config script
        $config = '<?php' . NL . TAB;
        //$config .= '// general';
        $config .= "\$config['general']['servertimezone'] = {$_POST['servertimezone']};" . NL . TAB;
        $config .= "\$config['general']['timezone'] = 0;" . NL . TAB;
        $config .= "\$config['general']['timeformat'] = 'H:i:s d/m/y';" . NL . TAB;
        $config .= "\$config['general']['sitename'] = '{$_POST['sitename']}';" . NL . TAB;
        $config .= "\$config['general']['description'] = '{$_POST['description']}';" . NL . TAB;
        $config .= "\$config['general']['contentlanguage'] = 'en';" . NL . TAB;