Lysis blog

8th May 2010

A new comment system

All blogs 'ought' to allow comments, but up to now mine has not.
I figured that these were my options:

  1. Don't allow comments at all;
  2. use standard accounts;
  3. keep comments entirely anonymous, or
  4. do something a bit clever.

Option (1) is boring, (2) needs a database for the accounts and (3) would negate any chance of a community, so of course I went with the last option.

For several reasons I decided against using an out-of-the-box blogging system - which meant building my own commentary system. This does mean I can get exactly what I want, and has the fringe benefit that I learn more in the process.

I didn't want it to need a lot of processing to display a page, or maintainance, so it shouldn't need a database - at least, not one which stores individual messages.
I didn't want to require registation to post, since this deters people from posting.
On the other hand, I didn't want there to be no user recognition at all - for a community to work individuals need to recognise each other.
Furthermore, I want to avoid falling afoul of privacy law, specifically the Data Protection Act.


Hidden identity - hidentity

The advantage of accounts is basically that users can tell each other apart.
A community of active users is much less likely when full anonymity is enforced. But that doesn't mean that you have to know their full identity - just a simple 'handle' is enough.
Of course you can have accounts which are anonymous - that is, which don't hold email addresses etc.. But you will still need a database of some description to hold the usernames and passwords.
However, if you allow people to post without a password, you open up the possibilies for malicious users to pretend to be other community members, with unfortunate consequences.

So what is needed is something in-between. For regulars to be able to confirm that they're a particular poster, but without the initial burden on everyone of creating an account.
This turns out to be easily possible. One simply takes a password, create a hash of it (a one-way process), and then post that along with the name and comment.

The problem with that is of course that noone pays attention to random strings of letters or numbers. This too is easily solved by converting the hash into some human-memorable form. I've chosen the multiple-word phrase approach, and also select the comment background from a range of colours.
For the hidentity phrase, I decided on a three-word phrase of the form A B C, where A is a positive attribute, B is a (possibly incongruous) adjective and C is a creature of some sort. I've tried to pick words which won't insult anyone, and hope everyone will be happy with whatever they get assigned.
If you are making a similar system, I suggest trying to pick maximally distinct words. If the words are similar either in spelling or concept, people will mix them up. If your site has a particular theme you could work towards it. The word-lists don't have to be the same length; if you think one position in the phrase is more memorable then that could be longer.


In practice

So that was the theory.
Regarding the actual methods, I'm using server-side scripting to attach the comments and entry-form to the bottom of the article pages. The fun here was getting the included file to know the main file's address, so it can be passed on during submission.

The comment submission uses php to validate and append the comment to the bottom of a comments list. I like this approach because it means that adding comments to the article page is a simple include. Provided I keep the article and comment files paired, they can be moved around without anything breaking. Okay, if you look closely at the page source you'll see I'm flirting with the edge of a database - I wonder if anyone can guess why.

Now, I accept that this would not be an ideal solution for all websites.
If someone forgets their password then there's no way (within the system) to recover or prove continuity with their old identity - they'll just have to change their post appearance.
I've chosen not to enable editing, at least for now. Please try and get your message absolutely correct before you post it. To help with this I've escaped all special characters in the comments; what you see should be what you will get. Long line wrapping varies between browsers, so the system will reformat and request clarification before posting if any soft-wraps are present.

So there you have my comment system, I hope you like it. Will it work? We'll just have to see.


posting by Lysis (site owner) Saturday 8 May 2010
Just posting to prove that it works.
posting by Sarah (indefatigable long-nosed lizard) Wednesday 12 May 2010
Hello, very cool blog!
Add a comment (Please read the notes before submitting your first comment)
no registration required
re-use handle & password to retain identity


Back to Lysis Games main page

Back to Lysis Blog