The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Can anyone whip up a quick hack which parses the contents of a message for an email address (probably looking for the @ sign) and automatically adds the email tags to it, similarly to automatically parsing for URL's.
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
I believe that
Code:
$messagetext = eregi_replace("([_a-z0-9-]+(\.[_a-z0-9-]+)*)@([a-z0-9-]+(\.[a-z0-9-]+)*)","<A HREF=\"mailto:\\1@\\3\">\\1@\\3</A>",$messagetext);
|
|
#3
|
|||
|
|||
|
That seems to have worked great. It only works if HTML is on in a forum, otherwise it prints the tags.
Thanks! |
|
#4
|
|||
|
|||
|
You can better do it this way to keep up the consistency with Vb, in this case it doesn't matter if html is turned on or off:
Code:
$messagetext = eregi_replace("([_a-z0-9-]+(\.[_a-z0-9-]+)*)@([a-z0-9-]+(\.[a-z0-9-]+)*)","[_email]\\1@\\3[/_email]",$messagetext);
NB: Replace _email with email (twice) [Edited by Mas*Mind on 09-07-2000 at 01:09 PM] |
![]() |
|
|