Topic: How to hide email addresses in description using Recaptcha Mailhide
NOTE: this tutorial was written using JB 1.7 but my guess is there shouldn't be any problem if you use it on 1.8.
Maybe you've come across with the same problem as I have: Users sometimes insist in writing email addresses in the job description, perhaps not trusting the online application feature. This poses a problem if you want to keep your site 100% spambot free.
One good way of hiding in-text email addresses from non-human eyes is to use reCAPTCHA Mailhide. This tool will help you protect any in-text email address by asking people to solve a reCAPTCHA before they can view it so instead of seeing this-> user@example.com you will see this-> u...@example.com and once you click on the dotted part of the email address a popup with the captcha will appear, only if you solve it you will be able to see the email address.
First, you will have to get mailhide public and private keys here.
Once you get them open your /config.php file and immediately after this line (70):
define('SIDEBAR_CITIES', 'cities');
You should put this (replacing with your mailhide pub and priv keys):
define('MAILHIDE_PUBLIC_KEY', 'your public key goes here');
define('MAILHIDE_PRIVATE_KEY', 'your private key goes here');
Then open your page_job.php file and after this lines (98):
else
{
//$info['description'] = nl2br($info['description']);
$info['description'] = str_replace(array("\r\n", "\r", "\n"), "<br />", $info['description']);
}
add the following:
preg_match_all('/([\w\d\.\-\_]+)@([\w\d\.\_\-]+)/mi', $info['description'], $emails);
foreach($emails[0] as $email){
$mailhide_email = recaptcha_mailhide_html (MAILHIDE_PUBLIC_KEY, MAILHIDE_PRIVATE_KEY, $email);
$info['description'] = str_replace($email, $mailhide_email, $info['description']);
}
And that's it! There's no need to modify anything on your template. You can hide the email address in different ways, make sure to check the API here.
Last edited by wtrevino (2009-09-20 05:10:12)