1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14: | function ReplaceLinks($text)
{
$urlsearch[] = "/([^]_a-z0-9-=\"'\/])((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
$urlsearch[] = "/^((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
$urlreplace[]= "\\1[URL]\\2\\4[/URL]";
$urlreplace[]= "[URL]\\1\\3[/URL]";
$text = preg_replace($urlsearch, $urlreplace, $text);
$text = preg_replace("/\[URL\](.*?)\[\/URL\]/si" , "<a href=\"\\1\" alt=\"\" target=\"blank\" style=\"text-decoration:none\">\\1</a>", $text);
$text = preg_replace("/\[URL=(.*?)\](.*?)\[\/URL\]/si", "<a href=\"\\1\" alt=\"\" target=\"blank\" style=\"text-decoration:none\">\\2</a>", $text);
$text=str_replace("href=\"www","href=\"http://www",$text);
return($text);
} |