PDA

View Full Version : Email address completion hack


10-30-2000, 12:50 PM
I don't know if this has already been posted in some form or another, but if you want xxx@xxxxxx to be automatically turned into a clickable mailto: address, simply find this in global.php:

// do xxx[ /email]
$bbcode=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$bbcode);


and replace with this:


// do [email ]xxx[ /email]
$bbcode=eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "[email]\\1", $bbcode);
$bbcode=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$bbcode);