The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need to replace a word in posts but not in titles
I just tried to use a replacement, but it replaces the word in thread titles as well.
Basically, I am trying to replace all instances of a word in a post with a link that I specify. Regular expressions make my eyes cross so I am going to need a wee bit of assistance on getting this one going please. Amy |
#2
|
|||
|
|||
If you want to do all past posts, you can use REPLACE in an UPDATE query. If you mean all future posts...no idea. You'd need a new hack.
|
#3
|
||||
|
||||
you'd probably have to edit functions.php for the postbit part(unless you want it permanent, then just do a query), newreply.php, and newthread.php, not sure what you'd have to do right off hand though
|
#4
|
||||
|
||||
I am wondering if javascript would do it or something similar? You know those ad banners that change words on pages to links? Anybody know if such a thing exists in javascript?
|
#5
|
|||
|
|||
Javascript is virtually never the answer to any problem
|
#6
|
||||
|
||||
I got it. I added a function in functions.php that does a string replace on the post before it is parsed for vbcode, etc. It works like a charm and this should help my affiliate programs do a bit better.
Amy |
#7
|
||||
|
||||
I wish I had seen this message earlier. I just got through doing the very same thing a few days ago. Easy, wasn't it?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|