Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Open Forum Links In New Window?
#7
Not Solved
(2011-05-23, 01:43 PM)Aries-Belgium Wrote: I hadn't checked out the complete code, but find this:
	function mycode_parse_url($url, $name="")
	{
and add this on a new line below it:
		global $mybb;

That should work.

However (!!!) there is a much better solution that doesn't require a core modification and that works with all URLs. Add a new MyCode via AdminCP > Configuration > MyCode with these settings:
Title: Open internal links in same window
Regular expression:
\<a\ href=\"(http://www.yourdomain.com/.*?)\" target=\"_blank\"
Replacement:
<a href="$1"

Hmm, after adding that new line, now I get this error when loading the page:
Parse error: syntax error, unexpected T_GLOBAL, expecting ';' or '{' in /home2/greatlc9/public_html/testforum/inc/class_parser.php on line 1632

I'm not sure why it's complaining about line 1632 now, as that line is blank:
1631 $code = str_replace("<code>", "<div dir=\"ltr\"><code>", $code);
1632
1633 $code = str_replace("</code>", "</code></div>", $code);

As for your other option, that would be good for general use, but I don't think it will help me make the "Forum Links" open in new windows. You know how you can create a forum as just a link? That is what I want to open in a new window... The links that people post in threads are already opening in new windows, for the most part.

Thanks for your help!


Messages In This Thread
Open Forum Links In New Window? - by Jayfore - 2011-05-23, 03:00 AM
RE: Open Forum Links In New Window? - by Yaldaram - 2011-05-23, 07:36 AM
RE: Open Forum Links In New Window? - by Jayfore - 2011-05-23, 01:11 PM
RE: Open Forum Links In New Window? - by Jayfore - 2011-05-23, 01:51 PM
RE: Open Forum Links In New Window? - by Tim_bc - 2011-05-27, 04:59 AM
RE: Open Forum Links In New Window? - by Tim_bc - 2011-05-27, 08:00 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)