coo limey-I tried that and bugger it didn't work, so I just put the code straight into the first function.
I'm not sure if anyone would care what I did, but I essentially replaced the swearbot. I call the below function toward the beginning of CensorText- I have a feeling you'll see a lot of ****'s there, but on the board we're setting up, we replace s... with poop, etc. If anything falls through the swearbot will catch it.
Code:
function CustomTextReplace($text){
//
//These two arrays should be obvious-but please take care that MyStrings has a counterpart in MyReplacements, or crash
//
$MyStrings = array(1=> "++++","++++","ass","+++++", "penis", "Garp",
7=>"promoteme", "kingsofchaos", "facial", "rotten.com", "outwar",
12=>"druglords", "goatse", "dildo", "nigger", "pussy",
17=>"++++++", "somethingawful", "Kazaa", "imesh",
21=>"Grokster", "feetman", "XoloX");
$MyReplacements = array(1=>"poop", "fark", "mule", "turkey", "chicken", "Flavor Dog",
7=>"teamxbox", "teamxbox", "manicure", "teamxbox.com", "teamxbox",
12=>"teamxbox", "teamxbox", "Bilbo Baggins", "I am a total moron", "kitten",
17=>"cat", "teamxbox", "(I would like to point out that I buy my music)", "what",
21=>"(stealing music is wrong BTW)", "what", "what");
$a=1;
//
//Loop through the strings-can we use a foreach here?
//
while($MyStrings[$a] <> ""){
//
//This section of code I got from vb.org, I know it scans the string and replaces
//but I'm not sure how...
//
$parts = explode( strtolower($MyStrings[$a]), strtolower($text) );
$pos = 0;
//
//This is especially cryptic...key...part? What?
//
foreach( $parts as $key=>$part )
{
$parts[ $key ] = substr($text, $pos, strlen($part));
$pos += strlen($part) + strlen($MyStrings[$a]);
}
$text=join( $MyReplacements[$a], $parts);
$a++;
}
//
//And Back We Go
//
return $text;
}