Username
Forgot password?
Welcome to our site!
Or Join with FTTF

Comments feature is ready!

0

735 views
I have just finish coding the commenting feature. Again, I was pleasently surprised at how fast I was able to complete this task.

I only about 5 days I added the comments system with all these options:

  1. Admin can allow/disallow comments on the site
  2. Admin can configure maximum number of comments that a question or answer can have.
    After this limit is reached the user will see error alerts when trying to add comment
  3. A flood-check applies to comments allowing one comment per 30 seconds. This timeout
    is configurable. The flood check does not apply to moderators
  4. Duplicate comments check to prevent accidental duplicate comment posting
  5. Comments can be edited but only in the first 5 minutes after the comment has been posted.
    This edit timeout is configurable.
  6. Author of the comment can delete own comment any time. Admin can delete any comment.
  7. When a comment is made by the same user who asked the original question (meaning a comment is either for that question or for any of its answers), the special css class is added to the username link of that comment, indicating that commentor is also the question author
  8. If comment is edited, a special icon will be displayed next to comment and hovering over it will reveal info on who and when has last edited the comment.
  9. Comment can be "Liked", sort of a up-only vote. The likes of the comment do not add to author's reputation but they are logged in a special collection and later on I will be able to add showing of how many comment likes the user got in user's profile page.
  10. When processing the "Likes" for the comment the system checks that only one like per user per comment is counted and also Likes for own comments do not count.
  11. Counts of likes displayed next to the "Like" icon
  12. Cool css styles for all the edit/delete/like tools, thanks to Alloy UI button collection. I also made a black-and-white copy of the icons sprite, so initially only black and white icons are shown, but color version is shown on mouse over. This is a neat effect.
  13. I put some extra features in place to later allow for easy replying to comments. This will be much better than just having to add the @username in the reply. A reply to comment will automatically know the parent comment id and will automatically prepends the In-reply-to @user and also we will have some css styles assisted in identifying which comment is a reply to which other comment.
  14. All comment-related operations post onBefore and on events. For example, there are onBeforeNewComment and onNewComment; onBeforeCommentEdit and onCommentEdit. This way plugins can easily listen to these events. By the way, the comment flood check is a plugin that listens to the onBeforeNewComment event. Other plugins can also be written, for example to disallow some bad words in comments or to disallow comments from certain countries, or whatever else you need.
  15. The master email notifier class will also work as a plugin and will listen to comment events to notify question/answer owners of new comments and commentors of new replies.
  16. Forgot one more feature: comments can be reported for inappropriate content, just like any question and answer, by using the little flag icon and then using the form to report to moderator.

Alright, just give it a try here. I set it that any registered user can comment, so login and try it. Oh yes, the comment system also checks to allow comments only from logged in users. This is checked by JS on client and then again on the server.


Updated sources will be uploaded to github today.

Enjoy.

Next feature: follow tag, then follow questions, then follow users.

There are many other things I want to do, hoping that some other good developers will join. I especially need people whith good Javascript skills, especially in YUI3 library.


 
Edited March 16, 2011 6:45 pm CDT
Added "flag" feature
asked March 16, 2011 at 6:43 PM

 US
1
And this is the test of the comment feature! You can add some comments here too, then try to edit your comments. The instant in-place editing is cool
flag
Mar 16 '11 at 18:47
And another comment here, this time from the same account as question owner to demonstrate how the owner's comment looks like - notice special look on commentor's name/link And now it's been edited
flag
Mar 16 '11 at 18:49
Just fixed the bug where a newly added comment could not be edited. Now it is editable immediately.
flag
Mar 23 '11 at 16:21

1 Answers

0
 
The small bug has been fixed. now newly added comments can be edited immediately

flag
answered March 23, 2011 at 4:22 PM

Your answer

Join with account you already have

FTTF

Preview

Alert