Page 1 of 1

swearing :(

Posted: Tue Feb 21, 2006 4:01 pm
by bigowner
i add shout box plugin on my site
http://www.boshver.com

but some visitors write bad words here. How can i block this words...

thanx

Re: swearing :(

Posted: Tue Feb 21, 2006 4:13 pm
by garvinhicking
That plugin does not support any "bad word" filtering, so one would need to edit the plugin file for that, to support it...

Best regards,
Garvin

Posted: Wed Feb 22, 2006 4:15 pm
by bigowner
i search the forum and i found this post in http://www.s9y.org/forums/viewtopic.php ... light=word

but i cant understand anyhing


Code: Select all

This is what I have done on my shoutbox: find the first appearance of the following code: 
Code: 

serendipity_db_query($sql); 
 

Then replace it with the following: 
Code: 

# The following codes were added by Wenjun Lu 
# on the 6th of May, 2005. Purpose is to filter 
# out messages that contain bad words. 
if(!( 
    ereg('poker', $sql) || 
    ereg('fuck', $sql) 
)) 
{ 
# End of edit. 
serendipity_db_query($sql); 
# The following codes were added by Wenjun Lu 
# on the 6th of May, 2005. 
} 
# End of edit. 
 

Only need to replace the first "serendipity_db_query($sql);" not the second one. Hope this helps. 

Regards, 
Wenjun

Posted: Wed Feb 22, 2006 4:39 pm
by garvinhicking
What do you not understand? It is a very simple replacement. :-)

You must add the lines of text that you want to block in a structure like this:

Code: Select all

if(!( 
    ereg('poker', $sql) || 
    ereg('poker2', $sql) || 
    ereg('poker4', $sql) || 
    ereg('poker5', $sql) || 
    ereg('poker6', $sql) || 
    ereg('poker7', $sql) || 
    ereg('fuck', $sql) 
)) 
So you need to always copy the ereg(...) || onto the next line. The last ereg line must not have a "||" separator. Put the words you want to block within the single quotes, like use 'swearword' instead of 'poker2' and so on.

Regards,
Garvin