since I put my site online, I have been receiving an increasing amount of spam on its contact address. Since I think it is good practice to do everything possible to fight spam, I hacked in a small enhancement in phpwcms ( 1.2.8 ) that implements the solution (3) given on http://www.spamspan.com in the MAIL replacement tag.
What I did:
- download http://www.spamspan.com/releases/spamspan-latest.zip and unzip spamspan.js into phpwcms_template/inc_js/
- in index.php find
(around line 107) and under it add the line
Code: Select all
$content['page_start'] .= ' <script src="'.TEMPLATE_PATH.'inc_js/frontend.js" type="text/javascript"></script>'.LF;
Code: Select all
$content['page_start'] .= ' <script src="'.TEMPLATE_PATH.'inc_js/spamspan.js" type="text/javascript"></script>'.LF;
- in include/inc_front/front.func.inc.php find the line where $search[23] is defined and change to (includes commented out originals)
Code: Select all
// this pharses out an E-Mail Link without subject (by Florian, 21-11-2003) // updated by Powerpenguin (2006.12.05) to be more spambot-safe (acc. to http://www.spamspan.com) // $search[23] = '/\[MAIL (.*?)\](.*?)\[\/MAIL\]/i'; // $replace[23] = '<a href="mailto:$1">$2</a>'; // splits MAIL RT in 1.user 2.domainname 3.domainextension 4.alias // (4 is not used a.t.m.) $search[23] = '/\[MAIL (.*?)@(.*?)\.(.*?)\](.*?)\[\/MAIL\]/i'; $replace[23] = '<span class="spamspan"><span class="u">$1</span> [at] <span class="d">$2 [dot] $3</span></span>';