Jump to content
MakeWebGames

Recommended Posts

Posted

Hey people

I've had a look in the forums but couldn't find what I'm looking for. I want a mod that will only allow users to post in the forums 3 times in 5 minutes as I'm having a problem with people spamming now and again! Any ideas??

Cheers

Posted

should be something in the lines of

<?php
$block_time = 5 * 60; // minutes * seconds
$block_post = 3;        // amount of posts before being "blocked"
$res = $db->query("SELECT COUNT(*) AS 'posts' FROM forum_posts WHERE fp_poster_id = {$ir['userid']} AND fp_time > (unix_timestamp() - $block_time)");
$row = $db->fetch_row($res);

if($row['posts'] >= $block_post)
{
   echo "Anti spam block! You'll have to wait before you can post again";
   $h->endpage();
   exit;
}
?>

 

note: written in the quick reply, so TEST it out first ;)

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.   Paste as plain text instead

  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...