Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
1.0
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

wm_encode

This is a drop-in replacement for the txp:email tag which attempts to provide a more robust block against spam harvesters. It can generate both a Javascript-based encoder which can only be “cracked” by a harvester that runs Javascript and a somewhat more sophisticated entity encoder that will first convert an address from “foo@bar.com” form to “foo at bar dot com” and then encode with a mix of decimal and hex entities. (This is less convenient due to the slight “mangling” of the address.)

<txp:wm_encode email="foo@bar.com" linktext="email me" title="popup" />

In addition, there are script and noscript attributes to control generation of the Javascript-based and text-based encoding blocks, respectively. Use script="0" to not generate the Javascript block and script="1" to generate it, and noscript="0" and noscript="1" for the text block.

By default, only the Javascript block is generated. The default settings are marked with comments in the function and can be changed. If both blocks are generated, the text block will be wrapped in <noscript> tags, so Javascript-enabled browsers will only see the first one. If only the text block is generated, it will not be wrapped in <noscript>.

Download g1.19 version
Download 1.0rc version

Article Request Count:
Posted here:
22 Mar 2005
Article modified:
22 Mar 2005

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (2)

Hi, thanks for this plug-in.
I’ve added/changed a feature, so that if the noscript option is set to 0, the noscript appears, but only with a warning notice:
[please enable JavaScript to view email]

Code following the noscript if bracket:

else
{
if ($script) $out .= “”;
$out .= $linktext.’ [please enable JavaScript to view email]’;
if ($script) $out .= “”;
}
Is there a way to do the same thing for the email address that is written when someone writes a comment?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern