views:

106

answers:

3

I'm planning to create a custom system for comments. I was wondering about comment moderation. For approving comments, is it as simple as just creating a field called "Moderated" in MySQL?

What's a good suggestion for countering spam? Akismat?

+3  A: 

If you design your columns to have a status column, so only approved comments are displayed, then you could use a DATETIME column called approved date:

COMMENTS table

  • comment_id, INT, primary key
  • comment_detail, VARCHAR
  • approved_date, DATETIME, NULL

This way, you know it was approved and when. But it also relies on staff to approve things before they are visible. It's unclear if there are other statuses involved in your proposed comment system - if there are, it might require a COMMENT_STATUS_CODE table.

OMG Ponies
Also you would need to add a comment_status column to your COMMENTS table, no?
milesmeow
@milesmeow: Yes, there'd be a `comment_status_code` column in the `COMMENTS` table, with a foreign key relationship. I didn't go that far because it's not clear what the OP is looking to do.
OMG Ponies
Thanks for the helpful answer, what would comment status be for? Is there more I should know? I'm new to this whole thing.
Doug
OMG Ponies
@OMG Ponies: Many thanks to you!
Doug
+2  A: 

You could use a bit field called Moderated which has 0 for unmoderated and 1 for moderated. Then, from your app, simply query those comments which have Moderated = 1. There are various ways of countering spam, which also depends on how you're moderating comments. If you're manually reading each comment before they appear on the site, then spam wouldn't really get through to the site itself, but it could still get to your inbox. You could use a Captcha program such as ReCaptcha. This will make it trickier to submit multiple comments with a bot.

keyboardP
A: 

It's highly depend on your site traffic. Yep, a 'moderated' flag would enough if your traffic is low now, but later you should look forward for another technics (captcha, spam dbs etc, filter apps). You can check the comments manually, and thats the best, but later you cant check every comments.

But I dont know anything about your site traffic.

pinusnegra