![]() |
specific word replacement
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? |
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:
|
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. |
Here are instructions on how to create a plugin to Replace Words in the pagetext.
https://vborg.vbsupport.ru/showthread.php?t=235769 |
Quote:
|
Quote:
|
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.
|
how do you do that?
I need it in terms a 6 year old can understand :) |
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']
|
so the code stays the same, I just replace 'pagetext' with 'message'?
|
Quote:
|
this is my plugin
PHP Code:
|
I can't think of why that would cause the issue you are seeing. I just took a look at that link and it looks like it tells you to make two plugins at different locations. You may want to ask for help in that modification thread for this. I really don't know why he uses those locations unless he is actually changing the text before it's saved? The way I was doing it just changes the output. Anyway, you really should be asking for help in the modification thread and see if others have had the same issue.
|
I'd prefer to do it your way, but I don't understand exactly how it's done. Is this your plugin? What hook do you use?
PHP Code:
|
I just used postbit_display_complete
|
All times are GMT. The time now is 01:08 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:
|