Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep. 02, 2010, 08:14:00 PM
53844 Posts in 11998 Topics by 11375 Members
Latest Member: elizablackmore7
News:
 
The PRADO Community » Prado v3.x » Feature Requests » Email scrambler « previous next »
Pages: [1] Print
Author Topic: Email scrambler  (Read 4229 times)
jjmf
Senior Member
***

Karma: 5
Offline Offline

Posts: 221



View Profile
« on: May. 31, 2006, 02:24:19 AM »

It would be nice if PRADO suply an email scrambler so that spammers could not get emails from source code of PRADO generated pages. Something similar to the smarty {mailto} plugin.
Logged
jjmf
Senior Member
***

Karma: 5
Offline Offline

Posts: 221



View Profile
« Reply #1 on: Jun. 04, 2006, 03:29:01 AM »

If this seems to be a bad idead, can someone tell me how can I accomplish this with Prado?
Logged
Artūras Šlajus
Senior Member
***

Karma: 8
Offline Offline

Posts: 137


...and my invisible friend Joey.


View Profile WWW
« Reply #2 on: Jun. 04, 2006, 03:40:02 PM »

Write a component Smiley

If you would explain me the process I could write the component for you.
Logged

Imagine if you could change TRUE to be FALSE... The whole thing becomes a lie!
rokclimb15
Senior Member
***

Karma: 1
Offline Offline

Posts: 147


View Profile
« Reply #3 on: Jun. 04, 2006, 07:42:37 PM »

Basically, you base64 encode the email address, but put a javascript tag around it to decode, so it looks ok in the browser and even makes a valid mailto link, but in the source it is scrambled.

Here's a test

http://www.happysnax.com.au/testemail.php
Logged
wei
PRADO v3.x Developer
Diamond Member
*****

Karma: 65
Offline Offline

Posts: 2869



View Profile
« Reply #4 on: Jun. 04, 2006, 11:57:49 PM »

a very simple way

Code:
class MyEmailFormatter extends TWebControl
{
public function renderContents($writer)
{
$textWriter=new TTextWriter;
parent::renderContents(new THtmlWriter($textWriter));
$email = strtoupper($textWriter->flush());
$content = str_replace(array('.','@'), array(' dot ', ' at '), $email);
$writer->write($content);
}
}

Usage:
Code:
<com:MyEmailFormatter>someone@gmail.com</com:MyEmailFormatter>

Should output "SOMEONE at GMAIL dot COM", of course it may be possible for email harvesters to pick it up.
« Last Edit: Jun. 05, 2006, 12:00:21 AM by wei » Logged
jjmf
Senior Member
***

Karma: 5
Offline Offline

Posts: 221



View Profile
« Reply #5 on: Jun. 05, 2006, 03:16:04 AM »

Ok guys, I'll try to put toguether rokclimb15 tip with wei solution and then I'll let you know.
Thanks!
Logged
Artūras Šlajus
Senior Member
***

Karma: 8
Offline Offline

Posts: 137


...and my invisible friend Joey.


View Profile WWW
« Reply #6 on: Jun. 05, 2006, 09:37:26 AM »

I think he needed this: (code attached as file)
[code]
<?php
/**
 * @author Artūras

* MTEmailScrambler.php (1.7 KB - downloaded 12 times.)
Logged

Imagine if you could change TRUE to be FALSE... The whole thing becomes a lie!
jjmf
Senior Member
***

Karma: 5
Offline Offline

Posts: 221



View Profile
« Reply #7 on: Jun. 05, 2006, 12:25:36 PM »

Hey thanks a lot Artūras!
Exactly what I was trying to do!
And it's also a great example. The code and your atitude!
Thanks again!
Logged
Artūras Šlajus
Senior Member
***

Karma: 8
Offline Offline

Posts: 137


...and my invisible friend Joey.


View Profile WWW
« Reply #8 on: Jun. 05, 2006, 12:37:10 PM »

No probs ;-)
Logged

Imagine if you could change TRUE to be FALSE... The whole thing becomes a lie!
Pages: [1] Print 
« previous next »
Jump to: