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(); ?>
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:
(all others should be unselected)
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.
Please be patient. Don't hit reload! The conversion progress should be showing below.
"; echo "Authors: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; } } ?>