We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Encode Email (alpha? beta?)

Development and Programming

jtnt's avatar
jtnt
137 posts
17 years ago
jtnt's avatar jtnt

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 [email protected] 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.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

jtnt, you know there is an encode global variable for this? As well as pMCode that does this?

       
jtnt's avatar
jtnt
137 posts
17 years ago
jtnt's avatar jtnt

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.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

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 protected][/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 =)

       
jtnt's avatar
jtnt
137 posts
17 years ago
jtnt's avatar jtnt

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.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

That is pretty neat, I could have used this about a year ago… Thanks jtnt =)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.