Page 1 of 1

Developer Request - auto reject of "bad word" post

Posted: Wed Oct 24, 2007 11:47 pm
by molto10
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

My script works great. Am wondering if instead of having the bad words in the en.php file be filtered could the script be modified to automatically reject posts that contain any words in the bad words/en.php file? That would give us control over the rejected posts(via bad word list) and not have to be there constantly monitoring for it. That would be awesome. Thanks very much. The script is great by the way.

Posted: Thu Oct 25, 2007 12:02 pm
by Klemen
Haven't tested this, but try:

1. open mboard.php in Notepad or some other text editor
2. change lines 218-221 from

Code: Select all

    foreach ($settings['badwords'] as $k => $v)
    {
        $text = preg_replace("/\b$k\b/i",$v,$text);
    }
to

Code: Select all

    foreach ($settings['badwords'] as $k => $v)
    {
        if(preg_match("/\b$k\b/i",$text)) {
        	problem("Your post has been blocked!");
        };
    }
3. save, upload, test.

worked like a charm

Posted: Thu Oct 25, 2007 5:38 pm
by molto10
thanks so much.