Whenever I add a [URL=......]
link in image captions, Coppermine inserts a target_blank
into the actual link as it appears on the page.
Is there a way to change that (preferably to remove it)?
I've searched in the documentation and in the forum, but found nothing related to this problem.
Thanks in advance
Jørgen Peter Kjeldsen
include/functions.inc.php
$bbcode_tpl['url'] = '<span class="bblink"><a href="{URL}" target="_blank">{DESCRIPTION}</a></span>';
Just remove the target="_blank".
Quote from: Nibbler on September 02, 2004, 08:32:55 PM
Just remove the target="_blank".
Thank you!
Jorgen Peter Kjeldsen
Ok I know it's an old article and not recommended to use 1.3.x versions but I thought this might be usefull for somebody so posting it here.
In case you dont want to use all links as external but some internal and some external (read: some in new windows some in the same) you can also add some extra codes to the function bb_decode($text) in your functions.inc.php file.
I used it for a website who wanted to make links to internal thumbnail pages in the same browser (big picture with link) but also used links to other sites which needed to be opened in a new window.
Therefore I coded internal links as [iurl] [/iurl]
i stands for internal further the use is the same as [url][/url]
.
To use this add after :
if (!count($bbcode_tpl)) {
$bbcode_tpl['url'] = '<span class="bblink"><a href="{URL}" target="_blank">{DESCRIPTION}</a></span>';
this code:
$bbcode_tpl['iurl'] = '<span class="bblink"><a href="{URL}" target="_self">{DESCRIPTION}</a></span>';
and after
$patterns[6] = "#\[img\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/img\]#si";
$replacements[6] = $bbcode_tpl['img'];
the following (in case patterns is allready higher than 6 just count further)
$bbcode_tpl['iurl1'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['iurl']);
$bbcode_tpl['iurl1'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['iurl1']);
$bbcode_tpl['iurl2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['iurl']);
$bbcode_tpl['iurl2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['iurl2']);
$bbcode_tpl['iurl3'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['iurl']);
$bbcode_tpl['iurl3'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['iurl3']);
$bbcode_tpl['iurl4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['iurl']);
$bbcode_tpl['iurl4'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['iurl4']);
// [iurl]xxxx://www.phpbb.com[/iurl] code..
$patterns[7] = "#\[iurl\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/iurl\]#si";
$replacements[7] = $bbcode_tpl['iurl1'];
// [iurl]www.phpbb.com[/iurl] code.. (no xxxx:// prefix).
$patterns[8] = "#\[iurl\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/iurl\]#si";
$replacements[8] = $bbcode_tpl['iurl2'];
// [iurl=xxxx://www.phpbb.com]phpBB[/iurl] code..
$patterns[9] = "#\[iurl=([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/iurl\]#si";
$replacements[9] = $bbcode_tpl['iurl3'];
// [iurl=www.phpbb.com]phpBB[/iurl] code.. (no xxxx:// prefix).
$patterns[10] = "#\[iurl=([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/iurl\]#si";
$replacements[10] = $bbcode_tpl['iurl4'];