############################################################## ## MOD Title: images.yeuxverts.net forum integration ## MOD Author: Lice < lice@yeuxverts.net > ## MOD Description: This mod anonymises all links posted on your forum through anon.yeuxverts.net. ## ## MOD Version: 1.0.0 ## ## Installation Level: Easy ## Files To Edit: includes/bbcode.php ## Included Files: none ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## Author Notes: images.yeuxverts.net is (c) 2006-2007 YeuxVerts.net ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/bbcode.php # #-----[ FIND ]------------------------------------------ # function make_clickable($text) { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); // pad it with a space so we can match things at the start of the 1st line. $ret = ' ' . $text; // 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]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#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)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1\\2", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1\\2@\\3", $ret); // Remove our padding.. $ret = substr($ret, 1); return($ret); } # #-----[ REPLACE WITH ]------------------------------------------ # function make_clickable($text) { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); // pad it with a space so we can match things at the start of the 1st line. $ret = ' ' . $text; // remove stuff that had been anymised by the user (user entered an anon.yeuxverts.net link) $ret = preg_replace("#href=\"http://anon.yeuxverts.net/\?([\w]+?://)#is", "href=\"\\1", $ret); // anonymise all existing links $ret = preg_replace("#href=\"([\w]+?://)#is", "href=\"http://anon.yeuxverts.net/?\\1", $ret); // 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]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#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)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1\\2", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1\\2@\\3", $ret); // fix local urls.. replace "MyLocalLink.Com" with your domain name, duplicate this line for all your local domains. // note that this line matches www.MyLocalLink.Com, something.MyLocalLink.Com, Anything.mylocallink.com, mylocallink.com..... $ret = preg_replace("#href=\"http://anon.yeuxverts.net/\?([\w]+?://(|\w+\.)MyLocalLink.Com)#is", "href=\"\\1", $ret); // Remove our padding.. $ret = substr($ret, 1); return($ret); } # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM