[BETA] Redirect Page

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
SOULMATES
Registered User
Posts: 2
Joined: Sun Mar 02, 2008 4:42 pm

[BETA] Redirect Page

Post by SOULMATES » Mon Jun 30, 2008 3:43 pm

simple redirect page for your phpbb by Bionic
mod replaces all forum urls with redirectpage.

1. upload redirect.php to your phpbb folder
// edit redirect.php html for style / for redirect time

2. open includes/bbcode.php
find // We do URLs in several different ways..

edit like this

$bbcode_tpl['url1'] = str_replace('{URL}', 'http://yoursite.com/phpbb_folder/redirect.php?url=\\1', $bbcode_tpl['url']);
$bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']);

$bbcode_tpl['url2'] = str_replace('{URL}', 'http://yoursite.com/phpbb_folder/redirect.php?url=\\1', $bbcode_tpl['url']);
$bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

$bbcode_tpl['url3'] = str_replace('{URL}', 'http://yoursite.com/phpbb_folder/redirect.php?url=\\1', $bbcode_tpl['url']);
$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);

$bbcode_tpl['url4'] = str_replace('{URL}', 'http://yoursite.com/phpbb_folder/redirect.php?url=\\1', $bbcode_tpl['url']);
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);

3. find // matches an "xxxx://yyyy" URL at the start of a line, or after a space.

edit like this

// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"http://yoursite.com/phpbb_folder/redirect.php?url=\\2\" target=\"_blank\">\\2</a>", $ret);

// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://yoursite.com/phpbb_folder/redirect.php?url=\\2\" target=\"_blank\">\\2</a>", $ret);

4. thats all save/close

download: http://www.soulmates.lv/RedirectPage.rar

chainprayer
Registered User
Posts: 162
Joined: Sat Sep 08, 2007 5:25 pm
Contact:

Re: [BETA] Redirect Page

Post by chainprayer » Sun Jul 13, 2008 5:46 am

can you better explain what this mod does?

Post Reply

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