The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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. |
#2
|
||||
|
||||
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.
|
#3
|
||||
|
||||
thanks Lynne, that seems to be the easier option
|
#4
|
|||
|
|||
is this how you do this?
$find = array( 'word' ); $replace = array( 'word1' ); $this->post['message'] = str_replace($find, $replace, $this->post['message']); |
#5
|
||||
|
||||
Yes, that is how you should do it.
|
#6
|
|||
|
|||
tried it, doesn't work. i run vb 4.1.7
|
#7
|
|||
|
|||
Which hook location did you use?
|
#8
|
|||
|
|||
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 |
#9
|
||||
|
||||
That code worked just fine for me using the postbit_display_complete hook location on my 4.1.8 test site.
|
#10
|
|||
|
|||
ok i figured it out. turns out the script doesn't work for phrases i guess
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|