Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Open Internal Links in Same Tab - Ported by BOP5 (VB 4.x & VB 3.x) Details »
Open Internal Links in Same Tab - Ported by BOP5 (VB 4.x & VB 3.x)
Mod Version: 1.00, by BirdOPrey5 (IB Staff) BirdOPrey5 is offline
Developer Last Online: Jul 2019 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (3 votes - 5.00 average) Installs: 34
Released: 05 Aug 2012 Last Update: Never Downloads: 110
Supported Uses Plugins Re-usable Code  

Brought to you by BirdOPrey5.

NOTE: If you already use jquery on all pages see this mod instead: http://www.vbulletin.org/forum/showthread.php?t=286030

The purpose of this mod is to automatically turn any "internal" links into links that open in the same window (or tab) instead of always opening in a new window. By default all links added with the[URL] BBCode in vBulletin become links that open in new windows. This uses JavaScript to automatically fix this.

You can add multiple domains in the settings to be treated as "internal" domains. If you don't add any it will try to atuomatically detect the domain being used.

Note: If you add *any* domains then you must specify all local domains, it will not try to auto-detect.

Mod becomes active upon installation. Go to Admin CP -> Settings -> Options -> Open Internal Links in Same Window... to enable/disable mod and edit the domain(s) considered local.

If the user is browsing with JavaScript disabled then links will always open in a new window like is the usual behvior.

Live Demo: Demo Link

Should be compatible with all vBulletins between 3.6.0 and 5.0.0. (So all 3.8.x and 4.x.x for sure.)

Has been tested and found compatible with all current major browsers: IE9, FF 13 & 14, Chrome, Opera, and Safari.

I need to thank 2 others for this mod:

djbaxter on vBulletin.org and his similar mod.

His mod does something similar but is jquery based. This makes the JavaScript code simpler but requires the jquery library be loaded on every page load. vBulletin doesn't use jquery on most pages so that could add significantly to loading times.

And...

Alen Grakalic who posted an original JavaScript on Css Globe: Open External Links in New Window Automatically | Css Globe
I modified this publicly available code to have it work with vBulletin and allow for multiple local domains, however a lot of the code bign used remains his.

So thanks to djbaxter for the idea and Alen for a great jump-start on the code (I'm not a big fan of JavaScript )

------------------------------------------------------

Please "Mark as Installed" if you use this.
Nominate MOTM if you LOVE it!

Download Now

Only licensed members can download files, Click Here for more information.

Supporters / CoAuthors

Screenshots

Click image for larger version

Name:	open-internal-links-settings.jpg
Views:	247
Size:	64.1 KB
ID:	140336  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Miscellaneous Hacks AdminCP & ModCP open in new window/tab lordtopcat vBulletin 3.7 Template Modifications 19 14 Jul 2011 18:59

  #16  
Old 04 Sep 2013, 13:49
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
I see it is probably the default_guest_message in Notices. So you go to the ACP --> Notices --> Notices Manager, click on edit for the default_guest_message

In the field Notice HTML find all instances of _blank and change it to _self
Reply With Quote
  #17  
Old 04 Sep 2013, 14:17
DemOnstar's Avatar
DemOnstar DemOnstar is offline
 
Join Date: Dec 2012
Originally Posted by ozzy47 View Post
I see it is probably the default_guest_message in Notices. So you go to the ACP --> Notices --> Notices Manager, click on edit for the default_guest_message

In the field Notice HTML find all instances of _blank and change it to _self
Genius.

You guys............................

Sorted
Reply With Quote
  #18  
Old 04 Sep 2013, 14:30
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Not a problem, glad to help.
Reply With Quote
  #19  
Old 15 Oct 2013, 16:14
jaffaman jaffaman is offline
 
Join Date: Nov 2004
Thanks for this installed and working on 4.2.2
__________________
www.grimreapers.co.uk
Reply With Quote
  #20  
Old 07 Jan 2014, 02:24
Vintum Vintum is offline
 
Join Date: Jan 2013
I can't get this to work. Did I misunderstand it? I want to open all outside links in new tabs, but everything continues to open in the same one. I have tried adding:
domain.com
forum.domain.com
nothing at all
And all 3 options still left links opening in same page.

Using 4.2.2.
Reply With Quote
  #21  
Old 07 Jan 2014, 11:35
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Can you post or PM link to your forum?
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #22  
Old 15 Oct 2014, 02:00
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Joe I am working on a mod, that has banners in a block. I redirect the user to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

when they click on the banner. What this does is increase the click count for each banner, then redirects the user to the requested site.

Each banner can be set to self or blank. But with your script running it of course opens in the same tab only. How can I over ride that?
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #23  
Old 15 Oct 2014, 10:07
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
There really is no way around it as the mod is coded.

I suppose you could add a check to see if the element is part of an "ignoreme" class and if so, ignore it.

Feel free to release a new version if you wish, it is re-usable code.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #24  
Old 15 Oct 2014, 11:32
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Yeah that is a bit beyond my skills, but I guess I can search around.
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #25  
Old 16 Oct 2014, 09:05
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Yeah- Not really in mine either... I hate JavaScript. This mod only has 30 installs, wouldn't worry about compatibility too much.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:08.

Layout Options | Width: Wide Color: