$text = preg_replace('#\[url=([\r\n]*)([^\s\'\"]*?)\](.*?)([\r\n]*)\[/url\]#sie', "'<a href=\'".$pathto."'.base64_encode('http://\\2').'\' rel=\'nofollow\' target=\'_blank\' title=\'\\2\'>\\3</a>'", $text);
$text = preg_replace_callback('#\[url=([\r\n]*)([^\s\'\"]*?)\](.*?)([\r\n]*)\[/url\]#si', function ($m) use($pathto) {$link = $m[2]; return "<a href='$pathto".base64_encode('http://\\2').'\' rel='nofollow' target='_blank' title='$link'>"\\3</a>';}, $text);
'http://\\2').'\'
\\3</a>
$text = preg_replace('#\[url=([\r\n]*)([^\s\'\"]*?)\](.*?)([\r\n]*)\[/url\]#si', '<a href=\'http://\2\' target=\'_blank\' title=\'\2\'>\3</a>', $text);
$text = preg_replace_callback(
'#\[url\]([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\"]*?)([\r\n]*)\[/url\]#si',
function ($m) use($pathto) {
$link = $m[2].$m[3];
return "<a href='$pathto"
.base64_encode($link)
."' rel='nofollow' target='_blank' title='$link'>"
.trimlink($link, 20)
.(strlen($link)>30?substr($link, strlen($link)-10, strlen($link)):'')
.'</a>';
},
$text
);
$text = preg_replace('#\[url\]([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\"]*?)([\r\n]*)\[/url\]#sie', "'<a href=\'".$pathto."'.base64_encode('\\2\\3').'\' rel=\'nofollow\' target=\'_blank\' title=\'\\2\\3\'>'.trimlink('\\2\\3', 20).(strlen('\\2\\3')>30?substr('\\2\\3', strlen('\\2\\3')-10, strlen('\\2\\3')):'').'</a>'", $text);
$guest_msg = '[ link is hidden ] ( <a href=\''.BASEDIR.'register.php\'><u>registration</u></a> | <a href=\''.BASEDIR.'login.php\'><u>input</u></a> )';
$pathto = ($friendlyurl?BASEDIR.$friendlypath.'?':INCLUDES.'bbcodes/url_bbcode_include.php?');
Quote
Warning: Use of undefined constant INCLUDES - assumed 'INCLUDES' (this will throw an Error in a future version of PHP)
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions