This section contains detailed articles elaborating on some of the common issues phpBB users encounter while using the product. Articles submitted by members of the community are checked for accuracy by the relevant phpBB Team. If you do not find the answer to your question here, we recommend looking through the Support Section as well as using the Site Wide Search.

Making Link Forum Links Open in New Windows

Description: This article describes how to make phpBB Link forum links open in new windows (or tabs).

In Categories:

Link to this article: Select All
[url=http://www.phpbb.com/support/docs/en/3.3/kb/article/making-link-forum-links-open-in-new-windows/]Knowledge Base - Making Link Forum Links Open in New Windows[/url]

The KB article Links Opening in New Windows describes how to make links in posts and other user-generated content open in new windows, but it left one area untouched -- how to open link forum links in a new window. This article fixes that oversight.

ProSilver
To fix this in ProSilver, open \styles\prosilver\template\forumlist_body.html and find the following code (at line #33 in phpBB 3.0.8):

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />

and replace it with the following code:

Code: Select all

<!-- SHM Force Link forum links to open in new window/tab -->
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle" <!-- IF forumrow.S_IS_LINK -->target="_blank"<!-- ENDIF -->>{forumrow.FORUM_NAME}</a><br />

SubSilver2
To fix this in SubSilver2, open \styles\subsilver2\template\forumlist_body.html and find the first instance of the following code (at line #24 in phpBB 3.0.8):

Code: Select all

<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>

and replace it with the following code:

Code: Select all

<!-- SHM Force Link forum links to open in new window/tab -->
<a class="forumlink" href="{forumrow.U_VIEWFORUM}" target="_blank">{forumrow.FORUM_NAME}</a>

Finishing Up
Save the files, upload them to your server and refresh your templates. That's all there is to it.

This fix works with normal links, counted links and even links with forum passwords.