Hi there

I added functionality to avoid spam to printed email-adresses for the current 5.1 dev release.
The code is LGPL and borrowed from http://smarty.php.net . It implements a javascript encryption as mentioned here: http://smarty.php.net/manual/en/language.function.mailto.php

Edit guestbook.module around line 618 and replace the if clause with this code

  if (in_array('email', $display) && !empty($entry['anonemail'])) {
    // javascript encoding of emailadress
    
	$string = 'document.write(\'<a href="mailto:'.check_url($entry['anonemail']).'">'.t('E-mail').'</a>\');';
	$js_encode = '';
	for ($x=0; $x < strlen($string); $x++) {
	   $js_encode .= '%' . bin2hex($string[$x]);
	}
    $output .= '&nbsp;|&nbsp;<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
  }

Please review.
I'd be happy if you would add it to SVN.

Greets.

Comments

sun’s picture

Title: Email encryption to avoid spam » Integrate with email obsfucation modules
Version: 5.x-1.x-dev » 6.x-2.x-dev
Assigned: roumen » Unassigned
Status: Needs review » Postponed

This surely won't be implemented into Guestbook module. However, integrating with other modules (like SpamSpan module) sounds reasonable.

sun’s picture

http://drupal.org/node/202267 has been marked as duplicate of this issue.

sun’s picture

Status: Postponed » Closed (won't fix)

Since no one worked on this, marking as won't fix.

knalstaaf’s picture

Suggested obsfucation not working for 6.x-2.0.