MyBB Community Forums

Full Version: Redirected forum opens in new window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have made a forum as link, and now if someone clicks on it it opens. Now I want that if someone click on that forum the page that is linked on the forum is open on a tab or new window.

Wich file do I need to edit and with wich code??

Thanks again
Add "_blank" as a target attribute.

<a href="http://www.google.com" target="_blank">link</a>
(2016-01-24, 08:35 PM)nth Wrote: [ -> ]Add "_blank" as a target attribute.

<a href="http://www.google.com" target="_blank">link</a>

Thanks but not a link in a post or thread, I mean a forum as link. U can not use codes only urls
I think also that I need to edit a template for it but wich and wich code
it depends, where you want to place it? header or footer?
(2016-01-27, 10:12 AM)Blackbeard Wrote: [ -> ]it depends, where you want to place it? header or footer?

Header or footer I think u don't understand the meaning.... U have forums like, feedback, about us etc and in the forums u make you can post threads or posts... U can make a forum a forum or category but also as link.

So if u click on a forum or forum category u can post thinks but if u click on the forum u set as link u go straid to the link. The forum that is set as link need to be open at a new tab or window. So nothing about in threads or posts or headers or footers, it need to be the forum that is set as link.

Thanks
I could hardly understand what you mean, but I guess it's in the forumdisplay.php: https://github.com/mybb/mybb/blob/80d89d...y.php#L169
header("Location: {$foruminfo['linkto']}");
It's not possible to make it redirect to a new tab.

You could use a conditional in the forumbit_depth2_forum template though. Something like:
<a href="<if $forum['linkto'] then>{$forum['linkto']}" target="_blank<else>{$forum_url}</if>">{$forum['name']}</a>
should work.
Nope all above is not working and I know this is really possible. So I have search and found the working sollution..


U need to do this to get it works...

Go to Templates >> Forum Bit Templates >> forumbit_depth2_cat

Then find the code:

<strong><a href="{$forum_url}">{$forum['name']}</a></strong>


Change it to:
<strong><a href="{$forum_url}" target="_blank">{$forum['name']}</a></strong>


Then your selected forum that is select as link opens in a new window..
That's exactly what I mentioned above, but only for forums that are actually redirects, which seemed to be the initial question.
(2016-02-02, 12:32 PM)Destroy666 Wrote: [ -> ]That's exactly what I mentioned above, but only for forums that are actually redirects, which seemed to be the initial question.

A oke haha, Thanks annyway for helping me to the sollution!