Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Re: [Andy] Plugin Requested | Encode Email Addresses

Quote Reply
Re: [Andy] Plugin Requested | Encode Email Addresses In reply to
Hello,

Thank you for your answer.

Here the code which I use.

<%encrypt_mails%>
-------------
sub {

my $in = $_[0];
my $strings = q|
a~097
b~098
c~099
d~100
e~101
f~102
g~103
h~104
i~105
j~106
k~107
l~108
m~109
n~110
o~111
p~112
q~113
r~114
s~115
t~116
u~117
v~118
w~119
x~120
y~121
z~122
1~049
2~050
3~051
4~052
5~053
6~054
7~055
8~056
9~057
0~048
&~038
~032
_~095
-~045
@~064
.~046
|;

my $back;
my @address = split //, $in; # cut the email address up into each charachter...
my @strings = split /\n/, $strings;

foreach (@address) {

my $next;

foreach my $s (@strings) {

next if $next == 1;

my ($char,$equiv) = split /~/, $s; # get the charachter, and its numerical equiv

if ($char eq $_) {
$char =~ s/\Q$char/$equiv/i;
$char = '&#' . $char . ';';
$back .= $char; # add the new replacement to $back
$next = 1;
}

}

}

return $back;

}
-------------

It gives the result for : mick@serveur.com

m ;i ;c ;k ;@ ;s ;e ;r ;v ;e ;u ;r ;. ;f ;r ;

<a href="mailto:&#109 ;&#105 ;&#099 ;&#107 ;&#064 ;&#115 ;&#101 ;&#114 ;&#118 ;&#101 ;&#117 ;&#114 ;&#046 ;&#102 ;&#114 ;">

You have an idea.

I do not manage to find my error.

Thank you for your assistance.

Mick
Subject Author Views Date
Thread Plugin Requested | Encode Email Addresses sangiro 10122 Jun 25, 2004, 12:42 PM
Thread Re: [sangiro] Plugin Requested | Encode Email Addresses
Andy 10034 Jun 26, 2004, 5:04 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
sangiro 9968 Jun 26, 2004, 6:25 AM
Thread Re: [sangiro] Plugin Requested | Encode Email Addresses
Andy 9948 Jun 26, 2004, 6:34 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
sangiro 9964 Jun 26, 2004, 7:03 AM
Thread Re: [sangiro] Plugin Requested | Encode Email Addresses
Andy 9993 Jun 26, 2004, 7:17 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
sangiro 9971 Jun 26, 2004, 7:33 AM
Thread Re: [sangiro] Plugin Requested | Encode Email Addresses
Andy 9921 Jun 26, 2004, 7:58 AM
Post Re: [Andy] Plugin Requested | Encode Email Addresses
sangiro 9920 Jun 26, 2004, 1:33 PM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9836 Oct 22, 2004, 4:48 AM
Thread Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9848 Oct 22, 2004, 4:50 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9782 Oct 22, 2004, 5:04 AM
Thread Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9797 Oct 22, 2004, 5:43 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9766 Oct 22, 2004, 6:58 AM
Thread Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9782 Oct 22, 2004, 7:03 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9804 Oct 23, 2004, 1:41 AM
Thread Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9812 Oct 23, 2004, 1:50 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9761 Oct 23, 2004, 2:44 AM
Thread Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9835 Oct 23, 2004, 2:54 AM
Thread Re: [Andy] Plugin Requested | Encode Email Addresses
mick31 9798 Oct 23, 2004, 4:47 AM
Post Re: [mick31] Plugin Requested | Encode Email Addresses
Andy 9780 Oct 23, 2004, 5:47 AM
Post Re: [mick31] Plugin Requested | Encode Email Addresses
sangiro 9810 Oct 22, 2004, 9:30 AM
Post Re: [sangiro] Plugin Requested | Encode Email Addresses
bigfish 9940 Jun 26, 2004, 9:25 AM