The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
The default behavior in vBulletin is that when someone posts a URL vBulletin converts it to a clickable link and adds target=_blank. This is great for when people post links to other websites, etc. so that my forum stays open in the background.
But when people post internal links to other threads, it can get annoying for them to open in a new window. Is there any way I could create an "if else" logic that would: -add target="_blank" when creating autolinks to any external url -except add target="_top" when creating autolinks to mydomain.com/forum threads? (I guess the if else logic would actually work the other way around, if the URL=myurl, vBulletin would add target="_top", else it would add "target="_blank". How would I do this exactly? |
#2
|
||||
|
||||
I'll see what I can do, shouldn't be too hard.
btw, you need to go to this page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page) This will give you access to post in this forum. |
#3
|
||||
|
||||
Ok, try this.
In functions.php replace this: Code:
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>"; Code:
return "<a href=\"$righturl\" target=\"".iif(strstr($righturl,"vbulletin.org"),"_top","_blank")."\">".str_replace('\"', '"', $hyperlink)."</a>"; |
#4
|
|||
|
|||
FireFly
I knew this might sound strang but I need this finction, so please help if you can How can I chnge the target domain, for example to replace any vbulletin.org to vbulletin.com in the link It will be even better if I could use $bburl so when I change it in the controle panel all the old links get updated Please if this does not make sence, just ignore it |
#5
|
||||
|
||||
Thanks FireFly,
But I replaced the text exactly as you have it above (changing only vbulletin.org to boatdesign.net) and it didn't work - still all links open in a new window. (I applied the change, it didn't work, I reverted to the old version, tried making the change again to be sure, all links still were to a new window, so I reverted to the old functions.php for now.) |
#6
|
|||
|
|||
In 3.7 version
class_bbcode.php replace Code:
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>"; Code:
return "<a href=\"$rightlink\" target=\"".iif(strstr($rightlink,"YOURDOMAIN.COM"),"_top","_blank")."\">$text</a>"; |
#7
|
|||
|
|||
This thread could help a lot of people. I searched high and low for it and finally found it. Thank you ayasyystems!
|
#8
|
|||
|
|||
I tried this and it works for external links, but sometimes replaces the text linked to with "internal linking thread" and then just links back to the same thread it's written in. Instead of going to the URL it should.
I reverted back to the vB default and the links work correctly again. This was on vB 3.8 BTW. |
#9
|
|||
|
|||
for vBulletin 3.8.x users: I replaced target "_top" with "_self" and seems to work fine so far
Code:
return "<a href=\"$rightlink\" target=\"".iif(strstr($rightlink,"YOURDOMAIN.COM"),"_self","_blank")."\">$text</a>"; |
#10
|
||||
|
||||
It's work fine.... but it's not working in the signature links
do you have any idea ???? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|