spikereloaded Posted January 22, 2012 Share Posted January 22, 2012 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 Quote Link to comment Share on other sites More sharing options...
Nickson Posted January 22, 2012 Share Posted January 22, 2012 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 ;) Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted January 22, 2012 Author Share Posted January 22, 2012 thanks Nickson worked like a charm! Quote Link to comment Share on other sites More sharing options...
Nickson Posted January 22, 2012 Share Posted January 22, 2012 Glad I could help out :) Quote Link to comment Share on other sites More sharing options...
Uridium Posted January 22, 2012 Share Posted January 22, 2012 Glad I could help out :) you deserve a lolly pop :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.