[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
User avatar
SlaySpawn
Registered User
Posts: 2
Joined: Sun Jan 16, 2011 4:54 am

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

Post by SlaySpawn »

Hello primehalo!

Thank you very much for this great mod. It works very well for me and my board, but I have a question for a specific function. Is there a possibility (maybe with additional code) to make external links visible, after the input of a captcha-code?

Thank you in advance!
SlaySpawn
User avatar
primehalo
Former Team Member
Posts: 2997
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

I'm sure it's possible to do, but it's not something I really want to work on in my free time.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
SlaySpawn
Registered User
Posts: 2
Joined: Sun Jan 16, 2011 4:54 am

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

Post by SlaySpawn »

That's a real shame, but I can understand your decision and thanks for your quick reply.

Best regards,
SlaySpawn
V-Mann
Registered User
Posts: 1
Joined: Sun Jan 09, 2011 2:13 pm

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

Post by V-Mann »

hello there,
i have one very specific problem with your mod.
the domain i am hosting on the board is an umlaut domain, so it contains an ö or Ö, your mod doesn detect that the umlaut-links are local, even if i "whitelist" them.

i know phpbb3 doesnt support umlauts at alll so my special case also includes some special bbcode - so i can use umlaut domains
it usage looks like this: [link={TEXT}]{TEXT1}[/link]

the replacement is this:
<a href="{TEXT}" title="Klicke hier, um zum Beitrag, Thread oder Webseite {TEXT} zu gelangen!" target="_blank"><span style="color:#105289; text-decoration:underline">{TEXT1}</span></a>

if you can help it would be nice if not - well then i have to live with it i guess ;-)

EDIT:

Now it workes the problem was that it didnt recognize the subdomain correctly - wehn i put it seperately in the list its ok. site looks like this http://board.nörgler.de (not the real page just an example)
Drakken
Registered User
Posts: 144
Joined: Thu Jun 12, 2003 6:59 pm

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

Post by Drakken »

Thanks Prime, works great! :D
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica

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

Post by Jessica »

a must have. works perfectly on my forum (:
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
jano_s
Registered User
Posts: 16
Joined: Mon Dec 12, 2011 7:01 am

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

Post by jano_s »

primehalo wrote:2) Hide urls from guest and display message with other urls

Code: Select all

    define('HIDE_LINKS_FROM_GUESTS', 'Link Hidden');    // Hide external links from guests? If this is a string, then the text of the link will be replaced with this string.          
My question was:
How to leave link's name and add additionally " - Please register or login to download file " (ex red color)?
[ url=www.example.com]LinksName[/url]
For guest:
LinksName - Please register or login to download file

My solution:
Find in prime_links.php:

Code: Select all

$new_link = '<span class="link_removed">' . $new_text . '</span>';
Change to:

Code: Select all

$new_link = '<span class="link_removed">' . $new_text . '</span><span style="color: #D31141; text-decoration: underline;"> - Please <a href="http://www.example.com/forum/ucp.php?mode=register">register</a> or <a href="http://www.example.com/forum/ucp.php?mode=login">login</a> to download file</span>';
Mechatronics forum - discussions about mechatronics, related topics, studies, courses, books, your constructions What is mechatronics
izibizi
Registered User
Posts: 32
Joined: Thu Jan 01, 2004 9:22 pm

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

Post by izibizi »

how can i make this process work on old posts without the need to update each post individualy?
User avatar
primehalo
Former Team Member
Posts: 2997
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

Links are processed after the post is retrieved from the database and before the post is written out to the page, therefor it should work with all posts.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier

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

Post by javiexin »

primehalo wrote:Links are processed after the post is retrieved from the database and before the post is written out to the page, therefor it should work with all posts.
Hello,

Quick question, would it be possible to do it the reverse way, that is, process it before storing in the database?, and store differently the local and external links?

Why? Because what I would like to do is to store "local" links (internal to the forum) as "relative path", therefore isolating from potential changes of domain in the forum, and also, to be able to have "fully functional" local copy (backup/replica/test...) of an online forum.

Thanks in advance,
-javiexin
User avatar
primehalo
Former Team Member
Posts: 2997
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

That's not possible with how it's currently set up. I'm sure it could be modified to do so, but that's not something I really want to spend my free time on.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier

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

Post by javiexin »

Fair enough, thanks a lot. If I do it myself, I will let you know just in case you would like to add it as an option.

-javiexin
moonchilddave
Registered User
Posts: 16
Joined: Fri Jun 02, 2006 3:37 am
Location: Leonardtown, MD
Name: Dave Downin

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

Post by moonchilddave »

Is there a way this could be modified to handle forums who have a type of "Link" (as opposed to Category or Forum)?
User avatar
primehalo
Former Team Member
Posts: 2997
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

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

Post by primehalo »

There is an add-on in the contrib directory for this.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Fisch.666
Registered User
Posts: 233
Joined: Sat Jul 30, 2005 10:58 am

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

Post by Fisch.666 »

Hi,

FYI. I've just edited the prime_links.php to be able to add the EXTERNAL_LINK_PREFIX for User Website Links:

open prime_links.php

search for:

Code: Select all

				$external_rel = !EXTERNAL_LINK_REL ? '' : ' rel="' . EXTERNAL_LINK_REL . '"';
add after:

Code: Select all

				$external_prefix = !EXTERNAL_LINK_PREFIX ? '' : '' . EXTERNAL_LINK_PREFIX . '';
search for:

Code: Select all

					'EXTERNAL_LINK_ATTRIBUTES' => $external_target . $external_rel,
add after:

Code: Select all

					'EXTERNAL_LINK_PREFIX'	=> $external_prefix,
search for:

Code: Select all

						$external_target = '';
						$external_rel = '';
add after:

Code: Select all

						$external_prefix = '';
search for:

Code: Select all

						'EXTERNAL_LINK_ATTRIBUTES' => $external_target . $external_rel,
add after:

Code: Select all

						'EXTERNAL_LINK_PREFIX' => $external_prefix,
Now you are able to use the

Code: Select all

{EXTERNAL_LINK_PREFIX}
in your templates. Just use the installation guide install user website links.xml from the contrib folder but instead of adding

Code: Select all

{EXTERNAL_LINK_ATTRIBUTES}
to

Code: Select all

href="{memberrow.U_WWW}"
or

Code: Select all

href="{U_WWW}"
add the

Code: Select all

{EXTERNAL_LINK_PREFIX}
before

Code: Select all

{memberrow.U_WWW}"
and

Code: Select all

{U_WWW}"

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