[solved] Differentiate between local and external links

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

[solved] Differentiate between local and external links

Post by IPB_Refugee »

<!--
This request has been fulfilled by primehalo's MOD [BETA] Prime Links - Classify Locals & Target Externals Thank you, prime!
-->



Hi,

here is good advice how to open links in a new window instead of the same window:

http://www.phpbb.com/community/viewtopi ... 6&t=544131

But I think converting the Local Links MOD to Olympus would be fine:
## Mod Title: Local Links
## Mod Version: 1.1.0
## Author: netclectic < adrian [et] netclectic.com > Adrian Cockburn - http://www.netclectic.com
## Description: This MOD will cause any local URLs (i.e. http://www.YOURDOMAIN.com) posted to your
## board to open in the same window instead of in a new window, ( i.e. _self instead of _blank ).
Regards
Wolfgang
Last edited by IPB_Refugee on Tue Sep 25, 2007 4:38 pm, edited 2 times in total.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: [request] Local Links for Olympus

Post by igorw »

In phpBB3 all links open in the same window. With a good reason: The user has to decide how he wants to follow the link. If he wants it in a new window, ctrl+click (in firefox at least), if he doesn't just click. Using _blank takes excactly that freedom away ;)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [request] Local Links for Olympus

Post by IPB_Refugee »

Hi evil<3,

I know how to use firefox. But on my board the users have absolutely no freedom and no rights. Therefore I´d like to have the Local Links MOD for Olympus. :P

Link to my site --> opens in same window
Link to a different site --> opens in new window

Maybe we could let decide every user by his own which alternative he/she prefers via a new facility in the UCP. But then we still need a MOD. (I´d prefer the Local Links MOD because that would be really useful in my board and not everybody knows how to open a link in a new window. E.g. there are boards for elderly people, too. Once they are away from your board, they never come back.)

Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [request] Local Links for Olympus

Post by IPB_Refugee »

Hi,

I think this one should be bumped because with a Local Links MOD you could do additional things like letting run external links over anonym.to and so on.

Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

Hi,

another month over. :shock: Ain't it funny how time slips away?

Here is the best solution so far (thanks to karlsemple!) regarding the problem how to differentiate between local links and external links:

http://www.ktuk.net/phpBB3/viewtopic.php?f=32&t=2721

Unfortunately two problems are still open (follow the link to see what I mean) and therefore this request remains open.

Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

Just a topic bumping.

When we had a way to differentiate between local links and links to other sites it would be easy to fulfill e.g. this request in an intelligent way, too. Or we could use different styles for internal and external links via CSS.

Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

Just a topic bumping.

As I said, karlsemple's MOD is the best solution up to now.

Unfortunately his MOD has two problems:
  • It only works with magic URLs, not with the BBCode [ url ]
  • Only links to the own viewforum and viewtopic pages are recognized as local links. So, for example, on karlsemple's board a link to http://www.ktuk.net/phpBB3/sportsbook.php is not recognized as local but as external and therefore opens in a new window. But it's a local link and should open in the same window.
Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

Unfortunately just a topic bumping.
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm
Contact:

Re: [request] Local Links for Olympus

Post by cotp »

eviL<3 wrote:In phpBB3 all links open in the same window. With a good reason: The user has to decide how he wants to follow the link. If he wants it in a new window, ctrl+click (in firefox at least), if he doesn't just click. Using _blank takes excactly that freedom away ;)
The user has to decide but if he can know why and how to decide :)

For example if I don't know that a link is an external one, then I am confused...

Wikipedia uses Image

I have read on another post that this mOD:
http://www.ktuk.net/phpBB3/viewtopic.php?f=32&t=2618

doesn't take care of the links already there in the database, is it true ?

Cotp
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

The MOD you linked does not differentiate between local and external links. Therefore the request remains open.

And yes, you are right: You have to install this MOD before you upgrade your database. Then your old links will open in a new window, too.

As soon as we know a way to differentiate between local links and external links you can easily add an icon like Image to all external links. That would not be a problem. ;)

Regards
Wolfgang
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: [req] Differentiate between local and external links

Post by karlsemple »

IPB_Refugee wrote:The MOD you linked does not differentiate between local and external links. Therefore the request remains open.

And yes, you are right: You have to install this MOD before you upgrade your database. Then your old links will open in a new window, too.

As soon as we know a way to differentiate between local links and external links you can easily add an icon like Image to all external links. That would not be a problem. ;)

Regards
Wolfgang
No, but the one in that forum below it does http://www.ktuk.net/phpBB3/viewtopic.php?f=32&t=2721 although it depends on whether you class local links in the same way as the software does :) and that is where the mod request here lies. The user want any link with the same domain as the forum to remain in the same window why having all other links open in a new window.
Image
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm
Contact:

Re: [req] Differentiate between local and external links

Post by cotp »

Please note that only links made after the change will be affected by this. To get old links to work correctly you will need to edit and submit the posts that contain them. This is because the link formatting is applied to the link before it is submitted to the database and thus any changes to the link format will not be in place on existing links.
Since I already updated my database and it was a pain with old bbcode, I am not ready to edit every post manually :shock:

Cotp
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: [req] Differentiate between local and external links

Post by karlsemple »

cotp wrote:
Please note that only links made after the change will be affected by this. To get old links to work correctly you will need to edit and submit the posts that contain them. This is because the link formatting is applied to the link before it is submitted to the database and thus any changes to the link format will not be in place on existing links.
Since I already updated my database and it was a pain with old bbcode, I am not ready to edit every post manually :shock:

Cotp

Well you have two options....do it manually or write a script to do it for you, but that is how the software works the links are formatted and then entered into the database :)
Image
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [req] Differentiate between local and external links

Post by IPB_Refugee »

@cotp:

Maybe you don't need a script but only a SQL query. Look at the SQL code on this (German) page

http://www.phpbb.de/viewtopic.php?p=317782#317782

and adjust it for Olympus. E.g.: What's Olympus' name for phpBB-2's table phpbb_posts_text? How do links appear in the posts_text table? So you can try to replace e.g. <a href= with <a target="_blank" href= But please take a closer look to the database first. And never forget to make a backup of your database before doing such things!
karlsemple wrote:No, but the one in that forum below it does http://www.ktuk.net/phpBB3/viewtopic.php?f=32&t=2721 although it depends on whether you class local links in the same way as the software does :) and that is where the mod request here lies. The user want any link with the same domain as the forum to remain in the same window why having all other links open in a new window.
Absolutely right, Sir. :)

For example, here on phpBB.com according to my request these links should be considered as local:

http://www.phpbb.com/community/viewtopi ... 2&t=544341
http://www.phpbb.com/community/viewforum.php?f=81
http://www.phpbb.com
http://www.phpbb.com/
testlink
http://www.phpbb.com/support/documentation/3.0/
phpBB 3.0 Olympus Documentation
Bug Tracker for Olympus

Please note that some links are magic URLs and some links use BBCode [ url]. All links to these "internal" pages should open in the same window while all links to external pages like http://www.example.com should open in a new window.

As soon as this is realized you can do many other things easily - e.g. give external links another style through CSS, add an image to external links like cotp suggested above and let all external links run over anonym.to (BTW: As far as I know all these things have already been requested, too.)

Have a nice sunday!
Wolfgang
talknightlife
Registered User
Posts: 6
Joined: Thu Sep 20, 2007 8:15 pm

Re: [req] Differentiate between local and external links

Post by talknightlife »

Bump!

I don't want to force users into any particular behavior, and I'm not at all interested in making any kind of link open in a new window. But I do want to be able to style local links differently than external links so that my users are better empowered to make their own decisions.

When I'm on Wikipedia, I often click on local links to surf through the encyclopedia, but I open external links in a new tab. I want to empower my forum users to do the same kind of thing if they want. It at least communicates more to users about what will happen when they click a link, which is a Good Thing in terms of usability, not a bad thing. It allows users to trust the system more.
Locked

Return to “[3.0.x] MOD Requests”