[RC1] Prime Links - Classify Locals & Target Externals

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Suggested Hosts
Locked
User avatar
canadianlatitude
Registered User
Posts: 94
Joined: Sat Nov 17, 2007 11:13 am
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by canadianlatitude »

Awesome ! :mrgreen: Thank- you very very much for this and it was a snap to install, plus it keeps the html strict validation intact :D
cooldbz
Registered User
Posts: 33
Joined: Sat Dec 08, 2007 3:53 am

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by cooldbz »

primehalo wrote:
cooldbz wrote:Just wanted to know if there is a possibility of this.

The External links opening in same window, but the Site image over it, so that it opens sort of in a frame. What i am asking may be out of context, but its a possibility
Sorry, I don't understand.
Like the Overall_header on top and the External link opening Below.
User avatar
primehalo
Former Team Member
Posts: 2897
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by primehalo »

Sorry, I still don't understand completely. But you can change the target to whatever you want, so you can target a frame.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cooldbz
Registered User
Posts: 33
Joined: Sat Dec 08, 2007 3:53 am

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by cooldbz »

How. Do let me know how i can do that :shock:

And what i mean was that, the Overall_header will be on top. Below that, the External link will open as it is in numerous sites. So it will be something like http://www.phpbb.com/ EXTERNAL LINK
User avatar
primehalo
Former Team Member
Posts: 2897
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by primehalo »

cooldbz wrote:How. Do let me know how i can do that :shock:
Open the included PHP file and change the target. It should be pretty obvious.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
jason bourne
Registered User
Posts: 23
Joined: Fri Jul 27, 2007 9:14 am
Location: uk

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by jason bourne »

Brilliant mod, just what I needed :)
User avatar
Brizzle
Registered User
Posts: 80
Joined: Tue Jan 15, 2008 10:53 pm
Location: Cambridge, MA

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by Brizzle »

I just installed this on my board after having trouble with a few other external linking mods. Works perfectly. Thanks very much for working on this!
User avatar
spacefish
Registered User
Posts: 173
Joined: Mon Oct 09, 2006 8:48 am

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by spacefish »

Should http to be recognised as a local link even if the server url is set to https in ACP - or the other way around?

I've made an edit just below:

Code: Select all

$is_local 	= $this->is_link_local($href, $board_url);
And that works but I thought they'd be treated alike regardless of the protocol?

Thanks. :)
User avatar
primehalo
Former Team Member
Posts: 2897
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by primehalo »

I didn't consider that. I think this should fix it:
In prime_links.php, find

Code: Select all

            if (!($is_local = (strpos($url, utf8_case_fold_nfc($board_url)) === 0)))     
Before, add

Code: Select all

            // Treat http and https as the same scheme
            $board_url    = (strpos($board_url, 'https://') === 0) ? ('http' . substr($board_url, 5)) : $board_url;
            $url         = (strpos($url        , 'https://') === 0) ? ('http' . substr($url,         5)) : $url;
     
What edit did you do to make it work?
Last edited by primehalo on Sat Mar 08, 2008 9:34 am, edited 1 time in total.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
spacefish
Registered User
Posts: 173
Joined: Mon Oct 09, 2006 8:48 am

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by spacefish »

No sorry - that one didn't work. I'm just trying this out locally at the moment and had posted a https full board link similar as below, but it still gets treated like an external link.

This is what I had placed:

Code: Select all

$is_local	= (strpos($href, 'https://localhost/xampp/') === 0) ? true : $is_local;
Not sure if it's 'correct' - but it does work. :)
User avatar
primehalo
Former Team Member
Posts: 2897
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by primehalo »

Whoops, I just noticed that I swapped the parameters for strpos(). It should be this:

Code: Select all

            // Treat http and https as the same scheme
            $board_url    = (strpos($board_url, 'https://') === 0) ? ('http' . substr($board_url, 5)) : $board_url;
            $url         = (strpos($url        , 'https://') === 0) ? ('http' . substr($url,         5)) : $url;
  
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
spacefish
Registered User
Posts: 173
Joined: Mon Oct 09, 2006 8:48 am

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by spacefish »

It's working great - thank you again! :D
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by stokerpiller »

Hello

I am working on a mod that shows images included with the IMG BBcode in a popup.
Because these images is external links, I cant make it work with Prime links.
Instead og opening a popup, it opens in a new window.

Is there any way to avoid this?
I am done with phpBB
User avatar
primehalo
Former Team Member
Posts: 2897
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by primehalo »

stokerpiller wrote:Hello

I am working on a mod that shows images included with the IMG BBcode in a popup.
Because these images is external links, I cant make it work with Prime links.
Instead og opening a popup, it opens in a new window.

Is there any way to avoid this?
There should be. What are you doing to open the image in a popup?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: [RC1] Prime Links - Classify Locals & Target Externals

Post by stokerpiller »

primehalo wrote:
stokerpiller wrote:Hello

I am working on a mod that shows images included with the IMG BBcode in a popup.
Because these images is external links, I cant make it work with Prime links.
Instead og opening a popup, it opens in a new window.

Is there any way to avoid this?
There should be. What are you doing to open the image in a popup?
I am using the Highslide JS and a single edit in includes/bbcode.php:

Code: Select all

	'img'		=> '<a class="highslide" href="$1" onclick="return hs.expand(this)"><img src="$1" style="max-height:210px;" alt="' . $user->lang['IMAGE'] . '" /></a>',
I am done with phpBB
Locked

Return to “[3.0.x] MODs in Development”