2

I have a phpBB board 3 with prosilver style.

When a user clicks on a link in a post the browser will open it in the same tab. Is it possible that I can change it, so that the browser opens the links in a new tab or window?

Adam
  • 25,960
  • 22
  • 158
  • 247

2 Answers2

5

To complete Steve's answer, if you only want alter links in a post, you only have to edit the bbcode.html file.

  1. Open phpBB/styles/prosilver/template/bbcode.html file,
  2. Search (line 26 on last version) :

    <!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->

  3. Replace it with :

    <!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->

I hope to be helpful,

(Sorry for my language, I'm not fluent in English)

Location file : https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/styles/prosilver/template/bbcode.html

Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70
2

To make any HTML link open in a new tab, you can use the target attribute...

<a href="/" target="_blank">Link</a>

You may need to change your PHPBB templates to add this attribute.

Fenton
  • 241,084
  • 71
  • 387
  • 401
  • So I guess I have to distinguish between auto-detected links and links that have been marked by the user as a link with the [url] code? – Adam Jul 30 '14 at 21:29
  • Ah - for user submitted links going to external sources, you can use a PHPBB MOD: https://www.phpbb.com/community/viewtopic.php?f=70&t=2113035 – Fenton Jul 30 '14 at 21:32
  • Thanks. I also find another work around here https://www.phpbb.com/kb/article/links-opening-new-windows/ – Adam Jul 30 '14 at 21:40