MyBB Community Forums

Full Version: My spam filter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to write a simple spam filter that will check the message in the postbit, compare it with a database of known phrases etc. that spammers use and then, if found, delete the post automatically.

Checking the message in the postbit is no problem but I've run into a small problem when it come to deleting the post.

I've found the function delete_post(pid,tid) but don't seem to be able to get it to work.

Any ideas?
if you are testing a new post, then there is nothing to delete yet. if your filter catches it, you can redirect out of the code section you are in to a message that says post not added due to filtering.