[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.
Post Reply
kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

[BETA] External Link MOD

Post by kkroo » Fri Jan 13, 2006 6:37 pm

MOD Title: External Links
MOD Description: When an external link in a post is opened, it will viewed in a framed page that allows easy return to your site. If the link is to your site or in the allow list, it will detect it and redirect to that page.
Works with EasyMod

To Use this MOD you MUST you must retain my credit link in the file pane_top.tpl!
Keeping the google Ad to my account would be highly appreciated.

MOD Version: 1.4.0

MOD Download: http://phpbb-login.sourceforge.net/foru ... file_id=11

Translated Languages available:

Spanish (translated by Nazcar)
German (translated by torte88)


Enjoy :D
Last edited by kkroo on Thu Jan 25, 2007 5:30 pm, edited 30 times in total.

.SlimDog.
Registered User
Posts: 29
Joined: Tue Jan 10, 2006 11:22 pm

Post by .SlimDog. » Fri Jan 13, 2006 10:38 pm

Cool mod, I probably will test it:) Good luck in future dev.

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

Post by kkroo » Sun Jan 15, 2006 8:56 am

Updated to allow admin panel. You can now add sites to allow so they don't show up in a frame.

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

Post by kkroo » Mon Jan 16, 2006 9:05 am

come on guys, give me some feedback :)

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll » Mon Jan 16, 2006 1:25 pm

Hello,

Please edit your topic title with a prefix as outlined in MOD Development forum rules, section 3.a, 3.b. The prefix you are currently using is not allowed. If your MOD is still in development you can use the prefixes in section 3.a. If your MOD is stable could you please submit your MOD to the phpBB.com MODDB (MOD release database), for validation pending release.

Your cooperation is very much appreciated by the phpBB MOD Team.

Thank you,
The phpBB MOD Team

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

Post by kkroo » Mon Jan 16, 2006 3:20 pm

Hello,
for the people who downloaded it and got an error in the install.php file, sorry, i uploaded the wrong ZIP file, it is resolved now in the new uploaded file :oops: .

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

Post by kulinar » Mon Jan 16, 2006 3:20 pm

kkroo wrote: come on guys, give me some feedback :)
OK. When I run install.php I get this error message

Code: Select all

Parse error: parse error, unexpected T_STRING in /blabla/blablabla/forum.bgkulinar.net/public_html/install.php on line 10
and in link.php

Code: Select all

$template->pparse('pane_top');
should be

Code: Select all

$template->pparse('pane_top.tpl');

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

Post by kkroo » Mon Jan 16, 2006 3:23 pm

kulinar wrote:
kkroo wrote:come on guys, give me some feedback :)
OK. When I run install.php I get this error message

Code: Select all

Parse error: parse error, unexpected T_STRING in /blabla/blablabla/forum.bgkulinar.net/public_html/install.php on line 10
and in link.php

Code: Select all

$template->pparse('pane_top');
should be

Code: Select all

$template->pparse('pane_top.tpl');


i got the installation file resolved as you see in the top post, and for the pane_top, that is correct, i defined the top pane here:

Code: Select all

	$template->set_filenames(array(
		'pane_top' => 'pane_top.tpl')

so i only have to call to pane_top and not pane_top.tpl

tell me how it goes with you

If anyone finds a bug with the MOD or has comments or questions, please tell me.

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

Post by kulinar » Mon Jan 16, 2006 5:29 pm

kkroo wrote: ...and for the pane_top, that is correct, i defined the top pane here:

Code: Select all

	$template->set_filenames(array(
		'pane_top' => 'pane_top.tpl')
Yeah, that is my mistake.

But your mod doesn't work for urls that are not nested in [url] tags. To do this open includes/bbcode.php find

Code: Select all

$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
replace with

Code: Select all

$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"link.php?url=\\2\" target=\"_blank\">\\2</a>", $ret);
find

Code: Select all

$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
replace with

Code: Select all

$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"link.php?url=http://\\2\" target=\"_blank\">\\2</a>", $ret);
Another strange thing is the encoding of link_frameset.tpl and top_pane.tpl which is set to windows-1252 :roll:.

Third thing: the rules of the phpbb forum require DIRECT download link ;).

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

Post by kkroo » Mon Jan 16, 2006 7:06 pm

oh my gosh!
i had that done but i forgot to put that in the install.txt file!
thanks for pointing that out for me :)

about the windows-1252, i made it in Notepad, but i checked and finalized it in Frontpage, and when i saved, it set it to that :roll:


Thanks a lot!

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

Post by kulinar » Mon Jan 16, 2006 7:27 pm

It would be a nice feature after clicking "Back to..." link to return not to index page but to referral page.

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

Post by kkroo » Tue Jan 17, 2006 2:47 pm

ya, that sounds like a good idea, i will get that posted up as soon as i can.

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

Post by kkroo » Wed Jan 18, 2006 3:20 pm

i got it done,

view here for pane_top.tpl: http://pastebin.com/511502


view here for link.php: http://pastebin.com/511504

what i got it to do is if the referal link is from your allow list, allow the referal link, if there is no referal or it is not in your allow list, the link will be to index.php


the reason i don't want to put it in the MOD quite yet is because the link still says Back to Site Name

i want to know how to be able to get it to say Back to Topic Name.

well i hope you like it so far :)

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

Post by kulinar » Wed Jan 18, 2006 7:47 pm

kkroo wrote: well i hope you like it so far :)
Yes, thanks. That is what I wanted.

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

Post by ShadowTek » Wed Jan 18, 2006 9:43 pm

Hi got this running the install:

Code: Select all

Could not query:You have an error in your SQL syntax near '; ' at line 4
Can you post the straight SQL?

Post Reply

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