############################################### ## Hack Title: Active Link Referrer Blocker ## Hack Version: 1.0.0 ## Author: wd2004 ## ## Description: This hack will block the referrer when a link ## is clicked by going through safeurl.de first. ## When ever a link is posted on the BB, it will ## automatically add the safeurl.de address to the ## link. The whole process is invisible since it is ## added to the main phpbb link processing functions. ## When you edit your post, the link will appear the ## same way as you posted it. ## ## Compatibility: Tested on 2.0.10 only ## ## Installation Level: Easy ## Installation Time: ~1 minute ## ## Files To Edit: 1 ## includes/bbcode.php ## ## Included Files: 0 ## ## Author Notes: After creating this hack, I have noticed that it was ## created already back in 2002. According to other users ## the previous version stopped working after phpBB 2.0.5. ## This version will work with 2.0.10 and maybe earlier. I ## would like to give credit to the original author of the ## first script "Safeurl Hack" by reimer. I would also like ## to give credit to safeurl.de for providing this great url ## protection service. ## ## Support: http://www.phpbbhacks.com/forums ## Copyright: ©2004 Active Link Referrer Blocker v1.0.0 - wd2004 ## ############################################### ## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads. ## Please visit http://www.phpbbhacks.com/forums for support. ############################################### ## ############################################### ## This hack is released under the GPL License. ## This hack can be freely used, but not distributed, without permission. ## Intellectual Property is retained by the hack author(s) listed above. ############################################### # #-----[ OPEN ]------------------------------------------ # includes/bbcode.php # #-----[ FIND ]------------------------------------------ # // We do URLs in several different ways.. $bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']); $bbcode_tpl['url2'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']); $bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']); $bbcode_tpl['url4'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']); # #-----[ REPLACE ]------------------------------------------ # // We do URLs in several different ways.. $bbcode_tpl['url1'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']); $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']); $bbcode_tpl['url2'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']); $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']); $bbcode_tpl['url3'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']); $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']); $bbcode_tpl['url4'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']); $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']); # #-----[ FIND ]------------------------------------------ # // matches an "xxxx://yyyy" URL at the start of a line, or after a space. // 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\\2", $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\\2", $ret); # #-----[ REPLACE ]------------------------------------------ # // matches an "xxxx://yyyy" URL at the start of a line, or after a space. // 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\\2", $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\\2", $ret); # #-----[ SAVE & CLOSE ALL FILES ]-------------------------- # #End