Geek On The Mountain


Live Entry Preview Plugin for WP


May 29

Posted: under Technology.

I mentioned the other day that I missed the preview entry feature that MT has. It became even more apparent to me that it would be nice to have such a feature when I began to play with future-posting. If I wanted to “preview” my entry (look for far too frequent syntax/logic errors, that is), I had to actually post it, load the site, and then come back and edit the entry, adjusting the timestamp to reflect the time it should actually post at. This was kind of a pain.

At the same time, I manged to fall in love with the Live Comment Preview plugin that shows visitors what their comment will look like once posted, in real time. I put two and two together and decided it would be great to be able to have a live preview for entries.

So I modified the source of the plugin so that it would work with post editing instead. If you want to try it out, just download (use this link instead for the latest version) and then upload (be sure to remove the txt extension it has now) to /wp-content/plugins and activate it. (I didn’t even change the attributes for credits and such that you see in the plugin manager except for the name) Then all you need to do is add the line < ?php live_entry_preview(); ?> to /wp-admin/edit-form-advanced in the place that you’d like it to show up. (try right above the line that says < ?php _e('Advanced'); ?>).

And BTW, you must be using the advanced form for this to work. (This can be set under the options page) As it is right now, it is only setup to use the advanced editor and not the normal one.

Mind you, the code is pretty rough, as far as my modifications go. It works fine, but I’d clean it up before I’d do a whole lot with it.
more_link_text

Comments (1)

Sweet Redirection


May 29

Posted: under Technology.

Awesome. I just found a script that will allow you to redirect all your MT posts to WP. It’s just some PHP code that you stick into an MT template. The template can get the post ID’s and therefore generate a path to the MT archive locations. Then it uses the function that WP uses to generate it’s paths (which is configurable, but I’m using the more or less “normal” setup) for archives using the entry date and title to create a redirect that you can then put into your .htaccess. Very cool!

I probably really don’t need this as I probably don’t have that much in the way of people linking to me, but now I don’t have to bother with going through and changing all of my links to myself… :) As soon as my site backup finishes (just in case, you know), I can delete all of MT. What fun :)

Comments (0)