Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Same Window For Local Links Details »
Same Window For Local Links
Mod Version: 1.0.3, by Viper007Bond (Member) Viper007Bond is offline
Developer Last Online: Dec 2017 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.4 Rating: (5 votes - 5.00 average) Installs: 62
Released: 07 Nov 2006 Last Update: 30 Nov 2006 Downloads: 179
Not Supported Uses Plugins  

Another really simple plugin from me.

I wanted local links (i.e. ones to other parts of the forum) to not open in a new tab. So, I wrote a little modifier to make that happen and decided to share the code.

Tested on my forum, but let me know if you encounter any issues.


How it works:

It hooks in at the end of the BBCode parser, after the parser has transformed the BBCode into HTML. My plugin then removes the target="_blank" off of links that start with your forum base URL.


Upgrading from version 1.0.1 or 1.0.0:

Delete the plugin and then install the new product.


It doesn't seem to be working on old posts!

The output of the BBCode parser and such is cached by vB. Just rebuilt your post cache (it's under "Update Counters") and all will be good.

==============================
DON'T FORGET TO CLICK INSTALL!


==============================

Download Now

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

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
Replace Local Links With Title Jafo232 vBulletin 3.5 Add-ons 90 22 Aug 2007 05:10
Local links to titles JohnWoo vBulletin 3.0 Full Releases 23 18 Oct 2005 16:55

Comments
  #2  
Old 07 Nov 2006, 08:22
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
CHANGELOG:
  • v1.0.3: if your base URL contains "www.", it's now optional and this plugin will affect both www.yoursite.com as well as yoursite.com
  • v1.0.2: cached versions of posts were still having their links open in new windows, this is now hopefully fixed
  • v1.0.1: attachment.php links now continue to open in a new window
  • v1.0.0: initial release

Last edited by Viper007Bond; 30 Nov 2006 at 02:41.
Reply With Quote
  #3  
Old 07 Nov 2006, 11:14
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Real name: Josh
Thanks buddy!
Reply With Quote
  #4  
Old 07 Nov 2006, 16:20
Cheertobi Cheertobi is offline
 
Join Date: Aug 2004
/me clicks install!

Thanks!
__________________
Cheerleading Forum
Reply With Quote
  #5  
Old 07 Nov 2006, 19:01
4yBak 4yBak is offline
 
Join Date: Apr 2004
how this plugin know which links are local? Or this plugin use own bb-code? Also, can you do option like: not display local links for specific usergropus (for example: unregistering users) ?

Last edited by 4yBak; 17 Dec 2006 at 14:57.
Reply With Quote
  #6  
Old 07 Nov 2006, 19:39
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Originally Posted by 4yBak
how this plugin know which links are local? Or this plugin use own bb-code? Also, can you do option like: not display local links for specific usergropus (for example: unregistering users) ?
If the linked url have your vbulletin['bburl'] in that url, so the plugin re-write the "a href" code to change the "target" of the link, and left the link intact.

Nice and simple plugin
This really need to be a standard vbulletin option (local links not use "_blank" target; local links open in the same window)
Reply With Quote
  #7  
Old 07 Nov 2006, 19:56
w1z4rd w1z4rd is offline
 
Join Date: Feb 2005
Location: MooseTown
Real name: Lance
Finally, ... this works great just remember it does'nt take effect on posts before the installation unless you edit them. Sweet little plugin, thanks.
Reply With Quote
  #8  
Old 07 Nov 2006, 20:33
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
Originally Posted by w1z4rd
Finally, ... this works great just remember it does'nt take effect on posts before the installation unless you edit them. Sweet little plugin, thanks.
No, it does, just flush your post cache.

This modifies the output of the BBCode parser (after the BBCode is applied) but that output gets cached by vB.
Reply With Quote
  #9  
Old 08 Nov 2006, 00:32
PsicoByte PsicoByte is offline
 
Join Date: Sep 2006
*install*

Thanks!! :laugh:
Reply With Quote
  #10  
Old 08 Nov 2006, 02:09
abramelin's Avatar
abramelin abramelin is offline
 
Join Date: Mar 2006
good but its going to open the attachment images in the same window too so this is not good :/
Reply With Quote
  #11  
Old 08 Nov 2006, 02:13
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
Originally Posted by abramelin
good but its going to open the attachment images in the same window too so this is not good :/
It shouldn't touch the items in the attachment box as I don't believe those are run though the BBCode parser (why would they be?).

However, yeah, [ATT ACH]12345[/ATTACH] would be probably be affected. I'll exclude attachment.php links.
Reply With Quote
  #12  
Old 08 Nov 2006, 02:17
abramelin's Avatar
abramelin abramelin is offline
 
Join Date: Mar 2006
if you can exclude them then im going to install this lovely simple mod,thanks.
Reply With Quote
  #13  
Old 08 Nov 2006, 03:57
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
Gah, man I suck at regex.
Reply With Quote
  #14  
Old 08 Nov 2006, 11:13
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
Alright, attachment.php is now excluded and will continue to open in a new tab/window.
Reply With Quote
  #15  
Old 10 Nov 2006, 16:15
Nathan2006's Avatar
Nathan2006 Nathan2006 is offline
 
Join Date: Feb 2006
Thumbs up

Thank you Viper007Bond,

I requested something like this a long time ago because I hated new windows opening all the time on local links.

I always had to use the html code <a href=""><span style="color: blue;"> Here </span></a> to open links in the same window

But this great hack has now made me very happy

And also should be default on all VB boards.

Thanks again

Install
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
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 07:49.

Layout Options | Width: Wide Color: