Installation
Just drop the .PL file in your plugins folder and chmod 755. If you don't have a plugins folder, create one in the same folder as the mt.cgi file.
What It Does
If you're porting a LiveJournal to MovableType, this will make the transition all the more easier.
This MT plugin contains a text filter that translates most LiveJournal-specific tags, and formats your entry according to normal LJ practice. That is, anything inside <lj-raw></lj-raw> gets left alone, and anything outside gets a <br> appended to the end of each line.
Current LJ Tag Conversions:
<lj-cut> tags are handled with JavaScript, providing a link that can be clicked on to expand the cut text. See the "Customization" section below for more information.
<lj user="whoever"> becomes a simple text link: whoever.
<lj comm="group"> becomes a simple text link: group.
<lj-poll> tags becomes a text link to the poll at LiveJournal.
<lj-phonepost> tags become links to the audio file at LiveJournal, along with the (hotlinked) phone image.
<lj-template>video URL<lj-template> tags become standalone video players. (This is feature may not be completely reliable as I cannot test it very well.)
URL Conversions:
lj:// URLs in anchor (link) tags are converted into the appropriate LiveJournal website, as shown below.
| lj://user/username/ | username's LJ |
| lj://user/username/any_extra_info | Specific Page on username's LJ |
| lj://userinfo/username/ | username's Profile |
| lj://userpics/username/ | username's Userpics |
| lj://memories/username/ | username's Memories |
| lj://todo/username/ | username's Todo List |
| lj://pubkey/username/ | username's Public Key |
| lj://support/123/ | LJ Support Request #123 |
| lj://support/ | LJ Support Page |
| lj://faq/123/ | FAQ #123 |
| lj://faq/ | LJ FAQ |
| lj://blahblah_makesnosense/ | This link remains broken. |
Customization
There is a setting (accessible via the plugins page in your MT installation) that allows you to input your LJ username. This is only necessary for converting LJ phone posts. If you don't post via the phone, you don't need to worry about it.
v1.1 introduced the ability to add a class and/or a style to <lj user="whoever"> tags.
LJ-Cut
v2.0 introduced a new way to display <lj-cut> tags, which superficially resembles the way LiveJournal handles them.
The text within the lj-cut tags is hidden, replaced by a text link. LiveJournal's default is to use the words "Read More" in these links, but you can specify a different phrase within the lj-cut tag: <lj-cut text="Replacement phrase">.
In LJ, clicking the "Read More" link takes you to a separate entry page where the full text is displayed. In this plugin, clicking the link launches some javascript that hides the link, replacing it with the cut text.
The customization screen allows you to change the default "Read More" text, a few other formatting choices, or to turn this option off altogether. If you turn this off, the lj-cut tags are simply stripped and the cut text is displayed without the "Read More" link.
If a user's browser cannot handle the javascript, or if javascript is turned off, everything should fail silently: the "Read More" link does not display and the cut text is shown automatically.
To-Do
I'll get around to the new <lj-template> tag at some point. It appears to be for videos, but only from certain sites. (It also appears to be forward-compatible for including other things besides videos, but that obviously will come later.) I'm not much of a web-video person myself (due to lack of bandwidth), so I'll have to figure this stuff out later.
Version History
v1.0 - Original version. [7 April 2006]
v1.1 - Added <lj user="whoever"> customizations. [20 June 2006]
v1.2 - <br> tags no longer added to the insides of <pre></pre> containers. [25 June 2006]
v1.21 - Added some error-proofing to <lj user="name"> tag tanslation (lack of quotes in tag, underscores in the username). Added support for the deprecated <lj comm="community"> tag. Added support for lj:// web addresses. [31 July 2006]
v1.22 - Refined lj:// support. Added more documentation to the source code. [5-August-2006]
v1.23 - Fixed a bug in lj:// support. [15-September-2006]
v2.0 - Added a new option to handle <lj-cut> tags. [7-October-2006]
v2.01 - Fixed a bug in the lj-user tag display. [7-October-2006]
v2.02 - Fixed a small bug in the config screen. [17-December-2006]
v2.1 - Rudimentary support for the LJ-Template tag. [4-March-2007]