Blosxconfig: PHP Tool To Configure blosxom Plugins

The most common complaints/questions on the blosxom developer’s mailing list all relate to difficulties with plugins, so I have been trying to think of a way to make them a little easier to work with for people. What I came up with is blosxconfig, a single PHP script which works with very basic configuration files to determine what variables a user should have access to and what format they should be in. It will also confirm the existence and readability of the plugin files, and write the modified variables directly into the plugin files.

Download blosxconfig BETA version now!

Here’s the details that I posted to the blosxom list;

WARNING: Back up all you plugins before saving changes via blosxconfig!!!

configure.php is a PHP script (duh!) so you’ll need PHP on your server to run it. You can pass a path to it to look for a specific config file via either a GET or POST request (GET use ?conf=path-to-conf.conf on the querystring, POST use variable name ‘conf’ with a value of a path to a config file). if you don’t pass a value, then blosxconfig will look for a file called blosxom.conf in the same directory as it, or die trying ๐Ÿ˜‰

The config files are very basic, and look a little bit like a Windows ini file, but it’s a custom style; The first line is similar to a unix ‘shebang’ line, and should look like this;

#@/path/to/plugins

where obviously the /path/to/plugins is the full path to where your plugins live – this should be the same as the $blosxom::plugin_dir variable configured in your blosxom cgi executable.

After that line, you have plugin sections which are defined using [plugin_name] – be careful that you use the *exact* name of the plugin, because the value is used for confirming the plugin’s existence ๐Ÿ™‚

Under each plugin section, you define definable variables on a line each, in this format;

variable_name|type|default

variable_name is the actual name of the variable (as written in the script), without the ‘$’ or ‘@’ (in the case of arrays)

type can be one of ‘string’, ‘boolean’ or ‘code’. Arrays should be defined as ‘code’. Strings are enclosed automatically in quotes (“) and all types are followed by a semi colon when written to file. Booleans are presented to the user as a Yes/No select box (0/1 passed as values) and other types are presented as simple text input fields.

default is a value to use by default. make sure this makes sense (so for a boolean make sure it’s 0/1, for a string it’s a string etc). You don’t need to wrap it in quotes or anything, this is handled automatically.


Now, assuming you have a valid config file and blosxconfig can find it, it will load the file, and present you with an interface where you should be able to modify all the values that you spcified as being editable in the config file. *hopefully* blosxconfig will also tell you at this point if plugin files are available (file exists in plugin dir) and if they are not readable or writeable. when you have made you changes – click ‘save’ and the following will happen;

WARNING: Back up all you plugins before saving changes via blosxconfig!!!

  1. All plugin files which are referenced in your config file will be MODIFIED – they will technically be overwritten entirely, since the contents of the file are processed, then the lines that look like they define the variables in question are replaced with new lines, with the new values.
  2. The config file will be updated with the new details that you specified and written back to file.
  3. blosxconfig will load again, with all your new values in place, and messages telling you what happened.

Assuming all goes well, you’ve just used an external interface to reach into your plugin files and modify certain details. The hope is that authors of plugins (or community-minded participants) can supply the simple, 1 – 10 lines worth of config required to add to this configuration file, which can then be distributed with this little application to help people configure their plugins.

Please be aware that I have *NOT* tested this extensively at all, it was hacked together and seemed to work for a couple of plugins that I was running (the ones in the config file included) on a Windows test box, other than that I can’t make any promises. I’d LOVE if some people could try it out on some other plugins, on other systems, and let me know (directly if
you like) how it goes. I’ll fix any problems and then release it as public so that other people can use it.

Hope it’s useful for someone out there, and can perhaps eventually make life easier for some newbies (and pro’s alike ๐Ÿ™‚

Oh yeah – did I mention; BACK UP YOUR PLUGINS BEFORE YOU TRY THIS!

On the suggestion of Andreas Banze, I’ve removed one small section which checked to make sure that the plugin files were executable, since as he pointed out, this is not necessary, they are just included in the main operation of the blosxom script, not executed individually.

Download blosxconfig BETA version now!

Modification to Permalinks

I’ve modified the format of my permalinks so that they use the dynamic, blosxom-controlled, date-based URLs again, because in the near future I will be completely re-arranging my structure, since unfortunately it is proving to be inadequate for the range of topics I’d like to post about.

More information to follow regarding the changes, but I don’t imagine it will cause too many problems with too many people ๐Ÿ™‚

blosxom Plugins Online Again

In case you didn’t notice, all my blosxom plugins are working again!

Now that that is taken care of (ended up being a naming conflict within a plugin), I can eventually get around to doing what I had actually intended on doing, which is upgrade to the official release verion 2.0 of blosxom, and then implementing some more plugins to create better RSS feeds and probably sub-topic menus within the templates to aid in navigation of the sections.

Thanks to phpwebhosting.com (my web host) for giving me access to an error_log, even if it’s only a shared one across the whole server ๐Ÿ™‚

Karma 0.3 Already

Well, Fletcher has been flying away at the karma plugin we discussed and has got a version 0.3 going already. This one
has the following features;

  1. Show number of visits/votes
  2. Show positive and negative votes
  3. Show Controversy Index
  4. Show Karma Index
  5. Show Visits Index
  6. Only show posts with minimum of ‘x’ for;
    1. Karma
    2. Controvery
    3. Interest

You can download karma 0.3 and drop it in as a plugin immediately. It’s pretty self-explanatory if you understand the concept. To figure out the way that controvery and interest are calculated – have a look in the code for now, I’ll post the formulae when I get a chance ๐Ÿ™‚

New Plugin Coming

I emailed the blosxom mailing list and suggested a new plugin, which I am just calling “karma”. The idea was to allow people to click a + or – and indicate if they thought a post was good or not. This is similar to the system used on some other sites.

I got an email back from Fletcher Penney, who said that he’d develop it, and half an hour later we were chatting on MSN about the details. He’s already knocked out 2 draft versions and we are sorting out some great stats and uses for the information!

blosxom and its developer-community rules!

Got Some Flavour For You

Here’s the flavour files and style sheets that I use for this blog. Please note that they have been modified slightly (story.dr especially) since I am using a “custom” version of blosxom, with some Apache Rewrites to handle my URLs in a prettier way than normal ๐Ÿ™‚ This may or may not have worked, so you might need to play around a little with that one file. Also, you will probably want to modify the paths to the style sheets in head.dr so that they are full paths, or at least root-relative (which is what I use, if you are interested).

Also please note that I am using these plugins, so there are references to their output in the flavour files;

  1. writebacks
  2. calendar
  3. breadcrumbs

That’s it – unzip and enjoy! I’ve named the flavour files *.dr to avoid overwriting any of your existing flavours, so that shouldn’t be a problem for you either ๐Ÿ˜‰

Well, Here Goes Nothing

This is my first post to my new blosxom-powered web log using webpad. Hopefully this will work, and all will be well.

I think webpad offers a great way to manage a blosxom-powered blog remotely, since it offers a few easy-to-use HTML tools, while modifying the file directly on the server, which is just where blosxom wants them ๐Ÿ˜‰

So — PortaBlosx

I was thinking, blosxom is very cool, but I’d like to be able to do a few things in regards to getting something on my blog when I am out and about;

  1. Be able to post from anywhere (i.e. I want a web-based interface of some sort)
  2. Be able to post from my Palm (I built AvantBlog for this reason, why not have AvantBlosx? ๐Ÿ™‚ )
  3. A nifty little dialog-thingo allowing me to make quick posts (very similar to the Palm version) would be nice as well, something I could bookmarklet easily.

So I had a look around, and the first one appears to be pretty much available already, care of PHPetal. After that tho, there doesn’t appear to be a simple, clean interface available that could be hacked to use on Palm and as a simple little bookmarklet dialog.

My idea is basically to just provide the person with a very simple interface, at this stage it would consist of a select box containing a recursed listing of their blog directories, and a textarea where they could enter their post. As per blosxom, the first line would be used as the title, and I would either make up a filename based on the title, or just generate one from a timestamp.

What do you reckon?

PHPetal is pretty cool

I think (can’t remember already – it’s been a long day!) I found this one care of a lead from the blosxom mailing list, but here’s a cool, web-based application which operates very similarly to the “PortaBlosx” idea that I am still thinking of working on. It’s called PHPetal and basically just provides a one-page interface to posting to your blosxom-powered blog. It looks pretty funky, although it’s a bit “heavy” for converting to a Palm version I reckon, so I will keep thinking about my own, simple version.