Neil Turner's Blog

Blogging about technology and randomness since 2002

Cross-posting from Movable Type to LiveJournal, part II

Yesterday, I told you how to get your Movable Type blog cross-posting to LiveJournal, but at the moment it only sends across the entry and title. Today I’ll show you how to get it posting your current mood and what music you are currently listening to, like you can using the LiveJournal interface.
To do this, we’re going to use RightFields, an incredibly powerful plugin from Kevin Shay which lets you add extra fields to your MT entry screens and use the fields in your templates. The plugin is shareware, so if you decide to keep it then you should pay Kevin $15 (for personal use), but it’s such a great power-user plugin I’m sure you’ll see that it’s worth it. You’ll also need to be using Movable Type 3.2 for this step – using ljcrosspost on its own will work on older versions, however.

1. Download and install RightFields

Because Kevin has documented the installation of RightFields in a high level of detail, we’ll just cover the basics here. Download RightFields and extract it somewhere, then upload all of the files to your Movable Type directory. Go into the MTDIR\plugins\RightFields folder and change the permissions on mt-rightfields.cgi to 755 so that it is executable.

2. Configure RightFields

Go to your main Movable Type menu and click on Plugins, then choose RightFields and then your blog from the list. Select the Extra Fields tab, and then Update to use PluginData (this option is explained in more detail in the documentation but this is the easiest option for now). Create two new fields – I called them ‘Mood’ and ‘Music’, and give them labels ‘Current Mood’ and ‘Currently Listening To’. You can leave the other options as is. Click Save Changes.
Now select the Template Tags tab. In the first two drop-down boxes, select ‘Current Mood’ and ‘Currently Listening To’ respectively, and then give them the tag name (on the left) of ‘EntryLJMood’ and ‘EntryLJMusic’ respectively. Click to save changes.

3. Re-configure ljcrosspost

We now need to change the code we added to cross post entries yesterday. Open the template where you pasted the code yesterday and find the line. We now need to change it to the following:
<MTExtraFields><$MTLJCrosspost user="melody" pass="573ad19d284b4fd9d735c99dc94af893" mood="[MTEntryLJMood]" music="[MTEntryLJMusic]"$></MTExtraFields>
Now, when you create a new entry, you’ll have extra fields for your current mood and what you are currently listening to, and these will appear on your LiveJournal entries.

Going further

If you have multiple pictures on your LJ account, you can do the same with those – create another field for the picture keyword and then add ‘picture=”[MTEntryLJPicture]”‘ (or equivalent) to the <$MTLJCrosspost$> tag. You can also change the mood field to be a drop-down menu of common moods, like on the LiveJournal post screen.

2 Comments

  1. Okay, here’s an addendum. When I posted my first attempt, I got an error that my entry date and time was earlier than the present date, and I would have to “backdate” my entry.
    Building entry ‘Sigh’ failed: Build error in template ‘Individual Entry Archive’: Error in tag: LJ.XMLRPC.postevent: Fault returned from XML RPC Server, fault code 153: Incorrect time value: Your most recent journal entry is dated 2006-05-18 15:58, but you’re trying to post one at 2006-05-18 14:35 without the backdate option turned on. Please check your computer’s clock. Or, if you really mean to post in the past, use the backdate option.
    I modified my MTLJCrosspost field in the Individual Entry Archive to include prop_opt_backdated, which is what the web-form for LiveJournal uses for a variable name, and it works for new entries.
    However now I cannot rebuild any entries prior to those created with this entry in the field, or it fails with the same message above.
    Any ideas?

  2. I kind of got around this by deleting the recent entries from the LJ then rebuilding the entries one by one in chronological order (oldest first). That didn’t throw the error although I’ve had a problem on the most recent few.