I think I'm gonna go with my previous solution.  Here's part of the
code I have so far.  It works with PHP and the smarty framework.

it hides email addresses to those not using Javascript (hopefully
bots).


 $text = $address;

      global $smarty_mailto_span_count;
        $span_id= "_smarty_mailto_span_".++$smarty_mailto_span_count;

        $string = 'var mailto=document.getElementById("'.
$span_id.'");
                   mailto.innerHTML=\'<a href="mailto:'.$address.'" '.
$extra.'>'.$text.'</a>\';';

        $js_encode = '';
        for ($x=0; $x < strlen($string); $x++) {
            $js_encode .= '%' . bin2hex($string[$x]);
        }

        return '<span id="'.$span_id.'">to see email address, enable
javascript</span>
                <script type="text/javascript">'.$string.'</script>';


I can't say I like having to put it in a span with a new id each time,
but it works. So, I think I will stick with this unless there is a
better way to do it.

-d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to