New and Improved Comment System for BlogEngine.NET

by filip 2. March 2010 02:24

Update: When I switched hosting providers and upgraded BE.NET, I didn't migrate the changes to the comment system to the newer version.  This post describes my updates to version 1.x, but is no longer being used on my website.

 

BlogEngine.NET had a pretty decent commenting system, but it lacked some of the functionality I wanted in a comment system for my blog. So I decided to update it myself, which turned out to be a bigger deal than I thought it would be. Still, after a few evenings of work, I got my comment system. The following is a summary of the new additions.

Comment Listing By Type

comment_type_tabs 

The comments are now arranged in tabs, organized by type.  Although the image above shows three types, there are actually four:

  1. Spam
  2. Unapproved Comments
  3. Trackbacks (and Pingbacks)
  4. Comments

The ‘Spam’ and ‘Unapproved Comments’ tabs are only visible to authenticated users. ‘Trackbacks’ and ‘Comments’ are only visible if there’s something there. The number in parentheses next to each tab contains the number of comments of that type in the tab.  It is also possible to have a ‘Spam’ comment in the ‘Comments’ tab, if that ‘Spam’ comment has a reply which is not spam.  In such cases, the ‘Spam’ comment will be collapsed and users will not be able to see the contents, but they will be able to see the reply.  The inverse applies to the ‘Spam’ and ‘Unapproved Comments’ tabs.

Comment Rating System

rating

Visitors to this blog can now rate the comments, in similar fashion to how users can digg items on Digg ( I even hijacked their thumbs up and down images, I hope they don’t sue! ).

Improved Comment Administration Interface

admin_comment_moderation

In the current version of BlogEngine.NET, there are basically two comment states: Approved and Spam. I added a third comment state: ‘Unapproved Comments’. These are comments that have not yet been either approved or marked as Spam. In the current implementation on this blog, no comments ever go to the Spam tab automatically – they have to be placed there by a moderator. However, if they fail a Spam check, they will be marked as ‘Unapproved Comments’ and not be visible to the public.

The Code

If you’re even thinking about putting this in your blog, you should read these release notes. I have uploaded a file that contains all changes to this location. However, keep in mind that these are NOT SIMPLE CHANGES. There was a lot of code modified, and  you should be fairly familiar with ASP.NET before attempting to put these in your blog. You will need to recompile the BlogEngine.Core project to make this work. Also, if you are using anything other than the XmlProvider that comes with the blog as your data provider, you will need to update that for the comment rating and spam properties, as these are new.  One other note about the zip containing the source: it assumes that you are also using the reCaptcha control I wrote not too long ago, although not all of the files necessary for the reCaptcha are in the zip.

Tags:

Comments (6) -

Filip
Filip United States
3/2/2010 2:54:17 AM #

SAMPLE COMMENT FOR DEMONSTRATION PURPOSES: Example of a comment that can be rated up or down.

Reply

Filip
Filip
3/2/2010 2:55:38 AM #

This is a reply to a spam comment.  The spam comment appears "collapsed", although the look can be easily changed in your theme.

Reply

CreepinJesus
CreepinJesus Australia
3/2/2010 9:07:34 PM #

I think I'll have a go at putting this on my site... I'm pretty much doing anything I can get my hands on at the moment!  All for learning purposes, really Smile

I suppose I'll also need to turn on trackbracks, and find out what they are because I have no idea!

Thanks Smile

Reply

Filip
Filip United States
3/3/2010 11:14:47 AM #

FYI, there's a problem with the rating system.  It doesn't seem to be saving the data (or maybe it is saving it but not loading it properly).

Reply

Jodi
Jodi Canada
2/9/2011 1:52:02 PM #

Interesting post, but it doesn't look like the comments can be rated up or down anymore...

Reply

Anakart
Anakart Turkey
8/2/2011 4:56:15 PM #

look like the comments can be rated up or down anymore

Reply

Pingbacks and trackbacks (3)+

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About Filip Stanek

Death Note Pic I'm a developer at ACG in Cincinnati, OH. I like ASP.NET, Flash, and other web technologies, & enjoy playing chess, video games, etc.

Currently playing:
- StarCraft IIE-mail me Send mail

RecentComments

Comment RSS

Month List