wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.");
if (!file_exists('config.php'))
die("There doesn't seem to be a config.php file. Please open the sample-config.php, add your Mambo database name and resave it as config.php.");
require_once('../wp-config.php');
//require_once('./upgrade-functions.php');
require_once('config.php');
$guessurl = str_replace('/wp-admin/install.php?step=2', '', 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) );
$action=$_GET['action'];
$id=$_GET['select'];
$category=$_GET['category'];
if ($category == "") {
$category=$_POST['category'];
}
$section=$_GET['section'];
if ($section == "") {
$section=$_POST['section'];
}
$wpsection=$_GET['wpsection'];
if ($wpsection == "") {
$wpsection=$_POST['wpsection'];
}
if (isset($_GET['step']))
$step = $_GET['step'];
else
$step = 0;
?>
You appear to have already installed WordPress. To reinstall please clear your old database tables first.
')); $wpdb->show_errors(); */ switch($step) { case 0: ?>Welcome to the Mambo2WordPress import wizard. With this wizard you can import articles from a Mambo installation to a WordPress installation as long as they're both on the same host.
Since we've come this far, you've already created a config.php file. Make
sure the Mambo database name is okay, then click
through to step one and we'll test to make sure we've got the connections to
our databases.
Okay, we're connected to the Mambo database.
Now, we need to select the method you want to use to import your articles or links. (You should automatically advance to the next step, but if it doesn't you can click the button.)
Query failed"); /*****************************************/ /* Write the form with the section names */ /*****************************************/ ?>Import articles from a whole section:
Import articles from just one category:
Import links from just a category:
Step Two"; $link = mysql_connect("$dbihost", "$dbiuser", "$dbipass") or die("Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $query = "SELECT cat_ID, cat_name FROM `wp_categories`"; $result = mysql_query($query) or die("Query failed"); ?>Select a WordPress category to import from your section.
Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $query = "SELECT cat_ID, cat_name FROM `wp_categories`"; $result = mysql_query($query) or die("Query failed"); ?>Select a WordPress section to import from your category.
".$section."
"; //echo "".$wpsection."
"; /* Make connection to Mambo (exporting) database */ $link = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die("Could not connect"); //print "Connected successfully"; mysql_select_db("$dbh") or die("Could not select database"); /* Performing SQL query */ $query = "SELECT id, title, introtext, `fulltext`, created, modified FROM mos_content WHERE `sectionid` = '$section'"; //echo $query."Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $j = 0; while ($j < $i) { /* Create an acceptable WP post_name */ $post_name = sanitize_title_with_dashes($import[1][$j]); /* Do the actual query */ $query = "INSERT INTO wp_posts (id, post_title, post_content, post_date, post_modified, post_name, post_category) VALUES ('', '{$import[1][$j]}', '{$import[2][$j]}', '{$import[3][$j]}', '{$import[4][$j]}', '$post_name', '$wpsection')"; /* For debugging purposes */ echo "Query failed
"); $j++; } /* Closing connection */ mysql_close($link); ?>Finished!
Go back to the beginning.\n"; break; case 5: require_once ("../wp-includes/functions-formatting.php"); require_once ("../wp-includes/functions.php"); echo "".$section."
"; //echo "".$wpsection."
"; /* Make connection to Mambo (exporting) database */ $link = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die("Could not connect"); //print "Connected successfully"; mysql_select_db("$dbh") or die("Could not select database"); /* Performing SQL query */ $query = "SELECT id, title, introtext, `fulltext`, created, modified FROM mos_content WHERE `sectionid` = '$category'"; //echo $query."Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $j = 0; while ($j < $i) { /* Create an acceptable WP post_name */ $post_name = sanitize_title_with_dashes($import[1][$j]); /* Do the actual query */ $query = "INSERT INTO wp_posts (id, post_title, post_content, post_date, post_modified, post_name, post_category) VALUES ('', '{$import[1][$j]}', '{$import[2][$j]}', '{$import[3][$j]}', '{$import[4][$j]}', '$post_name', '$wpsection')"; /* For debugging purposes */ echo "Query failed
"); $j++; } /* Closing connection */ mysql_close($link); ?>Finished!
Go back to the beginning.\n"; break; case 6: // Select a WP link category to import from the category. echo "Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $query = "SELECT cat_id, cat_name FROM `wp_linkcategories`"; $result = mysql_query($query) or die("Query failed"); ?>Select a WordPress category to import from your section.
Category= ".$category."
"; echo "WPsection= ".$wpsection."
"; /* Make connection to Mambo (exporting) database */ $link = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die("Could not connect"); //print "Connected successfully"; mysql_select_db("$dbh") or die("Could not select database"); /* Performing SQL query */ $query = "SELECT title, url, `description` FROM mos_weblinks WHERE `catid` = '$category'"; //echo $query."Could not connect
"); //print "Connected successfully"; mysql_select_db("$dbi") or die("Could not select database
"); $j = 0; while ($j < $i) { /* Create an acceptable WP post_name */ //$post_name = sanitize_title_with_dashes($import[1][$j]); /* Do the actual query */ $query = "INSERT INTO wp_links (link_id, link_url, link_name, link_description, link_category) VALUES ('', '{$import[1][$j]}', '{$import[0][$j]}', '{$import[2][$j]}', '$wpsection')"; /* For debugging purposes */ echo "Query failed
"); $j++; } /* Closing connection */ mysql_close($link); ?>Finished!
Go back to the beginning.\n"; break; } ?>