Beispiel #1
0
                if ($database_error['openblog']) {
                    echo "Could not connect to the server or select the database (Open Blog)!<br /><br /><a href=\"javascript:history.go(-1)\">&lsaquo;&lsaquo; Back</a>";
                } else {
                    mysql_connect($database['wordpress']['hostname'], $database['wordpress']['username'], $database['wordpress']['password']) or die(mysql_error());
                    mysql_select_db($database['wordpress']['name']) or die(mysql_error());
                    $data = get_data($database['wordpress']['prefix']);
                    mysql_close();
                    mysql_connect($database['openblog']['hostname'], $database['openblog']['username'], $database['openblog']['password']) or die(mysql_error());
                    mysql_select_db($database['openblog']['name']) or die(mysql_error());
                    create_new_tables($database['openblog']['prefix']);
                    insert_data($database['wordpress']['prefix'], $database['openblog']['prefix'], $data);
                    // write the main config file
                    if ($blog['enable_seo_urls'] == TRUE) {
                        write_main_config($blog['url'], TRUE);
                    } else {
                        write_main_config($blog['url'], FALSE);
                        // delete the .htaccess file
                        unlink('../.htaccess');
                    }
                    // write the database config file
                    write_database_config($database['openblog']['hostname'], $database['openblog']['username'], $database['openblog']['password'], $database['openblog']['name'], $database['openblog']['prefix']);
                    mysql_close();
                    echo 'You have successfully migrated from Wordpress to Open Blog.<br /><br />
			Before you can start using your blog, you must delete the <strong>install/</strong> directory.<br /><br />
			When you are done, go to your <a href="' . $blog['url'] . '" target="_blank">blog home page</a>.';
                }
            }
        }
    }
} else {
    header("Location: index.php");
Beispiel #2
0
if (is_installed()) {
    require '../application/config/config.php';
    require '../application/config/database.php';
    mysql_connect($db['default']['hostname'], $db['default']['username'], $db['default']['password']) or die(mysql_error());
    mysql_select_db($db['default']['database']) or die(mysql_error());
    // SEO urls
    $blog['enable_seo_urls'] = get_mod_rewrite_status();
    //  data
    $data = get_data($db['default']['dbprefix']);
    // drop old tables
    drop_old_tables($db['default']['dbprefix']);
    // create new tables
    create_new_tables($db['default']['dbprefix']);
    // insert old data
    insert_data($db['default']['dbprefix'], $data);
    mysql_close();
    // write the main config file
    if ($blog['enable_seo_urls'] == TRUE) {
        write_main_config($config['base_url'], TRUE);
    } else {
        write_main_config($config['base_url'], FALSE);
        // delete the .htaccess file
        unlink('../.htaccess');
    }
    echo 'Open Blog has been successfully updated to version 1.2.1.<br /><br />
	Before you can start using your blog, you must delete the <strong>install/</strong> directory.<br /><br />
	When you are done, go to your <a href="' . $config['base_url'] . '" target="_blank">blog home page</a>.';
} else {
    header("Location: update.php");
}
Beispiel #3
0
    }
    if (empty($database['hostname']) || empty($database['username']) || empty($database['password']) || empty($database['name']) || empty($database['prefix']) || empty($blog['url']) || empty($blog['title']) || empty($blog['description']) || empty($blog['meta_keywords']) || empty($blog['posts_per_site']) || empty($blog['links_per_box']) || empty($blog['months_per_archive']) || empty($administrator['username']) || empty($administrator['password']) || empty($administrator['email'])) {
        echo "All fields are required!<br /><br /><a href=\"javascript:history.go(-1)\">&lsaquo;&lsaquo; Back</a>";
    } else {
        $database_error = test_database_connection($database['hostname'], $database['username'], $database['password'], $database['name']);
        if ($database_error) {
            echo "Could not connect to the server or select the dabatase!<br /><br /><a href=\"javascript:history.go(-1)\">&lsaquo;&lsaquo; Back</a>";
        } else {
            mysql_connect($database['hostname'], $database['username'], $database['password']) or die(mysql_error());
            mysql_select_db($database['name']) or die(mysql_error());
            // create tables
            create_tables($database['prefix']);
            insert_blog_data($database['prefix'], $blog['title'], $blog['description'], $blog['meta_keywords'], $blog['allow_registrations'], $blog['posts_per_site'], $blog['links_per_box'], $blog['months_per_archive']);
            if (empty($administrator['display_name'])) {
                insert_admin_data($database['prefix'], $administrator['username'], $administrator['password'], $administrator['email']);
            } else {
                insert_admin_data($database['prefix'], $administrator['username'], $administrator['password'], $administrator['email'], $administrator['display_name']);
            }
            mysql_close();
            // write main config file
            write_main_config($blog['url']);
            // write database config file
            write_database_config($database['hostname'], $database['username'], $database['password'], $database['name'], $database['prefix']);
            echo 'Open Blog has been successfully installed.<br /><br />
			Before you can start using your blog, you must delete the <strong>install/</strong> directory.<br /><br />
			When you are done, go to your <a href="' . $blog['url'] . '" target="_blank">blog home page</a>.';
        }
    }
} else {
    header("Location: index.php");
}