This recipe renders e-mail links unreadable for spambots but usable for humans.
- E-mail links are written as usual in the Wiki source.
- E-mail links are obfuscated in the HTML output and meaningless for spambots.
This recipe is now installed on pmwiki.org.
- Place deobmail.phpΔ (alt. download) in your cookbook directory.
- Add in your local/config.php the line:
Just write your e-mail links like you usually do:
* mailto:firstname.lastname@example.org * [[mailto:email@example.com]] * [[mailto:firstname.lastname@example.org | e-mail me! ]] * [[mailto:email@example.com"Tooltip title" | with a tooltip ]] * [[mailto:firstname.lastname@example.org?subject=Wiki e-mail | with ?subject= ]] * [[email me -> mailto:email@example.com ]]
The e-mail addresses are converted to a special format:
You can change the
[snail] and the
[period] parts by adding to local/config.php the following:
$DeObMail['@'] = ' [arobase] '; # ie translated to French $DeObMail['.'] = ' [point] ';
Advanced admins can change the format of the HTML link snippet, by adding to local/config.php something like this:
$DeObMail['LinkFmt'] = '<a href="%u" class="mail" target="_blank">%t</a>';
%u will be replaced with the e-mail address, and
%t with the link text.
- Your skin needs the standard marker
<!--HTMLFooter-->near the bottom of the skin.tmpl template file, right before
- Emails in the wiki source are not obfuscated, so this recipe is mostly useful for wikis that have at least some password protection. Both "edit" and "source" actions should be protected.
- Only mailto: links are protected, plain text "firstname.lastname@example.org" in a wiki page is not a link and will be visible.
- 20120717 - add $DeObMail['LinkFmt'].
- 20090824 - add $DeObCustom variable.
- 20090703 - first public release.
- This recipe is written and maintained by Petko (5ko [snail] 5ko [period] fr).
- If this recipe helps you or saves you time, you can help support its continued development by ♥ .
Your comments are welcome at DeObMail-Talk.