flag of the United Kingdom

Editing Blog Comments

Date:  Fri, 14th-May-2004prevnext

Tags: Announcements, CMS, Website Development

Ryan Brill wrote an article recently which inspired me to add a new feature to the Urban Mainframe.

"Editing Blog Comments" explored the feasibility of providing a mechanism by which users could, under certain conditions, edit their comments to correct misspellings, clarify certain points and so on...

Ryan identified three methodologies for an edit facility. Quoting directly from his article:

  • Time-based editing: Similar to how 37signals chose to [implement a similar system], this option would allow you to edit your comments for a set amount of time. This way, people would be able to fix any errors that they notice in their comments, but not allow them to edit the comment after the conversation has drawn on.
  • Permanent editing: This option would allow you to edit your comments for the lifetime of [a] cookie that would have to be set to identify you with... The problem that I see with this would be people editing/deleting their comments after other people have commented on it, which is always very annoying.
  • Latest comment editing: This would allow you to edit your comment until another user has posted a comment in the [thread]. In other words, only the last comment for each entry can be edited. The problem I see with this would be if two comments were posted in quick succession, it would not allow the first of the two any time to edit.

Ryan goes on to describe a fourth method which is combination of the first and third options listed above.

The article generated some great feedback and several contributors highlighted potential problems with such facilities including:

  • Editing a comment could disrupt the flow of a "conversation" thread.
  • A comment could be completely deleted, possibly destroying the context of subsequent comments

I decided to create a "proof of concept".

The Ruleset

Like Ryan before me, I realised that there would have to be a workflow and ruleset for the editing mechanism. I expanded on Ryan's original article and identified my basic requirements:

  • A comment can only be edited by its author (obviously)
  • The right to edit a comment will timeout after 15 minutes
  • Only the most recent comment can be edited, regardless of the age of preceeding entries
  • However, if a user is in the process of editing a comment after the timeout or addition of subsequent comments, he will be allowed to complete his edit
  • Empty comments cannot be submitted
  • Any given comment can only be edited once, regardless of its age
  • Edited comments will be clearly marked as such
  • The changes made to a comment will also be visible, with additions and deletions differentiated

Proof of Concept

I have, as far as I can tell, managed to satisfy all of these requirements. I have only performed limited testing at this time, so the editing system should be considered "beta" at the moment. It now needs to be tested more thoroughly so, please, post and edit comments for this article. If you discover any flaws then let me know and I'll endeavour to rectify them. Once we're happy that it's all working properly and that there are no issues, I'll document the code and methology and publish the results here.

NOTE: The edit option will not appear if you have cookies disabled since it uses cookies to match you to your comment(s)!

See Also

Defending Against Comment Spam

You can comment on this entry, or read what others have written (21 comments).