The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Automatically change certain words (text) into links?
Is there a way to automatically change certain words in posts into links? For example, if someone types the word California on my forum, is there a way to make that word turn into a link to my California page on my site? I looked for a hack for this, but couldn't find one. Maybe I'm overlooking it. Any help would be appreciated. Thanks!
|
#2
|
||||
|
||||
There are Replacement Variables, but those are site wide, not just for posts. You can write a simple plugin to do a search/replace for words in posts:
location: postbit_display_complete PHP Code:
|
#3
|
|||
|
|||
What do I put in the place of "message" in that plugin? Thanks!
|
#4
|
||||
|
||||
The only things you would change are the $word and $link arrays. Leave the last line alone.
That plugin changes the words when the message is parsed. If you need to change it when the message is created, you'd have to use a different hook location and the code would change. I haven't done that before, so I don't have a quick plugin to post for that. |
#5
|
|||
|
|||
Got it! Thanks so much!
|
#6
|
|||
|
|||
Where am I looking for this postbit_display_complete Because I can't find it
|
#7
|
||||
|
||||
It's a hook_location. You find it when you create a plugin.
|
#8
|
|||
|
|||
not working for me im on vb4.0
--------------- Added [DATE]1268554434[/DATE] at [TIME]1268554434[/TIME] --------------- it works wonderfully on the forums. any reason why it doesnt work in the blogs section? |
#9
|
|||
|
|||
Hi and thank you for this code, it works great!
But there is any chance that I can make it convert ONLY one word (in case that the word repeat herself) in the text to link? Thanks |
#10
|
|||
|
|||
Tried this and it is now working for me as I get this error message;
Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 Parse error: syntax error, unexpected '=' in /home/sportsbo/public_html/includes/class_postbit.php(314) : eval()'d code on line 36 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|