Open link in a new window

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 10:08 am

Hi
I am not sure if I put this post in the right area or not I am not sure how to classify it so sorry if its in the wrong area.

Our group finally decided to make the change from PHPBB2 to PHPBB3 and am getting complaints about the links in post, in PHPBB2 when you clicked a link it opened the link in a new window in PHPBB3 it opens in the same window how can we make it like PHPBB2 and the link just open in a new window?

I used the search and it found "Search found 4986 matches: open link in a new window"

Thanks in advance.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7618
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Open link in a new window

Post by JimA » Mon Aug 02, 2010 10:10 am

Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Re: Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 11:03 am

Hi thanks for the reply, I tried to follow the instructions but in the first step I cant find the code
$html = "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append"; to replace and dont see it at about line 592 in the includes/functions_content.php file.

Has something changed?

Thanks again.

User avatar
AmigoJack
Registered User
Posts: 5599
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Open link in a new window

Post by AmigoJack » Mon Aug 02, 2010 11:26 am

rusty12345678909 wrote:I cant find the code
$html = "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append"; to replace
But you're able to find only one occurance of

Code: Select all

"$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append";
at line 629 (if we're talking about version 3.0.7-PL1).
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Re: Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 11:46 am

AmigoJack wrote:
rusty12345678909 wrote:I cant find the code
$html = "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append"; to replace
But you're able to find only one occurance of

Code: Select all

"$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append";
at line 629 (if we're talking about version 3.0.7-PL1).

Yes I am sorry I am running 3.0.7-PL1

line 629 is

Code: Select all

$html	= "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append";

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Open link in a new window

Post by ric323 » Mon Aug 02, 2010 11:52 am

Your file has a tab before the "=". The KB article has spaces.
Your text editor is looking for an exact match on the white space characters.

That article was written over two years ago, so the line number has increased a little over the last few versions.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Re: Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 12:31 pm

ric323 wrote:Your file has a tab before the "=". The KB article has spaces.
Your text editor is looking for an exact match on the white space characters.

That article was written over two years ago, so the line number has increased a little over the last few versions.

Ahh ok, thanks, so now what do I do I am confused at what to remove from my file I think I am still using the instructions "replace" and the current code?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Open link in a new window

Post by ric323 » Mon Aug 02, 2010 12:38 pm

The code you posted is identical to what the article says to replace, ignoring the discrepancy between spaces and tabs, so go ahead and replace it with the suggested replacement text.
Don't forget to flush your phpBB cache after uploading the new version.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Re: Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 12:55 pm

ric323 wrote:The code you posted is identical to what the article says to replace, ignoring the discrepancy between spaces and tabs, so go ahead and replace it with the suggested replacement text.
Don't forget to flush your phpBB cache after uploading the new version.
So I should go to line 629 and replace everything on line 629 with the below?

Code: Select all

        if ($type == MAGIC_URL_EMAIL)
        {
            $html    = "$whitespace<!-- $tag --><a$class href=\"$url\">$text</a><!-- $tag -->$append";    
        }
        else 
        {
            $html    = "$whitespace<!-- $tag --><a$class href=\"$url\" onclick=\"window.open(this.href);return false;\">$text</a><!-- $tag -->$append";
        } 

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Open link in a new window

Post by ric323 » Mon Aug 02, 2010 10:12 pm

Yes
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

rusty12345678909
Registered User
Posts: 170
Joined: Mon Mar 13, 2006 7:09 pm

Re: Open link in a new window

Post by rusty12345678909 » Mon Aug 02, 2010 11:17 pm

Thanks much got it, this works on all NEW post but all the old post already on the site it opens in the same windows.

Thanks again for the help, great job, sorry for any confusion.

Locked

Return to “[3.0.x] Support Forum”