Quote:
Originally Posted by Lynne
Sure, just use a plugin to do a str_replace. I think I've written the code for this quite a few times - here's a copy from another thread:
PHP Code:
$word = array(
'word 1',
'word 2',
);
$link = array(
'xxxx',
'yyyy',
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
It should work in vB4, I think.
|
So to make a plugin I go to
Plugins & Products > Add new Plugin
Then I need:
Product type:
?
Hook Location:
?
Title: Custom Word Replacement
Execution Order:
?
Plugin PHP Code
PHP Code:
$word = array(
'word 1',
'word 2',
);
$link = array(
'Replacement 1',
'Replacement 2',
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
--------------- Added [DATE]1266066243[/DATE] at [TIME]1266066243[/TIME] ---------------
or did I get the replacement values wrong? I don't understand what $link and $word do.