Gah. Sorry, pulled some old code on view again. Shouldn’t have.

I’ve had the Avarthrel website up for a while now. It has passed through a couple of different content management systems, and I’ve had to pull some tricks to make it all work nicely together. The annoying thing about the site is that I sort of need to have all sorts of interesting features up there, in case someone might need them.

And here’s the annoying part that the site suffers right now: there’s zero dynamic content. All of the stuff on the site is 100% static stuff, built using webgen. Naturally, this isn’t a big problem with the site: The only real feature that could benefit from dynamicity would be the headline system. I need to run a script every time I write a blog post. But otherwise, it’s all static.

Oh, dammit. The comment system. Forgot about the comment system.

Currently, the site uses DISQUS comments for the few people who have so far dared to comment on the stories and stuff. I would like to do something more flexible. That flexibility would need some code to back it up. Oh, and hooks in the code spat out by Webgen. Which might be fun when Webgen is built for static websites and the code is splurted through bazillion HTML cleanup and sanitization steps.

Oh? I do have a working comment script, which I used with dynamic sites back in God-knows-when. Fairly simple and straightforward bit of a PHP library (with Smarty hooks to be called from the website) and a HTTP POST processor that interfaces with a SQLite database. The database is four tables: pages you can comment on, comments themselves, spam blacklist and configuration. Library basically fetches comments on a given page on chronological order and dumps them on the page. Post script sanitises stuff, checks everything is in order, and adds a row in the database. Damn trivial, huh?

Here’s the annoying thing: Nothing is trivial in software development. The idea of comment script is simple. The fact that I can’t mate the PHP comment display script with the current Webgen-spit code without whipping out a sledgehammer is one of the obvious problems.

“Oh, your software needs an user interface. You know, users can do some crazy things. You need to make sure they don’t attempt to abuse the thing. Oh, and people need to use your app through a static Webgen-generated site. I know it’s slightly damn tricky, but make it happen.”

Oh yeah. Users.

Now, I really wanted the comment script to be a little bit fancy. OpenID is awesome, but I never quite got the OpenID library to work; whenever I looked at the OpenID PHP libraries, they were always quite… tricky to deploy. I hope the situation has changed since 2008 when I last dabbled with this script.

Oh, and now the users want Facebook and Twitter login. People want buttons, typing usernames is so passé. Fine! Buttons it is! I’m willing to implement Twitter login, because Twitter at least does OAuth. (Why they don’t do OpenID remains a mystery to me.) No Facebook. Facebook allows you to log in with OpenID, apparently, but if you want to log in with Facebook credentials, you all of sudden can’t use OpenID for that - you need a proprietary API whose only purpose, it seems, is to facilitate Awesome Buttons for Awesome People (and no OpenID/OAuth compatibility whatsoever). Why did they do that?

…on the SQL side, this means I need to add a couple of fields to the table. Like, service type, service user name and user link. Wait, two of them are already there. Whoopdedo. And display side? Um… some link pretty-printing. Add an icon to identify service type.

But that’s trivial. The user identification problem vastly eclipses the actual stuff that needs to be done on the comment side.

I know, this is a pointless rant and these aren’t even issues that are particularly pressing. I’m just sometimes flabbergasted by how little stuff in software actually does anything interesting. The rest of the code just tries to anticipate how how humans use the system and facilitates that use. It’s kind of silly.

Anyway, I am going to replace the website within the following year with a Drupal 7 backend (D7 just needs to be released and all of the fancy modules I’m going to use need to come out for D7 too), but dammit, that’s going to be far ahead. At that point, comment system actually hosted on the site will probably be reality again.