Page 18 of 32

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

Posted: Tue Mar 18, 2008 7:54 pm
by gajotnt
Dont know if this is what you want but these are de lines i had to add to the viewtopic.php file

Code: Select all

'GALLERY_IMG'		=> $user->img('icon_contact_gallery', 'PERSONAL_ALBUM'),

'personal_album'	=> '',

'personal_album'	=> ($row['album_id']) ? append_sid("{$phpbb_root_path}" . GALLERY_ROOT_PATH . "album.$phpEx", "album_id=" . $row['album_id']) : '',

'U_GALLERY'		=> $user_cache[$poster_id]['personal_album'],

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

Posted: Tue Mar 18, 2008 8:07 pm
by primehalo
gajotnt wrote:Dont know if this is what you want but these are de lines i had to add to the viewtopic.php file

Code: Select all

'GALLERY_IMG'		=> $user->img('icon_contact_gallery', 'PERSONAL_ALBUM'),

'personal_album'	=> '',

'personal_album'	=> ($row['album_id']) ? append_sid("{$phpbb_root_path}" . GALLERY_ROOT_PATH . "album.$phpEx", "album_id=" . $row['album_id']) : '',

'U_GALLERY'		=> $user_cache[$poster_id]['personal_album'],
Nope, that's not it either. I need a link to a post which contains a link to an album, but with my MOD disabled/removed. So I need to view this post, but with my MOD disabled/removed: http://www.pbterceira.com/viewtopic.php ... 117#p18771

The reason is because I need to see what the album link actually looks like in the source of the post when my MOD has not processed it.

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

Posted: Tue Mar 18, 2008 8:13 pm
by gajotnt
Ok removed your mod now no errors show on top of page but thumbnail does not show up, must be something wrong with the gallery mod

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

Posted: Tue Mar 18, 2008 8:27 pm
by primehalo
gajotnt wrote:Ok removed your mod now no errors show on top of page but thumbnail does not show up, must be something wrong with the gallery mod
With my MOD removed, this is what shows up for the link:

Code: Select all

<a href="http:////gallery/image_page.php?image_id=1"><img src="http:////gallery/thumbnail.php?image_id=1" alt="image_id: 1"></a>
Obviously, this is an incorrectly formatted URL, which is why my MOD was having trouble decoding it. So if you fix whatever is causing this problem then my MOD should work fine.

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

Posted: Tue Mar 18, 2008 11:28 pm
by gajotnt
Sorry for the trouble, will try to find out whats doing this

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

Posted: Mon Apr 14, 2008 4:44 pm
by Sascha Mueller
Is this mod ready for phpBB 3.0.1 ?

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

Posted: Mon Apr 14, 2008 5:18 pm
by primehalo
Sascha Mueller wrote:Is this mod ready for phpBB 3.0.1 ?
Yes.

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

Posted: Mon Apr 14, 2008 5:57 pm
by Sascha Mueller
primehalo wrote:
Sascha Mueller wrote:Is this mod ready for phpBB 3.0.1 ?
Yes.
Thx for your reply. :)

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

Posted: Tue Apr 15, 2008 4:06 am
by Oggster
Thanks you very much!

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

Posted: Wed May 07, 2008 2:09 am
by DBM
Since I installed Prime Links, Google has stopped indexing links from my forum to other pages of my site (same domain).

But I'm sure I have set up my prime_links.php correctly:

Code: Select all

	// Options
	define('REMOVE_SUBDOMAINS', true);			// Remove these subdomains before checking the link (true will remove all subdomains)
	define('ANONYMIZE_EXTERNAL_LINKS', '');		// Example: 'http://anonym.to?'
	define('USE_TARGET_ATTRIBUTE', false);		// The attribute "target" is not valid for STRICT doctypes

	// Link relationships
	define('INTERNAL_LINK_REL', '');
	define('EXTERNAL_LINK_REL', 'nofollow');

	// Link targets
	define('INTERNAL_LINK_TARGET', '_blank');
	define('EXTERNAL_LINK_TARGET', '_blank');

	// Link classes
	define('INTERNAL_LINK_CLASS', 'postlink-local');
	define('EXTERNAL_LINK_CLASS', '');
It just seems like somehow the links to other pages of my site are being treated as external links and therefore passing on the 'nofollow' attribute to Googlebot.

But I can't see what I'm doing wrong if that's the case. Any ideas, anyone? :?

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

Posted: Wed May 07, 2008 3:04 am
by primehalo
DBM wrote:Since I installed Prime Links, Google has stopped indexing links from my forum to other pages of my site (same domain).

But I'm sure I have set up my prime_links.php correctly:

Code: Select all

	// Options
	define('REMOVE_SUBDOMAINS', true);			// Remove these subdomains before checking the link (true will remove all subdomains)
	define('ANONYMIZE_EXTERNAL_LINKS', '');		// Example: 'http://anonym.to?'
	define('USE_TARGET_ATTRIBUTE', false);		// The attribute "target" is not valid for STRICT doctypes

	// Link relationships
	define('INTERNAL_LINK_REL', '');
	define('EXTERNAL_LINK_REL', 'nofollow');

	// Link targets
	define('INTERNAL_LINK_TARGET', '_blank');
	define('EXTERNAL_LINK_TARGET', '_blank');

	// Link classes
	define('INTERNAL_LINK_CLASS', 'postlink-local');
	define('EXTERNAL_LINK_CLASS', '');
It just seems like somehow the links to other pages of my site are being treated as external links and therefore passing on the 'nofollow' attribute to Googlebot.

But I can't see what I'm doing wrong if that's the case. Any ideas, anyone? :?
Usually not a good idea to have REMOVE_SUBDOMAINS set to true when there is more than one dot after the domain (such as .co.uk).

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

Posted: Sun Jun 01, 2008 10:53 pm
by Funk Theory
excellent, followed the phpbb kb article got no errors, cleared my cache but still wouldnt open in new window, installed this mod, works straight away, top job! :D

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

Posted: Mon Jun 02, 2008 8:38 pm
by Funk Theory
Actually, one 'problem' If i click a link on a users profile it still opens in the same window however if i click the banner sig on their profile it doesnt :?

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

Posted: Mon Jun 02, 2008 11:40 pm
by primehalo
Funk Theory wrote:Actually, one 'problem' If i click a link on a users profile it still opens in the same window however if i click the banner sig on their profile it doesnt :?
The MOD only affects links within posts (or more technically, links that are within text that is written by PHP). Links on a user's profile (except those in signatures) cannot be parsed, because the HTML for those links are hard-coded into the template. If you want those to open in a new window, you'll have to open the template file and add the following to the link HTML:

Code: Select all

onclick="this.target='$new_target';"
In the future, I may add some code and template variables to the MOD in order to accomplish this.

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

Posted: Wed Jun 04, 2008 3:17 pm
by buchoman
Fantastic mod! I wanted to tweak this a little bit in order to treat certain select domains as internal links. The fix was discussed much earlier in this thread at: http://www.phpbb.com/community/viewtopi ... a&start=36

The example given shows how to treat one external domains ("example.com") in the same manner as an internal link. However, I would like to treat about 30 external domains ("example1.com", "example2.com", etc) as internal.

Based on the example provided in IPB_Refugee's earlier post, I have opened prime_links.php, and searched for the following code:

Code: Select all

	$is_local = !$scheme || ($scheme && !preg_match('/^[a-z0-9.]{2,16}$/i', $scheme));
			}

AFTER, I added:

Code: Select all

           
//EXCEPTIONS (TREAT THE FOLLOWING AS INTERNAL LINKS)

	if (strpos($url, "example1.com") > 0)
     {
        $is_local = TRUE;
     }

	if (strpos($url, "example2.com") > 0)
     {
        $is_local = TRUE;
     }

	if (strpos($url, "example3.com") > 0)
     {
        $is_local = TRUE;
     }

... and so on.

The above works, but my illustration reflects only three domains. Is there a more elegant solution to accomplish the same result for a larger number of domains? (I suspect there is, but my PHP skills are sadly deficient!)