Links in New Window

Submitted by CyberAlien, May 2007.
In phpBB 3 proSilver style all links open in same window. It might be frustrating for visitors, especially not computer savvy ones. This tutorial explains how to change links to open in new window.

1. Forums with type=link

In styles/prosilver/template/forumlist_body.html find this:
Code:
  1. <a href="{forumrow.U_VIEWFORUM}" class="forumtitle"> 
and replace with this:
Code:
  1. <a href="{forumrow.U_VIEWFORUM}" class="forumtitle"<!-- IF forumrow.S_IS_LINK --> target="_blank"<!-- ENDIF -->

2. Links inside posts

In styles/prosilver/template/bbcode.html find this:
Code:
  1. <!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url --> 
and replace with this:
Code:
  1. <!-- BEGIN url --><a href="{URL}" class="postlink" target="_blank">{DESCRIPTION}</a><!-- END url -->  
Then open includes/functions.php, find this (around line 2704):
Code:
  1. $html    = "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append"; 
and replace with this:
Code:
  1. $html    = "$whitespace<!-- $tag --><a$class href=\"$url\" target=\"_blank\">$text</a><!-- $tag -->$append"; 

Share this tutorial

If you want to show this tutorial to someone else please use following code to link to this tutorial:
HTML Link:
Forum BBCode:
Content of this tutorial may not be published anywhere else without author's permission. Please link to this page instead.