Lexicon WordPress Plugin v1.1

By Shamus
on May 27, 2006
Filed under:
Programming

I’ve been thinking more about the wordpress plugin I released a few days ago and how to improve it. This project started with this post at haibane.info, where Fledgling %Otaku talked about making a blog useable for for people familiar with your subject matter and at the same time making it accessable to newbies.

I wanted a plugin that would provide dictionary links for all of the jargon on my site but wouldn’t require any extra effort on my part (because I’m big on energy conservation, particularly my own) and that wouldn’t clutter up my posts with HTML tags.

The first try was a little rough. Fledgling %Otaku has some good suggestions for using wiki-style tags which I really liked at first, but I moved away from this for a few reasons:

  1. Using wiki tags would mean going back and adding those tags to old posts, or accepting that the jargon on old posts would remain . Meh.
  2. There are already plugins that use wiki-style markup tags, and I may want to use them someday. Right now I could combine the two with no conflicts, but if I adopt wiki standards then those plugins with conflict with my own.
  3. If for whatever reason I drop usage of the plugin in the future, my posts would suddenly be filled with brackets and markup text. I’m very commitment-shy when it comes to software, even stuff I’ve written myself.

I realized I could parse things much better if I used some PHP 5-specific code. I honestly don’t know if this is a problem or not. This site has been running on PHP 4.4 and I had to request that Hosting Matters (my host) move my site to a machine with PHP 5. (Which they did quickly and seamlessly, BTW.) I have no idea how widespread PHP 5 is or how much this will limit the usefulness of the plugin to others. PHP 5 has been out for nearly two years, but there are still some holdouts, and I assume they have good reasons for this. Comments on this are welcome.

Using PHP 5 I was able to eliminate almost all of the shortcomings of the original version. It won’t insert unwanted spaces. It will pick up links even if they are bracketed by HTML tags. It WON’T mess with keywords that are inside of HTML tags. It won’t mess with the case usage of the original word.

The only bit of markup I did add was that you can now preceed a keyword with a percent to prevent it from becoming a link. This enables me to say, “Fledgling %Otaku is one of my favorite otaku”, and not have his name become a link to my dictionary.

For those interested, you can download the plugin here.

Enjoyed this post? Please share!


8Eight comments? Nobody's THAT hungry.

From the Archives:

  1. ubu roi says:

    I’m still on PHP 4.4.1; I would have to get moved also. Not sure my little ol’ blog is worth the trouble. :-)

  2. Are you still working on this plugin?
    I get this error when I activate it :(
    I am running WordPress 1.5.1.2
    What am I doing wrong?
    Help me please!

  3. Shamus says:

    Without seeing the error it’s hard to know what the problem might be. I suspect that you are not using PHP 5.0. There probably isn’t much you can do about this.

    I am still working on a new version, but I don’t have a release date for it yet. Sadly, it probably won’t fix your problem.

  4. Hi all great information here and good thread to comment on.

    Can I ask though – how did you get this picked up and into google news?

    Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?

    Obviously this is a popular blog with great data so well done on your seo success..

One Trackback

  1. By Reviewing Webonary | The Journeyler on Thu Mar 7, 2013 at 9:18 pm

    […] Where it can be found: http://www.shamusyoung.com/twentysidedtale/?p=419 What it […]

Leave a Reply

Comments are moderated and may not be posted immediately. Required fields are marked *

*
*

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun.

You can enclose spoilers in <strike> tags like so:
<strike>Darth Vader is Luke's father!</strike>

You can make things italics like this:
Can you imagine having Darth Vader as your <i>father</i>?

You can make things bold like this:
I'm <b>very</b> glad Darth Vader isn't my father.

You can make links like this:
I'm reading about <a href="http://en.wikipedia.org/wiki/Darth_Vader">Darth Vader</a> on Wikipedia!

You can quote someone like this:
Darth Vader said <blockquote>Luke, I am your father.</blockquote>