I know EE has the built in “encode” for masking email addresses but I’m one of those people who really like things to work whether or not the user has Javascript enabled. My goal was to make port an email obfuscator that worked even with Javascript disabled.
I just started using EE for most sites. Before, I used to have a config.php file that had all my handy functions in it - one of which was obfuscateEmail(); which ran a bit of PHP (see http://www.zapyon.de/ for the basis of what is happening in this plugin) to encode the email address in decimal or hexadecimal mode. May not be the most robust email masking, but it has worked for me on numerous sites, and I’ve never had a client say they were getting too much spam. I wanted this to work in my EE sites, so I wrote my first plugin! (cue sound of 1 hand clapping…)
Description
The tag has three six parameters:
Example usage (full):
{exp:md_spam_me_not email="ee@masugadesign.com" mode="1" title="My Title"
class="nocion email" subject="EE Inquiry" text="Email Ryan for more info."}
Example usage (basic):
{exp:md_spam_me_not email="ee@masugadesign.com"}
Hope it works for you.
More info for this plugin (and a link to download) is now located over at its designated page at masgadesign.com: http://www.masugadesign.com/the-lab/scripts/spam-me-not/
It should work, if you wrap the field you’re outputting with allow_eecode (another plugin). For example, if you have a huge body area that might have a few emails in there, instead of just putting
{body}
on your template, wrap that with:
{exp:allow_eecode}{body}{/exp:allow_eecode}
Then, anytime you’re using spammenot in that body field, it should get parsed correctly.
How would you envision using the message body? Like this:
{exp:spammenot email="you@email.com" mode="1"
title="My Title" class="nocion email" subject="EE Inquiry"
text="Email Ryan for more info."}If you have text that should go in the message body,
it should go in here (between opening/closing tag), and we might have less trouble
with weird characters here like ' or ", among others.{/exp:spammenot}
or like this:
{exp:spammenot email="you@email.com" mode="1"
title="My Title" class="nocion email" subject="EE Inquiry"
text="Email Ryan for more info." message_body="If you have text that should go in the
message body, it should go in here right in a parameter), but we might have trouble
with weird characters here like \\' or \\", among others - you might have to escape them."}
I feel like the first way would be the way to go, in case you had a long message that might have a bunch of tricky characters in it.
Unfortunately, I’ve found that [as of version 1.0.3 - 15 September 2007] this plugin does not work with entries or custom weblog fields that use Textile formatting, but it does work with Markdown and/or SmartyPants’ text filters.
What happens with Textile is that the anchor code is output, but the e-mail address is not filled in so the code becomes:
<a href="mailto:"></a>
Markdown doesn’t seem to have a problem understanding the SpamMeNot syntax and outputs the code correctly:
<a href="mailto:user@domain.com">user@domain.com</a>
Unfortunately, I’ve found that [as of version 1.0.3 - 15 September 2007] this plugin does not work with entries or custom weblog fields that use Textile formatting…the anchor code is output, but the e-mail address is not filled it so the code becomes<code><a href="mailto">
Have you tried it with single quotes, and with the most basic parameter(s)? I found that EE’s native {encode} doesn’t work with Textile either (in my experience) unless you don’t use any quotes.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.