SteveG
Posts: 56
|
| Posted: 02/18/2005, 9:15 AM |
|
I'd like to put a filter into my discussion board, something which will replace dirty words with ***'s - or something like that (watching out for B_A_D words too). I haven't done much yet to build the tables yet, so almost anything goes for now.
I briefly looked around the net for php scripts to do only this, but most are integrated into larger projects like chat and discussion boards. Does anyone here have any recommendations of what works well for doing this? Once we're at it, does anyone know where to download all those word and word combinations?
Thanks,
- Steve
|
 |
 |
klwillis
Posts: 428
|
| Posted: 02/18/2005, 10:35 AM |
|
You can start by learning more about how
to use this PHP function ...
bool ereg ( string pattern, string string [, array regs])
You may also want to add a disclaimer to your discussion board
with a warning that states any use of profranity results in immediate
account cancellation.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
feha
Posts: 712
|
| Posted: 02/20/2005, 12:55 AM |
|
Here is my custom function:
//################################################
// NO BAD WORDS
//################################################
function no_bad_words($input_text,$bad_words_array)
{
// BY WWW.VISION.TO
$match=array("-","*","'"," ","!","=","+","?","£","@");
$clean=str_replace($match, "", $input_text);
$STOP_BAD_WORDS=explode("|",$bad_words_array);
for($i=0;$i<count($STOP_BAD_WORDS);$i++)
{
if (eregi(trim($STOP_BAD_WORDS[$i]),$clean))
{
return $STOP_BAD_WORDS[$i];
}
}
return FALSE;
}
it will detect B A D or B-a-D or B--A---D etc ....
array should be | separated ....
Note this is not to replace it is to detect ...
you can modify it the easy whay to replace words ...
I use it to not let people even to enter particular words ...
Used on: http://www.vision.to/new_cms/Links_MOD/Add_Link.php
_________________
Regards
feha
www.vision.to
feedpixel.com |
 |
 |
|