[BETA] External Link MOD

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

hmm, that is strange, do you have the latest version 1.1.1?

it shouldn't be doing that

well anyway here is the SQL assuming your table prefix is phpbb_

Code: Select all

CREATE TABLE `phpbb_external_link` (
  `by` text NOT NULL,
  `sites` text NOT NULL
) TYPE=MyISAM;

and here too:

Code: Select all

INSERT INTO `phpbb_external_link` VALUES ('Omar Ramadan', '');
hope that helps

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

I finished v 1.2

sorry, the code is a little messy, i had to define all these different variables and stuff and put if and elses in places that seem very retarded, that is the only way it works!

well anyway, It will first off detect is the referal is from a domain in your allow list, then it will check if it is a post or a topic, then it will go to that database and pull out the topic name, and it will echo this Back To Topic (TOPIC_NAME) linking to either the topic itself or the post, whichever the referal is from. If there is no referal or the referal is not in your allow list, the link will be Back to (SITE_NAME) linking to your forum index.

This one only works for phpBB2 sites that have php extensions. That is why i made another one that works for other extensions, but that one doesn't say the topic name, it will only say Back To Topic.

The downloads are available in the first post

Enjoy!

kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

It seems that there is a problem with google being framed.

http://forum.bgkulinar.net/link.php?url ... :co.uk&lr=

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »


kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

No it doesn't. It shows ONLY google start page but NOT result page (http://www.google.com/search?hl=bg&q=in ... :co.uk&lr=)

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

im working on it now and hopefully it will be fixed soon.

ShadowTek
Registered User
Posts: 66
Joined: Thu Jul 22, 2004 8:21 am
Contact:

Post by ShadowTek »

Hi thanks for the SQL :)

I have another question, is there a way to make it ignor internal links? For example, If I post a link to somewere else on the site, is there a way (hardcode mabey) for it to compleatly ignore the link?

As of now, though it redirects to a direct link if its internal, it breaks links with modes switches attached. It there a way for it to compleately ignore a internal link?

For example ignor any link that starts with www.shadowtek.net and this is my site and theres no need for the link.php= to be there?

Thanks for any help.

ShadowTek

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

ShadowTek wrote: it breaks links with modes switches attached. It there a way for it to compleately ignore a internal link?

Thanks for any help.

ShadowTek



Hey,

i don't understand what you mean "it breaks links with modes switches attached"

and yes there is a way to do that, it is in bbcode.php, i will let you know when i get it done. But please tell me what you mean because if it is a bug, it must get fixed. If it the same bug that you are talking about that kulinar is talking about, i almost got that resolved. i am fixing it using the urlencode() function.

kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

ShadowTek wrote: I have another question, is there a way to make it ignor internal links? For example, If I post a link to somewere else on the site, is there a way (hardcode mabey) for it to compleatly ignore the link?
Internal links that are framed are redirected to the framed page.

http://forum.bgkulinar.net/link.php?url ... um.35.html

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

i assume you are using the html version of the MOD, so do this (forgive me for it is not proper mod teplate):

FIND

$url=$HTTP_GET_VARS["url"];


ADD

$string = $HTTP_SERVER_VARS["REQUEST_URI"];
preg_match('|ht(.*)$|', $string, $url_matches);
$url_encode = urlencode($url_matches[0]);
$url_decode = urldecode($url_encode);


FIND

'REFERAL_LINK' => $HTTP_GET_VARS['referrer'],
'U_URL' => $url

REPLACE WITH

'REFERAL_LINK' => $HTTP_GET_VARS['referrer'],
'U_URL' => $_GET['url']


FIND

'S_FRAME_TOP' => "link.{$phpEx}?pane=1&url=$url&referrer={$backto_link}&{$match_topic_name[0]}",
'U_URL' => $url

REPLACE WITH

'S_FRAME_TOP' => "link.{$phpEx}?pane=1&url={$url_encode}&referrer={$backto_link}&{$match_topic_name[0]}",
'U_URL' => $url_decode


and if you are using php version do this:
FIND

$url=$HTTP_GET_VARS["url"];


ADD

$string = $HTTP_SERVER_VARS["REQUEST_URI"];
preg_match('|ht(.*)$|', $string, $url_matches);
$url_encode = urlencode($url_matches[0]);
$url_decode = urldecode($url_encode);


FIND

'REFERAL_LINK' => $HTTP_GET_VARS['referrer'],
'U_URL' => $url

REPLACE WITH

'REFERAL_LINK' => $referer_link,
'U_URL' => $_GET['url']


FIND

'S_FRAME_TOP' => "link.{$phpEx}?pane=1&url=$url&referrer={$backto_link}&{$match_topic_name[0]}",
'U_URL' => $url

REPLACE WITH

'S_FRAME_TOP' => "link.{$phpEx}?pane=1&url={$url_encode}&referrer={$backto_link}&{$match_topic_name[0]}",
'U_URL' => $url_decode

kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

kkroo wrote: i assume you are using the html version of the MOD
No, I don't. But it's OK. I just wanted to show ShadowTek that there is no problem with internal links.

kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

kulinar wrote: No it doesn't. It shows ONLY google start page but NOT result page (http://www.google.com/search?hl=bg&q=in ... :co.uk&lr=)
Now it works. Thanks, kkroo!

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

I am glad it works now kulinar, and thank you for pointing out that bug!

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

ShadowTek, did that work out for you when u said that it breaks links with modes switches attached?
My MODs

Need a coder?

Enjoy my Mods? - Image

User avatar
okada1314
Registered User
Posts: 209
Joined: Sat Oct 29, 2005 10:51 am

Post by okada1314 »


Post Reply

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