Paul Ferrie
04-12-2003, 10:35 PM
Hi guys again
Well i have started putting the final touches to my version of the friends of ed Flash forum http://www.innovativedesigns.org.uk/flashforum/index.php
Anyway i am trying to sort out all the small bugs one of which is the url and email parsing.For some reason when i add a url to a post it is not linkable check out the forum and you will see what i mean. i have both "post new" and "view post" txt fields set to allow urls. anyone have any ideas
EMAIL PARSER
$message = ereg_replace("[[:alpha:]]+@[^<>[:space:]]+[[:alnum:]]","<a href=\"mailto:\\0\">\\0</a>", $message);
//
// URL PARSER
//$message = ereg_replace ("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]]", "<font color=\"#cccccc\"><a href=\"\\0\"target=\"_blank\">\\0</a></font>", $message);
$message = ereg_replace("\[url\]([^\[]+)\[/url\]", "<a href=\"\\1\"target=\"_blank\">\\1</a>", $message);
$message = ereg_replace("\[URL\]([^\[]+)\[/URL\]", "<a href=\"\\1\"target=\"_blank\">\\1</a>", $message);
cheers
Well i have started putting the final touches to my version of the friends of ed Flash forum http://www.innovativedesigns.org.uk/flashforum/index.php
Anyway i am trying to sort out all the small bugs one of which is the url and email parsing.For some reason when i add a url to a post it is not linkable check out the forum and you will see what i mean. i have both "post new" and "view post" txt fields set to allow urls. anyone have any ideas
EMAIL PARSER
$message = ereg_replace("[[:alpha:]]+@[^<>[:space:]]+[[:alnum:]]","<a href=\"mailto:\\0\">\\0</a>", $message);
//
// URL PARSER
//$message = ereg_replace ("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]]", "<font color=\"#cccccc\"><a href=\"\\0\"target=\"_blank\">\\0</a></font>", $message);
$message = ereg_replace("\[url\]([^\[]+)\[/url\]", "<a href=\"\\1\"target=\"_blank\">\\1</a>", $message);
$message = ereg_replace("\[URL\]([^\[]+)\[/URL\]", "<a href=\"\\1\"target=\"_blank\">\\1</a>", $message);
cheers