Migrate posts from phpnuke to WordPress

  • Unknown's avatar

    I have migrate my old phpnuke website to wordpress using this script
    You can check the result on http://www.eyesonsky.com/


    /*------------------------------------------
    2009 Joel Brueziere
    Migrate posts from phpnuke to WordPress
    ------------------------------------------*/

    <?php

    $sql="";

    $dbhost = "yourhost";
    $user = "youruser";
    $password = "thepass";

    $conn = mysql_connect($dbhost,$user,$password);
    //echo "[conn=$conn]
    ";

    $sql="select sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, ihome from stories";

    if($conn){
    $result = mysql_query($sql);
    echo "[result=$result]
    ";
    $nb = mysql_num_rows($result);
    echo "[nb=$nb]
    ";

    while(list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes, $ihome) = mysql_fetch_row($result)) {
    echo "----------------------------------------------------------------------
    ";

    $title = addslashes($title);
    echo "
    title=$title
    ";
    $hometext = addslashes($hometext);
    echo "
    hometext=$hometext
    ";
    $bodytext = addslashes($bodytext);

    $sqlinsert="INSERT INTO wp.wpfr_posts (
    ID ,post_author ,post_date ,post_date_gmt ,post_content ,post_title ,post_excerpt ,post_status ,comment_status ,ping_status ,
    post_password ,post_name ,to_ping ,pinged ,post_modified ,post_modified_gmt ,post_content_filtered ,post_parent ,guid ,menu_order ,
    post_type ,post_mime_type ,comment_count
    )
    VALUES (
    $sid , 1, ‘$time’, ‘$time’, ‘$hometext <!–more–> $bodytext’, ‘$title’, ”, ‘publish’, ‘open’, ‘open’, ”, ”, ”, ”, ‘$time’, ‘$time’, ”, ‘0’, ”, ‘0’, ‘post’, ”, ‘0’
    );
    “;
    $insert = mysql_query($sqlinsert);
    echo “
    insert=[$insert]
    “;
    }

    if($result){
    }else{
    echo “
    sql=$sql

    “;
    echo “error mysql_query
    “;
    }
    }
    else{
    echo “
    conn=$conn
    “;
    echo “
    sql=$sql
    “;
    echo “error connect db”;
    }

    ?>

  • Unknown's avatar
  • Unknown's avatar

    Afraid none of that applies and you’re in the wrong forum. You need to be at wordpress.ORG. We at WordPress.COM do not have access to the php.

  • The topic ‘Migrate posts from phpnuke to WordPress’ is closed to new replies.