Lomse Lomse - 1 year ago 98
MySQL Question

php content moderator

I am developing a web application using PHP/MySQL which would need moderation. I'm thinking of an automated moderator as a manual moderation would be too slow based on the content users would be providing. Any idea about how to go about an automated moderator? Any tutorial? Thanks

Answer Source

The best "moderation" that I can think of is a system that looks for whatever you want to filter on content creation. So for instance I can have something like

  if (substr_count($submittedText, 'funk') > 0)
       //Throw an error and prevent submittion or automatically cut it out

on the page that processes the post request from the content form. There are also a number of other ways you can "moderate". For instance, if you already have the data in the database and don't want to show any content with the word "f**k" in it, you can do something like

 while ($row = mysql_fetch_row($request))
      if (substr_count($row['content'], 'funk') <= 0)
           echo $row['content'];

For people who are post spamming, you can monitor how often they post and if they made 15 posts in the last 3 minutes, you could put a block on their account. Or, to begin with, you can prevent the current post by checking the last time they posted something using AJAX or just PHP (in this case you will need to remember what they entered into the form and put it back in) if the interval is too small.

You have to remember however, that it is extremely difficult to make a very strong automated moderator because it is very hard to define the rules which govern say spamming or flaming. Unless you work a full time job trying to answer this question, it is best to keep in mind that auto-moderation is a way to decrease the amount of work a human moderator must do by removing the obvious infringements.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download