Tafelmusik

An Illusory Intertwingling of Reason and Response

Tafelmusik is a look askance at life. It is a chronicle of the Dance of the Good Thing, a part in which I strive always to take. Here lie my musings, my thoughts, my beliefs, and my desires. Join me. Dance.

Tafel :: meta :: plugins :: mood

Tuesday, June 21, 2005

Mood v1.1 for Blosxom

Mood: Geeky
Mood: Geeky

Download Mood v1.1

I’ve just fixed a bug which kept the last-declared mood and applied it to all stories after it, until a new mood was declared. Turns out Blosxom’s sub story doesn’t clear any variable associated with it each iteration. It was easy enough to make sure that nothing whatsoever was returned if no mood was declared, though.

So, voiláa! I give you Mood version 1.1. For more details see the original release post.

Mood v1 for Blosxom

Mood: Geeky
Mood: Geeky

Download Mood v1

This is my second Blosxom plugin, but my first “from scratch.” Today at work, in a few minutes, I scribbled out seventeen lines of code which have survived virtually unchanged (and only slightly expanded) in the final plugin. I banged out the whole thing in a couple hours; and if I were a halfway-decent programmer, it’d not even taken me that long.

One thing I would like to add is support for multiple flavour sets. Right now, it is possible to switch between predefined sets by using renamed copies of moodlist.pl and simply changing the require line. I suppose it would be possible to do something like require $blosxom::plugin_state_dir.'/moodlist.'.$blosxom::flavour.'.pl'; but it’s two AM and I want to get to bed. I suppose I’ll add that as an option in v2.

*****

Mood retrieves $meta::mood from a meta-mood tag within an entry file (parsed by Blosxom Plugin: meta) and uses it to provide either a textual or graphical representation of the mood. Requires Blosxom plugin: meta.

$mood::text places a textual representation of any mood tag found.

$mood::img places a textual, and when available, graphical representation of any mood tag found.

Mood images are defined in the file moodlist.pl, included in the distribution, which must be placed in the plugin state directory. Any mood can be linked to an image in moodlist.pl, more than one mood can use the same image, and images stored in different locations can be used.

Technorati