• Hi people. I’v got a Theme wich comes with alternative demo content. there is a folder “uploads” with stuff for wp-content/uploads and a installer. the installer has only a .sql and .php inside, so i think it just chnges paths to the correct ones of my site.

    iv got an ssl protocol installed. when i start the installer for the demo content, it destroys my wp setup. after it generate links like “https://https//mydomain.com/………….” and i cant access any site.

    i attached the code of the installer
    so my quastions / options:

    how to fix the installer, so it wont destroy my setup and generate links correctly?

    or how to install content manually, what i have to change in phpmydamin. maybe a coder can read it out of the code.

    Thanks in advance.

    `
    global $wpdb;
    $our_site_url = get_site_url();
    $our_site_url = str_replace(‘http://’, ”, $our_site_url);
    replace_file(dirname(__FILE__).’/demo.sql’, ‘flowmaster.themes.zone’, $our_site_url);
    replace_file(dirname(__FILE__).’/demo.sql’, ‘tz_’, $wpdb->prefix);

    $query = “”;
    $sql = file(dirname(__FILE__).’/demo.sql’);
    foreach ($sql as $key=>$line) {
    $line = trim($line);
    if ($line != “” && substr($line, 0, 2) != ‘–‘)
    {
    $query .= $line;
    if (substr($line, -1) == ‘;’)
    {

    $query_result = $wpdb->query($query);
    if ($query_results === FALSE)
    {
    echo($query);
    }
    $query = “”;
    }
    }
    }
    unset ($line);

    function replace_file($path, $string, $replace)
    {

    if (is_file($path) === true)
    {
    $file = fopen($path, ‘r’);
    $temp = tempnam(dirname(__FILE__), ‘tmp’);

    if (is_resource($file) === true)
    {
    while (feof($file) === false)
    {
    file_put_contents($temp, str_replace($string, $replace, fgets($file)), FILE_APPEND);
    }

    fclose($file);
    }

    unlink($path);
    }

    return rename($temp, $path);
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Help with SQL Backup / Demo Content’ is closed to new replies.