PDA

View Full Version : Specific Censor


SFishy
10-24-2002, 07:23 PM
Okay, I HAVE done a search on this and didn't come up with much. I know all about replacements, and that's what I'm using currently, but it's not a perfect system that way.

Here's an example (it's just an example, I don't really want to censor the word "shut" LOL)

I'd like to have the word "shut" be changed to "shutter"

if I just use "shut" in the replacements, now shutter will come out "shutshutter".

I can add a space at the beginning and end and that fixes it, but now I have to come up with every possible incantation of the word. Shut, shut, shut shut. Shut. SHUT SHUT, SHUT. (you get the idea)

so here's my question...

Is there a hack to censor one specific word, not case sensitive, to another. Something like the censor feature now where it goes inside {} to make it real specific {shut}

OR

Can you think of a better way to handle this?

Thanks!

Xenon
10-24-2002, 07:33 PM
perhaps this:
http://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=709

SFishy
10-24-2002, 07:48 PM
I don't think so -- I want this to work the same way the censor works, or the replace feature works... just to be more specific. I think what you pointed me too is a search and replace on exisiting data already in the table.

Anyone?

Logician
10-25-2002, 07:22 AM
In newreply.php, newthread.php and editpost.php, find:


$message=trim($message);


After that add:

$message=eregi_replace("shut","shutter", $message);


I'm not sure if I got you correctly, but this code will replace all "shut"s with "shuter"s in the message text in a case-insensitive way..