1 (edited by TFD 2006-10-09 20:50)

Topic: Is it possible to make links on the board open in a new window?

and if so what do I change? Thanks in advance.

Re: Is it possible to make links on the board open in a new window?

If you're asking it as a feature request I hardly believe you'll get it because PunBB uses XHTML 1.0 Strict which forbids the target attribute in the <a> tag. If you want to change it yourself for your board check the functions.php and add target="_new" in every link  (starting from line 243).

3

Re: Is it possible to make links on the board open in a new window?

Yeah I guess I just wanted to know how to do it myself. Thanks a bunch!

Re: Is it possible to make links on the board open in a new window?

there is a mod you can search for and install that puts a yes or no option to open links in a new window

5

Re: Is it possible to make links on the board open in a new window?

There is? anybody know the name?

6 (edited by deadram 2006-10-10 16:29)

Re: Is it possible to make links on the board open in a new window?

Strofanto already answered your question.

open include/functions.php

and look for the part that turns http://address into <a href="http://address">address</a>
Now, in the <a href="blah"> change it to <a target="_blank" href="blah">

Easy stuff big_smile

echo "deadram"; echo; fortune;

Re: Is it possible to make links on the board open in a new window?

deadram wrote:

Strofanto already answered your question.

open include/functions.php

and look for the part that turns http://address into <a href="http://address">address</a>
Now, in the <a href="blah"> change it to <a target="_blank" href="blah">

Easy stuff big_smile

where exactly is this? which line in code??? please help...

Re: Is it possible to make links on the board open in a new window?

Don't you have a search function? =/

9 (edited by Grant 2007-09-11 10:21)

Re: Is it possible to make links on the board open in a new window?

On my site http://adsbb.co.za/ I changed include/parser.php:

// Ok, not very pretty :-)
    $link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' … '.substr($url, -10) : $url) : stripslashes($link);

    return '<a target="_blank" href="'.$full_url.'">'.$link.'</a>';
}


//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a target="_blank" href="'.$url.'"><'.$lang_common['Image link'].'></a>';

10

Re: Is it possible to make links on the board open in a new window?

http://wiki.punres.org/Open_links_in_a_new_window

Re: Is it possible to make links on the board open in a new window?

Doing it unconditionally, and doing it with the target HTML attribute, is a very, very bad idea.

12

Re: Is it possible to make links on the board open in a new window?

Jérémie wrote:

Doing it unconditionally, and doing it with the target HTML attribute, is a very, very bad idea.

Meaning? Issuing a warning like that would be far better if a brief description of why, (or an alternative method to use), was provided. smile

Re: Is it possible to make links on the board open in a new window?

It's only the 13th time I've explained why, on these forums alone smile

Google is your friend.

14

Re: Is it possible to make links on the board open in a new window?

1. The target attribute is not valid xhtml

2. Browser behaviour is the job of the behaviour layer i.e. javascript and not markup.

3. It deprives users of the choice. Some people might want links opened in the same window.

4. It causes accessibility problems as it is not the standard behaviour and kills the functionality of the back button.

5. It causes confusion to people surfing with IE maximized as they might not even realise a new window has opened (since it completely covers the window underneath).

15

Re: Is it possible to make links on the board open in a new window?

Jérémie wrote:

It's only the 13th time I've explained why, on these forums alone smile

big_smile big_smile Didn't mean it to sound blaise, so to speak. Just meant it's better to quantify the answer with a definition. Just makes it easier if this topic ever pops up in a future search by someone. smile