added replacements
This commit is contained in:
parent
fea0adcf1c
commit
b9de5b1a3c
5 changed files with 158 additions and 34 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue