Images for Whird

Last night, I pushed up some small changes to Whird. Basically, I have altered the main database table ‘whird_content’ to include an additional field. The new field is just a standard varchar, but it is named ‘_image’, with the idea being that any post or page could have the URL of an image associated to it.

I was hesitant to make this change as I do not like to play around with Whird’s database structure too much, but in the end I decided that it would make a good addition; not only could it be used to display images within a site, but it can also be used within a site’s metadata, e.g. Open Graph tags.

I think this is the first change I have made to Whird’s database structure since finding out that I am not the only person using it. I am fairly confident that I have accommodated any existing Whird installations and hopefully there should not be any breakages.

For new installations, the ‘_image’ field will not appear within Whird’s main edit form, unless the ‘hide_edit_form_image’ key-value pair is deleted from the $whird_conf_extras array. In reverse, existing users can hide the field by creating the same key-value pair.

Note, it has occurred to me that I could simply add an additional field to the ‘whird_content’ table for storing an array’s key-value pairs, which would then mean a user could have an unlimited number of extra fields to play with; however, I am holding off from doing this as I cannot think of a way of implementing it nicely without using some client-side scripting, which I have so far managed to avoid. If anyone finds my thinking cap, please let me know.

In completely unrelated news, I went paintballing with some good friends at the weekend. I had a blast and it was really fantastic to see my old school friends again, before attempting to shoot them. I had not seen some of them for 5 or more years, but I felt completely at home in their company — I guess that is the measure of good friendship, even if they do shoot you in the neck, twice! :)

Tagged with: paintball, whird

Add your comment

Use the form below to add your comment. Markdown syntax is available. Note, all comments are moderated.