Page 1 of 9

[BETA] External Link MOD

Posted: Fri Jan 13, 2006 6:37 pm
by kkroo
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

Posted: Fri Jan 13, 2006 10:38 pm
by .SlimDog.
Cool mod, I probably will test it:) Good luck in future dev.

Posted: Sun Jan 15, 2006 8:56 am
by kkroo
Updated to allow admin panel. You can now add sites to allow so they don't show up in a frame.

Posted: Mon Jan 16, 2006 9:05 am
by kkroo
come on guys, give me some feedback :)

Posted: Mon Jan 16, 2006 1:25 pm
by smithy_dll
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

Posted: Mon Jan 16, 2006 3:20 pm
by kkroo
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: .

Posted: Mon Jan 16, 2006 3:20 pm
by kulinar
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');

Posted: Mon Jan 16, 2006 3:23 pm
by kkroo
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.

Posted: Mon Jan 16, 2006 5:29 pm
by kulinar
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 ;).

Posted: Mon Jan 16, 2006 7:06 pm
by kkroo
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!

Posted: Mon Jan 16, 2006 7:27 pm
by kulinar
It would be a nice feature after clicking "Back to..." link to return not to index page but to referral page.

Posted: Tue Jan 17, 2006 2:47 pm
by kkroo
ya, that sounds like a good idea, i will get that posted up as soon as i can.

Posted: Wed Jan 18, 2006 3:20 pm
by kkroo
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 :)

Posted: Wed Jan 18, 2006 7:47 pm
by kulinar
kkroo wrote: well i hope you like it so far :)
Yes, thanks. That is what I wanted.

Posted: Wed Jan 18, 2006 9:43 pm
by ShadowTek
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?