diff -Naur ../.././tmp/email/email.module ./email.module --- ../.././tmp/email/email.module 2008-04-15 07:56:09.000000000 -0400 +++ ./email.module 2009-03-18 18:08:36.000000000 -0400 @@ -51,6 +51,10 @@ 'label' => 'Email-Contact Form', 'field types' => array('email'), ), + 'abbv' => array( + 'label' => 'Abbreviated Email Text', + 'field types' => array('email'), + ), ); if (module_exists('invisimail')) { @@ -70,6 +74,16 @@ if ($formatter == 'contact') { $mailto = l(t('Email Contact Form'), 'email/'.$node->nid.'/'.$field['field_name']); } + if ($formatter == 'abbv') { + // takes the email address 'some.one@example.com' and abbreviates it: + // some.one@example + $at_pos = strpos($item['email'], '@'); // need to account for usernames with '.' in them. + $first_dot = strpos($item['email'], '.', $at_pos); + $abbv_addr = substr($item['email'], 0, $first_dot); + // may be desired to add this: + // $abbv_addr = str_replace('@', ' at ', $abbv_addr, 1); + $mailto = $abbv_addr; + } elseif ($formatter == 'invisi' && module_exists('invisimail')) { $format = $GLOBALS['invisimail_format']; if (!(variable_get('invisimail_link_'.$format, TRUE))) { @@ -379,4 +393,4 @@ return $tokens; } } -?> \ No newline at end of file +?>