Links in new window

How-to's, little tricks, tutorials, code examples (snippets) and read-me's.

Re: Links in new window

Postby IPB_Refugee » 03 Oct 2007, 16:14

Additionally it is a very good advice to recreate all custom BBCodes you already have in your phpBB-2 board and to install primehalo's MOD or Kjell's MOD before you upgrade your database to Olympus. This will save you a lot of troubles. (Unfortunately this tip doesn't help when you've gone already live with Olympus.)

Regards
Wolfgang
User avatar
IPB_Refugee    
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 100
Joined: 21 Jun 2007, 03:24
Location: Austria, EU
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Links in new window

Postby Patricia » 03 Oct 2007, 16:20

IPB_Refugee wrote:Additionally it is a very good advice to recreate all custom BBCodes you already have in your phpBB-2 board and to install primehalo's MOD or Kjell's MOD before you upgrade your database to Olympus. This will save you a lot of troubles. (Unfortunately this tip doesn't help when you've gone already live with Olympus.)

Regards
Wolfgang


Hi,

I am running phpbb3 from beta 3 stage. :thumbsup:

But everything is fine. The MOD works ok.

Thanks
User avatar
Patricia    
STG Moderator
STG Moderator
 
Posts: 833
Joined: 09 Feb 2007, 08:27
Location: latitude: 51.00 - longitude: 5.87
Gender: Female

Re: Links in new window

Postby jdh » 03 Oct 2007, 16:53

Beta 3?!?! You should update.... :P
Iron helmets will not save
Even heroes from the grave.
Good men's blood will drain away
while the wicked win the day.
User avatar
jdh    
STG Support Team
STG Support Team
 
Posts: 1508
Joined: 05 May 2007, 08:04
Location: Wisconsin
Gender: Male
phpBB Knowledge: 7

Re: Links in new window

Postby Patricia » 03 Oct 2007, 17:16

Beta 3 is where I started the forum, running now in RC5 :wave:
User avatar
Patricia    
STG Moderator
STG Moderator
 
Posts: 833
Joined: 09 Feb 2007, 08:27
Location: latitude: 51.00 - longitude: 5.87
Gender: Female

Re: Links in new window

Postby Kjell » 10 Nov 2007, 14:46

A small updating for prosilver, see the first message. RC5-RC7
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

Re: Links in new window

Postby Kjell » 25 Nov 2007, 03:49

Update to RC7: new file /includes/functions_content.php
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

Re: Links in new window

Postby CelticSpirits » 25 Dec 2007, 13:59

How do I force external links to a new window? I would really rather not have external links opening in the same window. I have made the changes for links posted in the forum, but I would like links that are on the portal to open in new windows. Is there a way to do that? /in.php?" target="_blank"> does adding that behind url's force new windows? If so, why does it not work on all links? What am I missing? :banghead:
Image
User avatar
CelticSpirits    
Cadet I
Cadet I
 
Posts: 16
Joined: 24 Dec 2007, 16:15
Location: Santa Barabra, Ca
Favorite Team: San Diego Chargers
Gender: Female

Re: Links in new window

Postby Kjell » 27 Dec 2007, 00:29

Tray this CelticSpirits

Inluces/function_contant.php
Replays
Code: Select all
$html    = "$whitespace<!-- $tag --><a$class target=\" href=\"$url\">$text</a><!-- $tag -->$append";

With
Code: Select all
$html    = "$whitespace<!-- $tag --><a$class target=\"_blank\" href=\"$url\">$text</a><!-- $tag -->$append";


Includes/function.php
Replays
Code: Select all
case 'bbcode_htm':
         return array(
            '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
            '#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&amp;|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
            '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
            '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
            '#<!\-\- .*? \-\->#s',
            '#<.*?>#s',
         );
      break;

With
Code: Select all
case 'bbcode_htm':
         return array(
            '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
            '#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&amp;|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
            '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" target="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
            '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
            '#<!\-\- .*? \-\->#s',
            '#<.*?>#s',
         );
      break;


styles/subsilver/templates/bbcode.html
Replays
Code: Select all
<!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->


With
Code: Select all
<!-- BEGIN url --><a href="{URL}" class="postlink" target="_blank">{DESCRIPTION}</a><!-- END url -->
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

Re: Links in new window

Postby CelticSpirits » 05 Jan 2008, 14:46

Kjell, I changed the codes, and links are still opening in the same window, any other ideas? :doh:
Image
User avatar
CelticSpirits    
Cadet I
Cadet I
 
Posts: 16
Joined: 24 Dec 2007, 16:15
Location: Santa Barabra, Ca
Favorite Team: San Diego Chargers
Gender: Female

Re: Links in new window

Postby Kjell » 06 Jan 2008, 01:40

Its working for me but any plain text links made before the second change will not open in a new window.
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

PreviousNext

Return to Tutorials and How-Tos

Who is online

Users browsing this forum: No registered users and 10 guests