Redesigning the Blog

This blog uses the very lightweight CMS Anchor. Now, when I set it up, I googled 'lightweight PHP blog', clicked the first link, and installed it. However, in retrospect it probably wasn't the greatest idea. For one, while Anchor is on version 0.9.2, and says in multiple places that it's still in development, work began on 1.0 over a year ago, and it looks like it's relatively dead. One result of this is there are a bunch of features that are missing or broken. Also, the basic themes are a little rough.

So, I started putting together my own theme. I cobbled together pieces of a couple of themes (namely Snowly and Dockyard), to create this theme, which I call 'Folium'. However, there were a fair amount of problems. For one, my experience with the CSS3 @media tag is rudimentary at best, so that was a fun challenge. The largest problem, however, was the 'search' functionality.

I wanted it to search for the text as well, not just the header. That was relatively easy, but still took a while. The larger problem was how Anchor encoded characters. It sanitized it (probably because its MySQL queries are criminally broken) but in a way so that single quotes would be encoded as '. This would be okay, except this was then passed in the URL. Now, any time there's a hash character in the URL, anything after it is treated as client side (only JavaScript can access it), so the server won't be able to search it. So, I had to track down how it encoded it, and change it, and then escape it so that it would work in the code I wrote to search the database and by that time it was 4 in the morning. At least I'm happy with how it looks now! The moral of the story is: think twice about using Anchor.