Topic: opening links in

When some one ads u url to a message now (1.20.0) and you click on it it will open the page not in a new tab in IE7 and in Firefox buth in the same one where you are reading the forum.
Thats not as in the old vesion (1.1.14) where it did open a new page.

Re: opening links in

Alter the line 280 of parser.php to kind of:

    return '<a href="'.$full_url.'" taget="_blank">'.$link.'</a>';
Carpe diem

Re: opening links in

i did change line 280
from
return '<a href="'.$full_url.'">'.$link.'</a>';

to
return '<a href="'.$full_url.'" taget="_blank">'.$link.'</a>';

Only i dont see any change

The parser file whas located in inculde, is this correct

Re: opening links in

u see the " ' or the ' " need a space ..return '<a href="'.$full_url.'" taget="_blank">'.$link.'</a>';
q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: opening links in

Sorry buth as far as i can see are
return '<a href="'.$full_url.'" taget="_blank">'.$link.'</a>';
or the line you write
return '<a href="'.$full_url.'" taget="_blank">'.$link.'</a>';
the same
so where must i do the space

Re: opening links in

What's the HTML code of the link after the page is parsed?

Carpe diem

Re: opening links in

sorry i dont understand

Re: opening links in

http://forum.offshoreradio.org/viewtopic.php?id=4581

Re: opening links in

1. Quaker is right: you have extra space before the actual link in the code.
2. And the most funny thing is that none of us noticed my typo: taget instead of target.

The correct code is:

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

And now you must be having kind of

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

(note extra space in href=" '.$ - remove it)

Good luck.

Carpe diem

Re: opening links in

YES YES YES:D:D

Re: opening links in

small other question
I did find this to hide links from guest is that also opening links in a new page ?

Mod title:  Hide Links From Guests
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.15
##     Release date:  2007-09-10
##           Author:  Natanzuelo (http://gritalo.wordpress.com)
##
##      Description:  This Mod hides links from guests, and displays
##                    any text or image you want instead of it.
##       You can put a link to the register page instead
##       of the real link.
##
##
##   Affected files:  include/parser.php
##
##       Affects DB:  No
##
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##


#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

parser.php

#
#---------[ 2. FIND ]-----------------------------------------------------------
#

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

#
#---------[ 3. REPLACE WITH ]---------------------------------------------------
#

// Hide Links From Guests 1.0
    if ($pun_user['is_guest'] )
    return ' <span class="members-only">REPLACE THIS</span>';
    else
    return '<a href="'.$full_url.'" onclick="window.open(this.href); return false;">'.$link.'</a>';
// End of Hide Links From Guests 1.0


*Note: You have the replace the words "REPLACE THIS" with whatever you want to show instead of the links.
You can use HTML to put a link to the register.php page if you want.

#
#---------[ 4. SAVE AND UPLOAD ]------------------------------------------------
#

Re: opening links in

Yes. Though it uses javascript to create new window.

Carpe diem

Re: opening links in

Thanks 2 problems solved in once smile

Re: opening links in

Hello. Please tell me how to make so that only links to other sites open in a new window? A link to my forum to open in the same window.

Excuse me, this is a translation from Russian translator in Google.

15 (edited by pashulik 2014-01-17 07:43)

Re: opening links in

Solved the problem yourself:
In the file "header.php" before the

</ head> 

added script:

<script type="text/javascript">  
$(document).ready(function() {  
   $("a[href^=http]").each(  
   function(){  
   if(this.href.indexOf(location.hostname) == -1) {  
   $(this).attr('target', '_blank');  
   }  
   })  
});  
</script> 

Re: opening links in

I do anything wrong, or this didn't work?

17

Re: opening links in

All right, if you're still using version 1.2 wink

Re: opening links in

I had the same problem, thanks for the solution:)