I found a way to do it! Using JPdeni's dirty word filter mod, I made a few changes to it and it works! Here is what I did in case anyone is interested:
Installed everything in the mod according to directions.
Made these changes (marked in bold):
Quote:
# Censor dirty words
# 0 = do not censor
# 1 = reject records that contain any of the words
# 2 = replace words with ***
# 3 = replace the middle letters with *s, as in "f**k" "a*****e" "c********r"
# 4 = replace vowels with *s, as in "f*ck" "*ssh*l*" "c*cks*ck*r"
# 5 = replace words with the first letter of the word and * for the other letters, as in f*** a******, c*********
# 6 = replace each letter with a *, as in **** ******* **********
$db_censor =
2;
## You can edit the @dirty_words list however you want. Just be sure to put
## single quotes around each word, keep the list all on one line, and be sure they
## are in lower case.
# Dirty word list
@dirty_words = (
'rainbow',
'Rainbow');
censor routine
if ($db_censor) {
foreach $dirty_word (@dirty_words) {
if (lc($in{$col}) =~ /$dirty_word/) {
if ($db_censor == 1) {
push(@input_err, "$col (Includes a banned word -- $dirty_word)");
}
else {
if ($db_censor == 2) { $replace =
"<b>Rainbow</b>"; }
elsif ($db_censor == 3) {
$replace = substr($dirty_word,0,1).("*" x (length($dirty_word)-2)).substr($dirty_word,length($dirty_word)-1,1);
}
elsif ($db_censor == 4) {
$replace = $dirty_word; $replace =~ s/a|e|i|o|u/\*/ig;
}
elsif ($db_censor == 5) {
$replace = substr($dirty_word,0,1).("*" x (length($dirty_word)-1));
}
else {
$replace = ("*" x (length($dirty_word)));
}
$in{$col} =~ s/$dirty_word/$replace/ig;
}
}
}
}
Just a couple of easy changes. I still have to modify all of the forms so that it will change them all to bold, but from here on out, any time any of the records are modified, it will bold them.
Thanks for the suggestions Watts!
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com (Mods based on JPDeni's original mods.)