added replacements

This commit is contained in:
JT Smith 2003-10-18 02:08:57 +00:00
parent fea0adcf1c
commit b9de5b1a3c
5 changed files with 158 additions and 34 deletions

View file

@ -422,9 +422,9 @@ sub getPostTemplateVars {
$var->{'post.message'} = '<div style="font-family: fixed;">'.$var->{'post.message'}.'</div>';
}
if ($forum->get("allowReplacements")) {
my $sth = WebGUI::SQL->read("select pattern,replaceWith from forumReplacement");
while (my ($pattern,$replaceWith) = $sth->array) {
$var->{'post.message'} =~ s/\Q$pattern/$replaceWith/g;
my $sth = WebGUI::SQL->read("select searchFor,replaceWith from replacements");
while (my ($searchFor,$replaceWith) = $sth->array) {
$var->{'post.message'} =~ s/\Q$searchFor/$replaceWith/gs;
}
$sth->finish;
}