// Nuke2MT
// Export script from nuke stories and comments to Movable type Import Format
// Useful when migrating from a Php Nuke to Movable Type.
// Created and never copyrighted by matteoc
// http://w.skipintro.org
// Config
$dbhost = "localhost:3306:/tmp/mysql.sock";
$dbuname = "username";
$dbpass = "password";
$dbname = "databasename";
// Connection
mysql_pconnect($dbhost, $dbuname, $dbpass);
@mysql_select_db("$dbname") or die ("Unable to select database");
// Stories routine
$result = mysql_query("SELECT stories.sid, stories.informant, stories.title, stories.hometext, stories.bodytext, stories.comments, stories.topic, DATE_FORMAT(stories.time,'%m/%d/%Y %r'), topics.topictext FROM stories INNER JOIN topics ON stories.topic=topics.topicid");
while (list($sid, $author, $title, $body, $extendedbody, $bcomments, $topic, $time, $topictext) = mysql_fetch_row($result)) {
if ($author=="") { $author = "Anonimo"; }
echo "AUTHOR: ".$author."\n";
echo "TITLE: ".$title."\n";
echo "DATE: ".$time."\n";
echo "CATEGORY: ".$topictext."\n";
echo "STATUS: publish\n";
echo "ALLOW COMMENTS: 1\n";
echo "ALLOW PINGS: 1\n";
echo "CONVERT BREAKS: 0\n-----\n";
echo "BODY:\n".$body."\n-----\n";
echo "EXTENDED BODY:\n".$extendedbody."\n-----\n";
// Comments routine
if ($bcomments>=1) {
$comm_result = mysql_query("SELECT name, host_name, subject, comment, DATE_FORMAT(date,'%m/%d/%Y %r') FROM comments WHERE sid = '$sid'");
while (list($author, $ip, $subject, $comment, $date) = mysql_fetch_row($comm_result)) {
if ($author=="") { $author = "Anonimo"; }
echo "COMMENT:\n";
echo "AUTHOR: ".$author."\n";
echo "IP: ".$ip."\n";
echo "DATE: ".$date."\n";
echo "\n$comment\n-----\n";
}
}
echo "--------\n";
}
?>