![]() |
Mod that will replace certain word with another
Hi there,
I remember seeing a mod for vB4 here before which allowed certain words to be replaced by another. For example, in the setting you could have red;orange and the mod would replace posts containing the word red with orange. I can't seem to find it here now, anyone can help or know the name of the mod? :( thank you. |
You can just use Replacement Variables. Or, write a plugin with a $find array and $replace array and just do a str_replace where you want it.
|
thanks Lynne, that seems to be the easier option :)
|
is this how you do this?
$find = array( 'word' ); $replace = array( 'word1' ); $this->post['message'] = str_replace($find, $replace, $this->post['message']); |
Yes, that is how you should do it.
|
tried it, doesn't work. i run vb 4.1.7
|
Which hook location did you use?
|
Quote:
i'm not really sure which one to use! can't find anything that refers to the post :\ right now it's set to the default that came with the script... postbit_display_complete |
That code worked just fine for me using the postbit_display_complete hook location on my 4.1.8 test site.
|
ok i figured it out. turns out the script doesn't work for phrases i guess
|
I don't see why it wouldn't work for phrase, but you do have to remember that it's html so the pattern to search for might not be obvious. (But you can probably view the html source of the page and see what the phrase looks like).
|
All times are GMT. The time now is 04:53 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|