Posting here for people to peruse, test, etc. This is my first plugin development effort, so if I’m doing something stupid, just let me know.
This takes any input between {exp:encode_email} tags and encodes any email addresses (multiples are fine) it finds into the ASCII code equivalent to try to do a little bit of hiding from email harvesting bots.
So, if you input:
Email us at blah@blah.com for more information!
This plugin will spit out:
Email us at blah@blah.com for more information!
Unscientific testing tells me that doing this does do a reasonably good job of hiding from spam bots. There are much more complex ways to encode the emails that would be better, but I’m not that smart.
What the…? Where is that?
Well, at least I learned something along the way.
Edit: Oh, no the encode global variable won’t work for me. This is exactly why I made this. I want to be able to pass in paragraphs and paragraphs of user-entered text and have it suck out any email addresses it finds along the way and return the whole string back with the email addresses encoded. Not only pass in an email address.
Oh, now that is cool. I had missed that as part of the functionality. Alternatively, you could use pMCode around those email addresses:
[email]email@example.com[/email]
which would encode them as well. But I did miss that it sucks those out of a paragraph, I quite like that. Thanks for posting =)
Yeah, that’s the big deal about this plugin for us. We have clients that use email addresses in paragraph text all the time, but they still want some spam protection. Can’t always use a separate field for email addresses.
One note, my plugin JUST encodes the email addresses. It does NOT auto convert them to mailto links like the encode global variable.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.