Updating a theme for editable comments
This is a simple how-to that shows the steps to upgrade your plugin for editable comments.
Making your themes compatible with editable comment only requires modifying
sharedcomments.vmd. There are 3 parts to update. A good example of this is the Clickr Theme.
Adding the edit link
First to enable editable comment you will need to give access to the edit function.
Adding the link is as simple as adding the following piece of code near your existing 'Permalink' and 'Remove Comment' links:
Enable inline editing
Editing a comment happens inline. Therefore the editor must be added when rendering the comment being edited as follow:
Add update information
This step is optional but it always nice for user to knwo when a comment has been updated and by who. The following piece of code gets the necessary information.
shouldRenderCommentAsUpdated method is a convenience method that checks whether the comment has been updated by its creator more than 10 minutes after being created. It exists so that comments will not get cluttered with useless information because of a quick fix made shortly after the comment is posted. One can adjust the time frame by passing a number of seconds as the second argument to this method.
Finally, if the updater of the comment is different to the original author of the comment, his name is displayed.