Ответов: 273 Просмотров: 0
|
CODE: $string = preg_replace_callback("#\[url\](".$patern.")\[\/url\]#isx",
create_function(
'$matches',
'global $fm; $LinkText = preg_replace("#^(.{32})(.+)(.{16})#is","$1...$3",trim($matches[2]));
$Link = (empty($matches[2])) ? "http://".$matches[1]:$matches[1];
if (!stristr($Link, \'http://www.\'.$fm->exbb_domain) && !stristr($Link, \'http://\'.$fm->exbb_domain))
$Link = $fm->out_redir.$Link;
return "<a href=\"{$Link}\" target=\"_blank\">".trim($LinkText)."</a> ";'
),$string);
$string = preg_replace_callback("#\[url=\s*(".$patern.")\s*\](.*?)\[\/url\]#isx",array($this, 'url_text'),$string);
$string = preg_replace_callback("#(^|\s+)(".$patern.")(\s|$)#xis",
create_function(
'$matches',
'global $fm; $LinkText = preg_replace("#^(.{32})(.+)(.{16})#is","$1...$3",trim($matches[1]));
$Link = (empty($matches[3])) ? "http://".$matches[2]:$matches[2];
if (!stristr($Link, \'http://www.\'.$fm->exbb_domain) && !stristr($Link, \'http://\'.$fm->exbb_domain))
$Link = $fm->out_redir.$Link;
return $matches[1]."<a href=\"$Link\" target=\"_blank\">$LinkText</a>".$matches[4];'
),$string); |