[ABD] Opening External Link in New Window

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [BETA] Opening External Link in New Window

Post by digioz »

JoelWong wrote:Holy cow! I have been searching for this for AGES! Thanks!!!
You are very welcome. :)

I have also submitted this mod to the Mod Database here, pending Validation:

http://www.phpbb.com/customise/db/mod/o ... ew_window/
DigiOz Multimedia
http://www.digioz.com
donna03281
Registered User
Posts: 8
Joined: Fri Jul 22, 2011 3:25 pm

Re: [RC] Opening External Link in New Window

Post by donna03281 »

This is what I'm looking for in connection with the links I use to reference other sites, however, how does this work for videos (i.e., youtube) that I've included in a post. Will those, too, open in a new window? Is there anyway to make to make a choice of whether or not to open in a new window? I have made some html based pages for my phpbb site, some of which I would want to open in new windows and some not, so I was hoping to be able to have either option. Is this possible? Was hoping to get the full picture before initiating the mod.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

donna03281 wrote:This is what I'm looking for in connection with the links I use to reference other sites, however, how does this work for videos (i.e., youtube) that I've included in a post. Will those, too, open in a new window? Is there anyway to make to make a choice of whether or not to open in a new window? I have made some html based pages for my phpbb site, some of which I would want to open in new windows and some not, so I was hoping to be able to have either option. Is this possible? Was hoping to get the full picture before initiating the mod.
The current version opens all links in a new window if they have an external URL. This includes pages, images, videos, and anything else that has an external URL.

Pete
DigiOz Multimedia
http://www.digioz.com
User avatar
Zaishen
Registered User
Posts: 199
Joined: Sat Dec 18, 2010 6:08 am

Re: [RC] Opening External Link in New Window

Post by Zaishen »

Amazing one, thanks man, i was searching for one mod like this one and i think exists one called "prime links" or something like that, some days ago i was thinking to install that mod but i said "ill wait a bit more" and now i see you with this. :lol:

Im going to install this, because is good to not close your forum when u want to visit external links.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

You are very welcome. I think this is probably the easiest way to do it, with the least amount of mess. :)
DigiOz Multimedia
http://www.digioz.com
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

Oops, duplicate post.
DigiOz Multimedia
http://www.digioz.com
kryp2nite26
Registered User
Posts: 68
Joined: Mon Nov 08, 2010 5:42 pm

Re: [RC] Opening External Link in New Window

Post by kryp2nite26 »

Can someone help me get this to work on phpBB3 version 3.0.7PL1? Im using a different theme than prosilver and i cant get ANY of the Mods that do this to work. Ive followed the instructions perfectly but they still dont work for me. Why the heck isnt there an option in the ACP for this. This should be STANDARD in phpBB3.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

Are you trying to install manually or using ModX?
DigiOz Multimedia
http://www.digioz.com
kryp2nite26
Registered User
Posts: 68
Joined: Mon Nov 08, 2010 5:42 pm

Re: [RC] Opening External Link in New Window

Post by kryp2nite26 »

digioz wrote:Are you trying to install manually or using ModX?
I use AutoMod. But for this Mod i tried to do it manually.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

Do you see any JavaScript error messages in the browser? Are you sure you added all the code in the correct location?
DigiOz Multimedia
http://www.digioz.com
kryp2nite26
Registered User
Posts: 68
Joined: Mon Nov 08, 2010 5:42 pm

Re: [RC] Opening External Link in New Window

Post by kryp2nite26 »

I dont see any errors at all after i apply the code change and purge my cache. Links just behave the way they normally did before i applied the changes. I am pretty sure i put it in the right place. It says to find this line, and that it may be a partial find, which it is for me:

Code: Select all

<link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
I dont have that exact line, i have this one:

Code: Select all

<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
And im adding it after this.
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

Open up the "overall_header.html" file. Look for the "</head>" tag in that file. Right BEFORE the "</head>" tag, add this:

Code: Select all

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>         
    <script type="text/javascript">                                         
       $(document).ready(function() {
          $('a[href^="http://"]').filter(function() {return this.hostname && this.hostname !== location.hostname;}).attr('target', '_blank');
       });                     
    </script>
That's all you should need to do. But make sure it is in the header region.

Pete
DigiOz Multimedia
http://www.digioz.com
kryp2nite26
Registered User
Posts: 68
Joined: Mon Nov 08, 2010 5:42 pm

Re: [RC] Opening External Link in New Window

Post by kryp2nite26 »

Got it working, thanks guys!!
!karolis
Registered User
Posts: 133
Joined: Sun Jun 13, 2010 9:54 am

Re: [RC] Opening External Link in New Window

Post by !karolis »

thanks
so it is fully testes?
User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [RC] Opening External Link in New Window

Post by digioz »

I have been using it on several of my sites in production for a few month now and have not had any issues. Several other users have also posted here that it is working fine for them, so I would say yes, it is tested.

Pete
DigiOz Multimedia
http://www.digioz.com
Locked

Return to “[3.0.x] Abandoned MODs”