Carrington Theme & Hashcash Plug-in Solution
I’ve been a huge Hashcash fan since using WordPress. In a nutshell, it requires a browser to process some javascript to generate a number to verify that the browser in-fact read the page. This helps prevent bots from submitting spam comments. The idea is that if a spam bot was required to process the javascript to make a “hash”, it would slow down posting comments by 20 times, if not more. Spammers make money off volumn, so they would lose “cash” slowing down their spamming. Hence the name: Hashcash.
Carrington is my current theme for WordPress. It has some ajax features for loading content and comments on the home and archive pages. It makes it a lot easier to post comments, and works really well. The problem is that Hashcash wouldn’t execute the JavaScript after loading comments via ajax. I had to make changes in two places to make it work.
First change is in /wp-content/themes/carrington/js/carrington.js on line 21:
setTimeout(“jQuery(’#wphc_value’).each(function(){ jQuery(this).val(wphc()); });”, 2000);
This goes inbetween the lines of:
jQuery(’#post-comments-’ + post_id + ‘-target’).html(cfct.loading()).load(CFCT_URL + ‘/index.php?cfct_action=post_comments&id=’ + post_id);
…
return false;
Second change goes in the Hashcash plugin file on live 340. Change this line:
if((is_single() || is_page()))
To this:
//if((is_single() || is_page()))
That will put the hashcash javascript code in the header for every page.
Hopefully this will help anyone who is trying to get Carrington and Hashcash to work.