Helpful Information
 
 
Category: vBulletin 3.0 Beta Releases
standard URL hyperlink opening in same window

As requested here: standard URL hyperlink opening in same window
http://www.vbulletin.com/forum/showthread.php?t=135315

Just doing a quick browse through includes/functions_bbcodeparse.php makes me think this might just be what that user is looking for: (line 1510)

Download & backup the includes/functions_bbcodeparse.php file and open the file (not the backup of course) and find ..


return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";


The target is set to blank which will make the link open a new window. Remove that and they should open in the same window:


return "<a href=\"$rightlink\">$text</a>";


Save the file when you're done and upload it, replacing the file already there (so overwrite it, don't resume or skip it during upload).

If you're using postcache you might need to rebuild post cache first.

I'd love to have that, but for links opening to my site only.

floris, could a conditional statement be added so that any forum internal link (other forum pages) would open in the same window, but that any external link (anyother sites) would open in a new one?
John

floris, could a conditional statement be added so that any forum internal link (other forum pages) would open in the same window, but that any external link (anyother sites) would open in a new one?
John
What you want is how it works by default with vBulletin 3.0.7

I know by default in Vbull, any standard link (url) in a post will open in a new window. I see by the code you showed that it can be changed to open in the same window.

What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

Examples, these two urls' are in the same post:
This internal forum url (or any other) would open in the same window;
http://shipmodeling.net/vb_forum/articles.php?action=viewarticle&artid=38

This external (non forum page) url would open in a new window;
http://www.google.com/

John

What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

good idea, probably need to regular expression?

I know by default in Vbull, any standard link (url) in a post will open in a new window. I see by the code you showed that it can be changed to open in the same window.

What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

Examples, these two urls' are in the same post:
This internal forum url (or any other) would open in the same window;
http://shipmodeling.net/vb_forum/articles.php?action=viewarticle&artid=38

This external (non forum page) url would open in a new window;
http://www.google.com/

John
If you know the post or thread id, use those bbcodes? [thread] ... & [post]...

Ive already done this but didnt share... Im sorry!










privacy (GDPR)