[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!
Scam Warning
kamil-sat
Registered User
Posts: 15
Joined: Mon Dec 10, 2012 10:07 am
Location: Poland

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

Post by kamil-sat »

I want to hide external links for guests. So I did as jano_s wrote --> viewtopic.php?p=13090560#p13090560

and..
I have this situation with Prime Links:
viewtopic.php?f=46&t=2168394&p=13217862#p13217850

help
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

From that other thread you mentioned it looks like you got it figured out.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

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

Post by umarizal »

Dear friend primehalo, firstly thanks for having created a mod so important and useful.

I wonder if there how to use your mod to "hide" emails posted on the topics, at least for visitors. Is this possible? How?

Thank you ;)
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

Currently it does not have that ability. You would have to modify it to check for "mailto" and then replace the link with something else.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
c64persian
Registered User
Posts: 87
Joined: Tue Sep 18, 2012 11:58 pm
Location: instagram:c64persian

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

Post by c64persian »

delete post
Last edited by c64persian on Fri Jul 12, 2013 7:06 am, edited 1 time in total.
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

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

Post by umarizal »

primehalo wrote:Currently it does not have that ability. You would have to modify it to check for "mailto" and then replace the link with something else.
Primehalo, excuse me but I'm not a connoisseur of programming, how do I that?

Thank you!
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

Sorry, I don't know how to explain it in enough detail to help without going into the code and actually doing it.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
seomadness
Registered User
Posts: 15
Joined: Sun Jun 02, 2013 8:29 am

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

Post by seomadness »

Hi,

is there a way to apply the prime links in the topic review (the stuff that shows below the post editor)? Right now when users click on a link down there, it doesn't go to new window like it does with other links because it doesn't use the prime links.
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

It should already do that. The main Prime Links function is called within phpBB's smiley_text() function, and that is called in the topic review code:

Code: Select all

$message = smiley_text($message, !$row['enable_smilies']);  
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Flippi
Registered User
Posts: 4
Joined: Tue Oct 08, 2013 9:17 am

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

Post by Flippi »

First of all: thanks for this script.
I wonder if it is possible to consider certain internal links as external in order to open them in a new window.

For instance I want to open links to my blog (http://www.mydomain.com/blog/myblogpost) in a new window.
Another example is to execute a local script (http://www.mydomain.com/myscript.php) that points to an external link, this one should also open in a new window.

Thanks in advance,

Flippi
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

You would have to modify the is_link_local function and add your own checks, for example:

Code: Select all

if ($is_local && stripos($url, 'http://www.mydomain.com/blog/myblogpost') !== false) {
    $is_local = false;
} 
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Flippi
Registered User
Posts: 4
Joined: Tue Oct 08, 2013 9:17 am

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

Post by Flippi »

primehalo wrote:You would have to modify the is_link_local function and add your own checks, for example:

Code: Select all

if ($is_local && stripos($url, 'http://www.mydomain.com/blog/myblogpost') !== false) {
    $is_local = false;
}
Thank you very much.
The following works too for me:

After

Code: Select all

$is_local = (EXTERNAL_LINK_TYPES && preg_match('/\.(?:' . EXTERNAL_LINK_TYPES . ')(?:[#?]|$)/', $href)) ? false : $is_local;
I placed

Code: Select all

$is_local = (preg_match('/mydomain.com\/blog/', $href)) ? false : $is_local;
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil

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

Post by Volksdevil »

EDIT: Fixed.
My phpBB Extensions
Finally found great Website Hosting from :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
jkalizsky
Registered User
Posts: 10
Joined: Sat Oct 16, 2004 10:04 pm

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

Post by jkalizsky »

Dear primehalo

I can't understand how can I do to hide the local links and local images inside the posts to my guests.
After set the line below as following, only can to hide external links, but any local link remain without changes.

define('HIDE_LINKS_FROM_GUESTS', "<font color='red'>Your text</font>");

I need hide local images and download links to my guests ¿is that possible?

Can you help me, please?

Kind regards

Julio
User avatar
primehalo
Former Team Member
Posts: 2991
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

That only hides external links, not local links. I'm sorry, this MOD doesn't hide images.You could probably modify it to do so but I think a separate MOD would probably be better.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

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