Back to vBulletin 4.x Add-ons

Open Local links in same window, External in new window
Mod Version: 1.1, by SweCastel

vB Version: 4.1.0 Rating: (4 votes - 3.75 average) Installs: 17
Released: 30 Dec 2010 Last Update: Never Downloads: 0
Not Supported Code Changes Re-usable Code  

I did search for a easy solution to simply open a local link in the same window, and external links in a new window.

Did not find it, so I did make this. My first PHP script.

In the file:
includes/class_bbcode.php

Search for: standard URL hyperlink

3.1.5 (maybe 3.1.6?) And before:
Replace:
Code:
return "<a href=\"$rightlink\" target=\"_top\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
3.1.7 ->
Replace:
Code:
return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
With:

Code:
	
	if( is_int(  strpos(  strtolower( $rightlink ), "InsertYourDomainHere") ) )
	{
		return "<a href=\"$rightlink\" target=\"_top\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
	} else {
		return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
	}
InsertYourDomainHere = Should be replaced with your domain eg: vbulletin (exclude the last part of your domain eg .com / .org)
It didn´t work for me anyway.
Maybe because of vbulletin cutting down long texts? I dont really now.

And then update the CMS Cache.
AdminCP - vBulletin CMS - Clean CMS-Cache

However this works perfect for me.

// Daniel

Download

No files for download.

Similar Mods

Mini Mods Same Window For Local Links vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024