function invisimail_encode_add_link in Invisimail 6
1 call to invisimail_encode_add_link()
- invisimail_ascii_encode in ./
invisimail.module - ASCII-encode an email address.
File
- ./
invisimail.module, line 243 - This module provides a filter that will search content for email addresses and replace them with their ascii equivalents before display. This is not a complete protection from spam harvesters, but it is some help.
Code
function invisimail_encode_add_link($string, $js, $text) {
static $counter = 0;
$encode = _invisimail_encode_string($string, $js);
$text = is_null($text) ? $encode : $text;
if ($js) {
$linkId = md5("mailto_link_{$counter}");
$counter++;
$output = "<span id=\"{$linkId}\"></span>";
$output .= "\n <script type=\"text/javascript\" > <!--\n document.getElementById('{$linkId}')\n .innerHTML = '<a href=\"" . INVISIMAIL_MAILTO_ASCII . "'+'{$encode}'+'\">'+'" . $text . "' + '</a>';" . "\n // --> </script>";
}
else {
$output = '<a href="' . INVISIMAIL_MAILTO_ASCII . "{$encode}\">{$text}</a>";
}
return $output;
}