swearing :(

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
bigowner
Regular
Posts: 21
Joined: Wed Feb 08, 2006 1:49 am
Location: Türkiye
Contact:

swearing :(

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: swearing :(

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bigowner
Regular
Posts: 21
Joined: Wed Feb 08, 2006 1:49 am
Location: Türkiye
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply