Not Solved defrant targe between internal links and external
#1
Not Solved
hello guys

I just need little help in class_parser.php

I want whene the message have an url and that url redirect to any part of my forum the url open in the same window

else if the url is an external url then open new window

I tryed to the following in the class_parser.php line 668 or so
find
$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
		$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
		return $link;
I replace it with the following
$inurl = $mybb->settings['bburl']."'/(.*?)\'";
		$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
		if ($url !=$inurl || $fullurl !=$inurl || $url !=$mybb->settings['bburl'] || $fullurl !=$mybb->settings['bburl'])
		{
		$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
		}
		else {
		$link = "<a href=\"$fullurl\">$name</a>";
		}
		return $link;

but it's still doesn't work..
any idea?
Official Arabic Translator.
Reply
#2
Not Solved
Open .inc/class_parser.php

Find
	function mycode_parse_url($url, $name="")
	{

Add below
		global $mybb;

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

Replace By
		if(strpos($fullurl, $mybb->settings['bburl']) === false)
		{		
			$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
		}
		else
		{
			$link = "<a href=\"$fullurl\">$name</a>";
		}
Reply
#3
Not Solved
thanks alot dear thats did it
Official Arabic Translator.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)