[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
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

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

Post by IPB_Refugee »

Unfortunately that didn't do the trick - the local BBCode links still open in a new window.

Regards
Wolfgang
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

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

Post by primehalo »

Yeah, all changes will be in prime_links.php.

Okay, try this. Replace any occurrence of "html_entity_decode" with "decode_entities". Then...

Find:

Code: Select all

    function prime_links($message)   
Before, add:

Code: Select all

    function decode_entities($text) 
    {
        $text = html_entity_decode($text, ENT_QUOTES, "ISO-8859-1");         //UTF-8 does not work!
        $text = preg_replace('/&#(\d+);/me', "chr(\\1)", $text);             //decimal notation
        $text = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $text);    //hex notation
        return($text);
    }
     
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

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

Post by IPB_Refugee »

Very good! :D

I kept the following changing, too (should I undo it?)
primehalo wrote:Try changing:

Code: Select all

$board_url = generate_board_url(true);     
To:

Code: Select all

$board_url = html_entity_decode(generate_board_url(true));     
And now it is working fine - except my custom BBCode [user] (please look above) which still opens in a new window although the links are internal. But that's a minor problem.

Thank you, prime! :)

Regards
Wolfgang
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

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

Post by primehalo »

Okay, I just fixed that problem too. Download 0.0.3 and copy over the prime_links.php file.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

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

Post by IPB_Refugee »

Image

Great work, prime! Everything seems to work perfectly now. I'm going to do some more testing and when I find a problem, I will tell.

It must be very late in California. So good night! :)
Wolfgang
User avatar
mattgid
Registered User
Posts: 339
Joined: Wed Sep 05, 2007 6:57 am
Location: Singapore

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

Post by mattgid »

oh awesome!!! shouldn't it be ready for release ? :lol:
✖✖_Matthew Gideon_✖✖
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

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

Post by IPB_Refugee »

As it has been requested before, here are two add-ons for prime's great MOD.

1. all external links should run over anonym.to:

Open prime_links.php and find

Code: Select all

				$new_link	= $click ? str_replace("onclick=\"$click\"", "onclick=\"$new_click\"", $new_link) : str_replace('>', " onclick=\"$new_click\">", $new_link);
AFTER, ADD:

Code: Select all

				$new_link	= str_replace("http://", "http://anonym.to?http://", $new_link);
				$new_link	= str_replace("http://", "http://anonym.to?http://", $new_link);
2. all external links should have rel="nofollow":

Open prime_links.php and replace

Code: Select all

				$new_link	= $click ? str_replace("onclick=\"$click\"", "onclick=\"$new_click\"", $new_link) : str_replace('>', " onclick=\"$new_click\">", $new_link);
with

Code: Select all

				$new_link	= $click ? str_replace("onclick=\"$click\"", "onclick=\"$new_click\" rel=\"nofollow\"", $new_link) : str_replace('>', " onclick=\"$new_click\" rel=\"nofollow\">", $new_link);
Due to prime's MOD external links already have an "onclick" in the link and it is (nearly) common sense between search engines optimizers that this kind of links doesn't pass PageRank, link popularity and so on. So please don't crucify me for the second add-on. You can discuss about rel="nofollow" e.g. in this topic or in one of the boards dedicated to SEO.

Thanks again, prime! Your code looks really sophisticated. :)
Wolfgang
User avatar
mattgid
Registered User
Posts: 339
Joined: Wed Sep 05, 2007 6:57 am
Location: Singapore

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

Post by mattgid »

what is the purpose of your post? (above this)
what does it do/fix?
✖✖_Matthew Gideon_✖✖
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

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

Post by IPB_Refugee »

@mattgid:

1. makes external links look like http://anonym.to/?http://www.example.com without having you to add http://anonym.to/

2. makes external links look like
<a class="postlink" href="http://www.example.com" onclick="this.target='_blank';" rel="nofollow">external link</a>
For 2. please search for rel="nofollow" on Google, Yahoo, MSN,... or look at the topic I linked above.

Regards
Wolfgang
Sascha Mueller
Registered User
Posts: 95
Joined: Tue Mar 28, 2006 8:11 pm
Contact:

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

Post by Sascha Mueller »

Hi,

is this XHTML 1.0 Strict valid?

Thx a lot and nice greetings

Sascha
Please excuse my bad English, I'm German!
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

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

Post by primehalo »

Sascha Mueller wrote:Hi,

is this XHTML 1.0 Strict valid?

Thx a lot and nice greetings

Sascha
Yes.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Sascha Mueller
Registered User
Posts: 95
Joined: Tue Mar 28, 2006 8:11 pm
Contact:

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

Post by Sascha Mueller »

Cool man! :)
Please excuse my bad English, I'm German!
User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

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

Post by c4gamerz »

works great thanks a lot 8-)
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com
User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

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

Post by c4gamerz »

hey primehalo you should check this topic

http://www.phpbb.com/community/viewtopi ... 0&t=581604

It will easy to update your mods :D

Thanks a lot
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com
User avatar
mattgid
Registered User
Posts: 339
Joined: Wed Sep 05, 2007 6:57 am
Location: Singapore

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

Post by mattgid »

I think one more function needs to be included.
on the view profile page where the user's website is displayed, as well as on the memberlist, the link to their website has to open in a new window too!! ;)
✖✖_Matthew Gideon_✖✖
Locked

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