Movable Type: User Editable Comments
I’ve completed work on User Editable Comments for MySQL-based Movable Type Installations.
What this does is allow commenters to your Movable Type weblog to edit the comments they make for a set period of time.
Features
- Set the number of minutes your users have to go back in and edit their comments
- Set an optional maximum number of edits for any one comment
- Comments will have the time of the edit added to the bottom (but this text will be stripped out from the user’s view if he/she goes in again to edit)
- Authentication based on IP address, so users don’t have to set or remember a password
- Easy to integrate with existing before/after PHP includes system you may be using
- While users are editing their comment, they see a timer that counts down how much editable time they have remaining, and pops up a warning when they have 30 seconds left (although it’s a bit of a white lie, they really have 60 seconds left at that time)
- PHP code included in readme for inserting the “Edit This Comment” PHP code into your Movable Type templates so that the link will only show up next to the user’s own comments, while they are still editable
- NO hacking of Movable Type code required
Requirements
- Movable Type 2.64 or higher (possibly works on older versions)
- MySQL database system being used for Movable Type installation
- PHP enabled on web server (version 4.3.0 or higher would be nice… it’s been tested on 4.3.4)
- PHP enabled on entry pages (for dynamic displaying of the “Edit This Comment” link)
Download
user_editable_comments_v0.7.zip
user_editable_comments_latest_version.zip
(I’d prefer that you link to this entry, but if you must link directly to a zip, link to this one, which will always reflect the latest version.)
More Info
If you have any questions, don’t hesitate to leave a comment on this entry, or to email me. If you want to see how this script works, go ahead and leave a comment on my site to check it out. I allow you to modify your comments for 30 minutes, a maximum of 2 times.
Updates
- v0.7 Edited comments that are submitted blank return an error, instead of messing up the interface (thanks David). Some code was rearranged and functionized.
- v0.6 No change to the script itself, but 2 streamlining changes were made to the php code that dynamically displays the “Edit This Comment” link, and that code now also respects the $my_timezone_offset setting for those whose blog is set to a different time zone than their server.
- v0.5 Rebuild now works for blog_ids other than 1 (thanks David). Rebuild cgi rebuilds all index templates that are set to rebuild, so comments displayed on those pages get updated. <numberofupdates x> gets properly stripped out when editing a comment a second time.
- v0.4 Minor instance where an error message shouldn’t appear has been remedied.
- v0.3 Timezone offset variable added for those whose server is not set to the same zone as their Movable Type blog. fixed PHP version checking.
- v0.2 Accessing the script without a comment_id returns an error correctly. Compatibility with earlier versions of PHP (checks before using mysql_real_escape_string(), which is 4.3.0 and up).
- v0.1 First release.
