How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Get help developing custom BBCodes or request one.
User avatar
Mike63740
Registered User
Posts: 124
Joined: Fri Feb 03, 2012 8:19 pm

How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Post by Mike63740 »

How can a forum post, open a link to a PDF, in a new window, without a Right-click?

I am currently using phpBB 3.3.9 board.

Thanks you.
Last edited by Mick on Tue Mar 14, 2023 12:41 pm, edited 3 times in total.
Reason: Solved.
Open-source software has been changing lives since 1998.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26508
Joined: Fri Aug 29, 2008 9:49 am

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Mick »

Most browsers, FF included, have an option for how portable documents (PDF) open.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
Lumpy Burgertushie
Registered User
Posts: 69224
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Lumpy Burgertushie »

I believe FF opens pdf in a new window or tab by default when you set it to open them. If you have a pdf reader program installed you can tell FF to open pdfs with it instead.

what this means is that it is , and should be, an option for the viewer to decide for themselves.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
GTI
Registered User
Posts: 300
Joined: Mon Aug 24, 2020 4:59 pm
Location: West Sussex
Name: Laura

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by GTI »

Does he mean a forum post with a PDF link in it?

Or does he mean a forum link like the link to Area51 on the index forumlist?

If it is the forum post - there are 2 extensions which open links in new windows: External Link In New Window and ELONW

If it's the forumlist links - you can only do that by making a code change AFAIK.
Most of us will enjoy Christmas in the comfort of our own homes this year, however, sadly, that can't be said for people in the Ukraine who are suffering day after day, due to the Russian invasion.

If you would like to make a small donation to help Ukrainians in their time of need, you can donate to help all Ukrainians via BritishRedCross or you can donate to help the Ukrainian children via Unicef. 🇺🇦 Thank You 🇺🇦
User avatar
Mike63740
Registered User
Posts: 124
Joined: Fri Feb 03, 2012 8:19 pm

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Mike63740 »

This is correct:
GTI wrote: Mon Dec 05, 2022 12:56 am Does he mean a forum post with a PDF link in it?

If it is the forum post - there are 2 extensions which open links in new windows: External Link In New Window and ELONW
I am going to try one or both extensions.

Thanks.
Open-source software has been changing lives since 1998.
User avatar
warmweer
Jr. Extension Validator
Posts: 11235
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by warmweer »

Mike63740 wrote: Mon Dec 05, 2022 8:40 am This is correct:
GTI wrote: Mon Dec 05, 2022 12:56 am Does he mean a forum post with a PDF link in it?

If it is the forum post - there are 2 extensions which open links in new windows: External Link In New Window and ELONW
Just to avoid confusion:
it is the link to the pdf(s) which you would like to open in a new window or a link to a/the post containing a link to a pdf

The first can be automated somewhat but if the pdf is stored within your domain, it'll be treated as an internal link. This can de bypassed using primedomain's Prime Links extension.

The second is almost impossible.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26508
Joined: Fri Aug 29, 2008 9:49 am

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Mick »

So this topic is not specific to PDFs?
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
warmweer
Jr. Extension Validator
Posts: 11235
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by warmweer »

Mick wrote: Mon Dec 05, 2022 10:22 am So this topic is not specific to PDFs?
I think it is but I'm just pointing out that the formulation in the opening topic is ambiguous and opening a forum (or topic, or even a post) containing a link to a PDF, in a new window doesn't seem (to me) what the OP really wants
I think the OP wants the link that points to a PDF to open in a new window/tab (and the 2 extensions mentioned are not specific to pdfs and as such are overkill).
A "simple" solution would be to make a specific BBcode to be used for links to PDFs.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26508
Joined: Fri Aug 29, 2008 9:49 am

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Mick »

Or set the individual browser up properly to do that.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
Lumpy Burgertushie
Registered User
Posts: 69224
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Lumpy Burgertushie »

yes, I believe that by default a browser will open a pdf in a new window or tab.
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
Mike63740
Registered User
Posts: 124
Joined: Fri Feb 03, 2012 8:19 pm

Re: How can a forum with a link to a PDF, open in a new window, without a right-click?

Post by Mike63740 »

warmweer wrote: Mon Dec 05, 2022 9:19 am Just to avoid confusion:
it is the link to the pdf(s) which you would like to open in a new window
Yes. The link to the PDF only, not the post.

The new window would show the PDF only.

Thanks.
Open-source software has been changing lives since 1998.
User avatar
Mike63740
Registered User
Posts: 124
Joined: Fri Feb 03, 2012 8:19 pm

Re: How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Post by Mike63740 »

This is the current format in the post:

"[url=https://mydomain.com/phpbb/pdf/Info.pdf]Current Informatiom[/url]"

Can a bbcode be created for this file only, to open in a new window, with a Left-Click?
Open-source software has been changing lives since 1998.
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6673
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Post by HiFiKabin »

BBCode Usage

Code: Select all

[newtab={URL}]{TEXT}[/newtab]
HTML replacement

Code: Select all

<a href={URL} target="_blank">{TEXT}</a>
Helpline

Code: Select all

Open in New Tab
User avatar
Mike63740
Registered User
Posts: 124
Joined: Fri Feb 03, 2012 8:19 pm

Re: How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Post by Mike63740 »

This code works well:

Code: Select all

[exturl]{URL}[/exturl]

<a href="{URL}" title="{URL}" onclick="window.open(this.href);return false;">{URL}</a>

[exturl]URL to open in a new window[/exturl]
Is there a way to show text, instead of the url?

Thanks.
Open-source software has been changing lives since 1998.
User avatar
warmweer
Jr. Extension Validator
Posts: 11235
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: How can a forum post, open a link to a PDF, in a new window, without a Right-click?

Post by warmweer »

Mike63740 wrote: Fri Feb 03, 2023 2:10 am Is there a way to show text, instead of the url?
That's exactly what the BBcode HiFiKabin posted, features >>> the {TEXT} part
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
Post Reply

Return to “Custom BBCode Development and Requests”