Spring Cleaning

An attempt to give my website a bit of spring cleaning has resulted in several new WordPress plugins.

The first is Tidy Up, which adds the ability to run HTML Tidy through all your posts and comments and produce a report on the quality of your HTML. If you’re feeling brave you can also have the plugin automatically fix any problems.

Next is Search Regex. As the name would suggest, this is a search and replace plugin. It allows you to search and replace phrases inside posts, pages, comments, and meta-data. In addition to plain text searches, you can also use full PHP regular expressions. This makes it very easy to bulk-modify a WordPress installation, should you decide to move directories. Several other similar plugins exist, but I couldn’t find one that provided the regular expression capability that I needed.

Giraffe2 – Wonky edition

Four months into the new year and a total of 2 posts. Not so good. I was working on a new version of my Giraffe theme that would allow all the page elements to be dragged around the screen, but it was taking too long and I just didn’t have time to finish it. Instead, I cleaned up what I already had, made it WordPress 2.0 compatible, and dropped in a few new features. Now presenting Giraffe2 – the slightly wonky edition.

The design remains largely the same. There are a few cosmetic changes, such as cleaning up header fonts, but the majority of changes are to increase configurability. To summarize them all:

  • WordPress 2.0 only
  • Supports WordPress widgets
  • Options page now in the ‘Presentation’ section
  • Layout can be configured to contain from 1 to 3 columns, in different sizes
  • Dynamically generated CSS is separated from static CSS (so if you do customize the theme you won’t get annoyed when it starts over-writing all your code)
  • AJAX comments support
  • Footer content can be edited
  • Logo is fully configurable, with a live-update feature – upload your own logos and background, and change sizes and positions
  • Colour skins can now be plugged in
  • Top navigation menu is configurable

AJAX Calendar

After all the hype and bubble-blowing, I decided to dip my little pinkie into the mix and experiment with AJAX. The result has been the release of a new plugin, cleverly titled ‘AJAX Calendar‘. Once installed this allows the standard WordPress calendar function to be enhanced such that:

  • Stepping through the months is now asynchronous, and only updates the calendar
  • Clicking on the calendar title takes you back to the current month
  • Clicking on the funny «-» button will expand the calendar and display the posts headings for that month
  • All content is cached
  • Works in most browsers

The plugin requires modifications to the WordPress theme, although these modifications have been included in version 1.23 of the Giraffe theme.

Have a play.

Giraffe 1.20

It’s been such a long time since I’ve posted anything here, and this is just going to be a technical post. Based upon feedback from different users, and the general direction of questions, I’ve released quite a major update of the Giraffe theme and plugin. The changes are:

  • Major overhaul of the admin interface – redundant options have been removed, and the interface has been simplified. Where possible I have used diagrams to show what the configuration options will change
  • Easy logos – a ‘logo’ directory now exists within the giraffe theme, and any image placed within here can be selected as the logo by using the admin interface. Additionally, two extra options exist to allow the logo to be randomly selected, and a custom function can be created to select a logo using whatever method you wish
  • Auto-news – the admin interface will now periodically check this website for changes to the theme, and will display this from inside the admin interface. This should make it easier for people to know when the theme has been updated
  • Curved corners and the left bar can be switched off
  • Comments order – comments can be displayed oldest first, or newest first
  • Gravatars – can be disabled
  • Calendar – can be disabled
  • Localization menu – now built into the theme
  • Most W3C validation errors fixed

A side effect of these changes will be that a lot of the administration interface is no longer localized properly. Hopefully it shouldn’t be too long before the new words can be translated.

More posts soon.

HTTP 406 Error

Some work I’ve been doing recently has involved debugging a Mambo installation. The website had developed the curious ability to block the editing of certain articles, but allowed other ones through. These blocked attempts to save articles were resulting in a ‘406 Not Acceptable’ error.

According to the W3 specification, this means:

The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

Say what?

Japanese theme

Another addendum to the Giraffe theme, with a Japanese localization courtesy of Tai. The .mo file can be found on the Giraffe page, and the WordPress localization file on the WordPress localization page. Test it out from the sidebar Localization menu.

Thanks once again to Tai.

It’s all Greek and Japanese to me

Thanks again go to Tai for his translation of the second part of the Theme Guide series into Japanese. Great work!

Also, Simos Xenitellis has produced a Greek localization for the Giraffe theme. You’ll need the .mo file for the theme, and the .mo file for WordPress (taken from this Greek translation website and converted into a .mo file). Check it out from the Localization menu in the sidebar of this website, or visit his website for the full effect. Thanks Simos!

Adding a localization menu to WordPress

You may have noticed a small drop-down menu labelled ‘Localisation’ in the sidebar of this blog. It’s something I’ve been playing about with since localising the Giraffe theme and, while it doesn’t magically translate the entire blog, it does provide a viewer with a simple method to change the locale.

But what is a locale? In WordPress terms it refers to the framework around which your posts are displayed. That is, the words, phrases, dates, and times, that surround your posts. For example:

ItalianSpanishChinese

Try the live version now, if you want. You’ll need a Chinese font to display the Chinese localisation, but the others should work fine.

Pinyin converter

I’ve added a small Pinyin converter to the InScript plugin. Pinyin is a method of transliterating Chinese characters into the Roman alphabet. As Chinese is a tonal language, it is important that these tones are included in the pinyin. This is achieved through the use of accents and other marks over certain vowels.

The reason for the converter is that these accents are not easy to type, especially for people with keyboards in an accent-less language (i.e. English). It is possible to enter the characters using some form of character mapping tool, or by entering the HTML code directly, but this is not an intuitive method.

Instead, a popular technique used on many websites is to write the tone as a number. For example, zhong1guo2 would indicate that the ‘o’ in zhong needs the first tone applied, and ‘o’ in guo needs the second. While this is an easy method of entering the text, it does not look good, and is another layer to understanding the tones themselves.

Giraffe in Italian and Spanish

A big thanks to Stefano Aglietti and Mario Núñez Molina for providing localizations of the Giraffe theme in Italian and Spanish. I’ve added a small localization selector in the sidebar so that people can change the theme language and see what it looks like. It doesn’t translate the posts, but it provides dates and other phrases in the chosen language, making for a better experience for non-English speakers.