The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I know how to replace a list of words with *.... but what if I want to replace words on a word-by-word basis?
"Cat " to "Dog" "Bear" to "Pig" "XXX" to "YYY" etc? Is that possible? |
|
#2
|
||||
|
||||
|
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:
|
|
#3
|
||||
|
||||
|
Quote:
Plugins & Products > Add new Plugin Then I need: Product type: ? Hook Location: ? Title: Custom Word Replacement Execution Order: ? Plugin PHP Code PHP Code:
or did I get the replacement values wrong? I don't understand what $link and $word do. |
|
#4
|
|||
|
|||
|
Here are instructions on how to create a plugin to Replace Words in the pagetext.
https://vborg.vbsupport.ru/showthread.php?t=235769 |
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
||||
|
||||
|
I've never had any problems with mine. The difference between ours is what we apply it to (pagetext versus message), so perhaps that has something to do with it.
|
|
#8
|
||||
|
||||
|
how do you do that?
I need it in terms a 6 year old can understand
|
|
#9
|
||||
|
||||
|
What do you mean? I'm talking about the difference in our plugins. I posted what I use in post 2 and I do a replace for $this->post['message'] whereas you do a replace for $this->post['pagetext']
|
|
#10
|
||||
|
||||
|
so the code stays the same, I just replace 'pagetext' with 'message'?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|