![]() |
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.
|
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); |
That seems to have worked great. It only works if HTML is on in a forum, otherwise it prints the tags.
Thanks! |
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] |
All times are GMT. The time now is 05:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|