Jump to content

Shout Box - Report a User with Auto Ban on 3 reports


widget

Recommended Posts

Hi Guys

 

My site has a shout box, now and again people post inappropriate content and if a moderator is not online to mute them it doesnt look good for other users.

 

I have written a snippet of code to report an offender. My goal is that if 3 different people report an offender the site auto mutes them. (manual mute function already exists for moderators)

 

I setup a table that records the reporters name the offenders name the post id the message content and the time stamp.

 

I have never been good at counting num rows etc and need some help in what direction to go in.

 

My current code that inserts the reported content.

 

mysql_query("INSERT INTO `chicka_pets`.`records_sbreports` (`id`, `offender`, `reporter`, `post_id`, `post_content`, `timestamp`) 
VALUES ('', '$offender', '$username', '$id', '$sbmessage', '$timestamp')");

 

I am guessing that somewhere after that I need some sort of count numrows on the post id where reporter is NOT the same and then an if numrows >2 set offender to mute

 

my problem is how to do the num rows bit where the reporters are unique?

 

Any help is much appreciated

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.