Developer Request - auto reject of "bad word" post

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
molto10
Posts: 2
Joined: Wed Oct 24, 2007 11:39 pm

Developer Request - auto reject of "bad word" post

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
molto10
Posts: 2
Joined: Wed Oct 24, 2007 11:39 pm

worked like a charm

Post by molto10 »

thanks so much.
Locked