Knowledge Base

Making Link Forum Links Open in New Windows
Article ID: 1053
Written By: Pony99CA
Written On: Mon Feb 21, 2011 7:45 pm
Description: This article describes how to make phpBB Link forum links open in new windows (or tabs).
link to this article on phpbb.com: Select All
[kb=making-link-forum-links-open-in-new-windows]Making Link Forum Links Open in New Windows[/kb]
link to this article on your own board: Select All
[url=http://www.phpbb.com/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.