isLoggedIn()) { convert_showLogin('livejournal.php'); } if (!$member->isAdmin()) { convert_doError('Only Super-Admins are allowed to perform blog conversions'); } $ver = convert_getNucleusVersion(); if ($ver > 210) convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation."); // include PRAX lib (to read XML files easily) include ('PRAX.php'); switch($action) { case "assignMembers": bc_assignMembers(); break; case "showOverview": bc_showOverview(); break; case "doConversion": bc_doConversion(); break; case "login": // drop through default: bc_getlivejournalID(); } // step 1: get the Blogger Blog ID function bc_getlivejournalID() { global $HTTP_SERVER_VARS, $PHP_SELF; convert_head(); ?>
Note: This conversion tool was written for LiveJournal blogs.

Step 1: Exporting to a file

The first step in the conversion is to export one month's Live Journal entries into one single file. This can be done with an export tool you can read about in the LiveJournal.com F.A.Q. here. The export tool itself can be found here. The settings you will need are as follows:

Save the resulting file as ljent.xml.

Importing

Now you have a file called ljent.xml. Upload it in the same directory as the convert files (/nucleus/convert) and continue to the next step.

Step 2: Assign Members to Authors

Please assign a Nucleus Member to these entries.

openfile('ljent.xml'); $blog->record_delim = 'entry'; $blog->parse(); $blog->close(); // close the file $idx = 0; { ?>
Blogger Author Nucleus Member Blog Admin?
default

Choose Destination Weblog

There are two options: you can either choose an existing blog to add the Live Journal entries into, or you can choose to create a new weblog.

Do the conversion!

Note: Clicking the button once is enough, even if it takes a while to complete.

Step 3: Converting...

Please be patient. Don't hit reload! The conversion progress should be showing below.

"; echo "Authors:
"; for ($i=0;$i<$authorcount;$i++) { echo "\tAuthor=" . $author[$i]; echo " ID=" . $memberid[$author[$i]]; echo " ADMIN=" . $isadmin[$author[$i]]; echo "
"; } echo "Create New Weblog = $createnew (name='$newblogname', owner=$newowner, dest=$nucleus_blogid)
"; echo ""; // create blog if ($createnew == 1) { // choose unique name $shortname = 'blogger'; if (Blog::exists($shortname)) { $idx = 1; while (Blog::exists($shortname . $idx)) $idx++; $shortname = $shortname . $idx; } $nucleus_blogid = convert_addToBlog($newblogname, $shortname, $newowner); echo "
New blog created
"; } // add authors to blog team $b =& $manager->getBlog($nucleus_blogid); global $catid; $catid = $b->getDefaultCategory(); for ($i=0;$i<$authorcount;$i++) $b->addTeamMember($memberid[$author[$i]],$isadmin[$author[$i]]); // 3. go through ljent.xml file $blog = new RAX(); $blog->openfile('ljent.xml'); $blog->record_delim = 'entry'; $blog->parse(); while ( $entry = $blog->readRecord() ) { $row = $entry->getRow(); bc_convertOneItem($row, $memberid, $nucleus_blogid); } $blog->close(); // close the file echo "
All done!
"; convert_foot(); } function bc_convertOneItem($row, $memberid, $nucleus_blogid) { global $catid; $nucl_id = $memberid[$row['author']]; $timestamp = date("Y-m-d H:i:s",bc_transformDate($row['eventtime'])); echo "
";
	echo "entry:" .  Entity::hsc(substr($row['event'],0,20)) . "...(time: " . $timestamp . ") \n";
	echo "author: " . $row['author'] ;
	echo " (nucleus-id: " . $nucl_id . ")";
	echo "
"; $title = $row['subject']; // use the title when it is in the XML file convert_addToItem($title, $row['event'], '', $nucleus_blogid, $nucl_id, $timestamp, 0, $catid, 0, 0); } function bc_transformDate($eventtime) { // 2003-07-03 23:59:00 if (eregi("(.*)-(.*)-(.*) (.*):(.*):(.*)",$eventtime,$regs) != false) { return mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]); } else { return 0; } } ?>