Index & Profile Links in New Window

Index & Profile Links in New Window

31 Jan Christian No Comments »

One of the features I love in phpBB3 is the ability to add a link to to the index page, appearing as though it’s actually a forum. And to add to that, you can add a description, track the number of times its been clicked and even choose which members / groups can see it. Unfortunately though, the link opens in the same window, meaning when a member or guest follows the link they’re taken away from your forum – hardly the result you were looking for, right?

By applying this small tweak, users who click the link will see it open in a new tab, or in a new window if their browser doesn’t support tabs.

Prosilver Using Subsilver2?

Open: /styles/prosilver/template/forumlist_body.html

Find:

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

Replace with:

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle" <!-- IF forumrow.S_IS_LINK -->target="_blank"<!-- ENDIF -->>{forumrow.FORUM_NAME}</a>

The same problem also occurs whilst viewing a topic. A user who has entered a link into the “Website:” field of the User Control Panel will have a small globe icon displayed next to each of their posts. As you may have guessed, this also opens in the current window. To fix this:

Open: /styles/prosilver/template/viewtopic_body.html

Find:

<!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->

Replace with:

<!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}" target="_blank"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->

The problem still persists in two other locations. Firstly whilst viewing a user’s profile and secondly whilst viewing the member list.

Open: /styles/prosilver/template/memberlist_view.html

Find:

<!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF -->

Replace with:

<!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}" target="_blank">{U_WWW}</a></dd><!-- ENDIF -->

and finally Open: /styles/prosilver/template/memberlist_body.html

Find:

<td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>

Replace with:

<td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}" target="_blank">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>

Clear your template & browser cache. :)


Subsilver2
Open: /styles/subsilver2/template/forumlist_body.html

Find:

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

Replace with:

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

The problem also occurs If a user has entered a link into the “Website:” field of the User Control Panel. Although it won’t show a link next to their posts, it still appears when viewing their profile or the memberlist.

Open: /styles/subsilver2/template/memberlist_view.html

Find:

<td><!-- IF U_WWW --><b><a class="genmed" href="{U_WWW}">{U_WWW}</a></b><!-- ENDIF --></td>

Replace with:

<td><!-- IF U_WWW --><b><a class="genmed" href="{U_WWW}" target="_blank">{U_WWW}</a></b><!-- ENDIF --></td>

Open: /styles/subsilver2/template/memberlist_body.html

Find:

<td class="gen" align="center">&nbsp;<!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}">{WWW_IMG}</a><!-- ENDIF -->&nbsp;</td>

Replace with:

<td class="gen" align="center">&nbsp;<!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}" target="_blank">{WWW_IMG}</a><!-- ENDIF -->&nbsp;</td>

Refresh your template & browser cache. :)

Comments are closed.

© ChristianBullock.com 2009, 2010 • Powered by Hot Chocolate (and Wordpress)
xHTML 1.0