MyBB Community Forums
Open Internal link on same window - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Support (https://community.mybb.com/forum-72.html)
+---- Thread: Open Internal link on same window (/thread-69143.html)



Open Internal link on same window - HubSeo - 2010-05-05

How can i open internal link posted by users to open in same window. However still make the signature link open in new window.

Its really annoying at times to open the thread links posted by users {inside the post content} in several new windows/tabs.

Is there a way out ?:


RE: Open Internal link on same window - HubSeo - 2010-05-09

Anyone ?


RE: Open Internal link on same window - Matt - 2010-05-09

Might not be the best way of doing it but should work. Line 838 of ./inc/class_parser.php:

if(!preg_match("#^[a-z0-9]+://#i", $url))

to:

global $mybb;

if(!preg_match("#^[a-z0-9]+://#i", $url))

Line 869:

$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";

to:

if(strpos($fullurl, $mybb->settings['bburl']) !== false)
{
	$link = "<a href=\"$fullurl\">$name</a>";
}
else
{
	$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
}

See if that works.


RE: Open Internal link on same window - HubSeo - 2010-05-09

Works Perfect.

Cheers Smile