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.
Related Posts
- WordPress Carrington Theme – I’m Impessed I just read over at Matt Mullenweg’s blog about the annoucement of the Carrington Theme for WordPress. For those who don’t know, WordPress is a PHP/MySQL based blogging system and is the one I use for my blog. I’ve installed the Carrigton Theme and I really like it. Over the...
- Blog WordPress Theme Experiment – Grunge Style So I if you looked at my website within the last few hours or so you might have seen a very different theme. It was a grunge like style. My goal was to try and use PNGs for different layering and styles. Evenually I wanted the background to dynamically change...
- ASP .NET 2.0, GridViews, HyperLinkField, and JavaScript I’ve found some interesting notes on ASP .NET’s GridView, it’s limitations and work arounds. For work I was looking for a way to execute JavaScript from clicking a link on a GridView Cell. An example would be to having a list of transactions and wanting to click a link to...
- iPhone Web Development: Controlling the viewport via Javascript Lately I’ve been doing a lot of iPhone web applications. A client wanted to create a portion of their site for the iPhone, and they wanted it to look a very specific way. In order to do this we had to set the view port’s maximum-scale and minimum-scale to 1....
Help. I was doing fine with the carrington theme, then all of a sudden by blog page wasn’t displaying the current blogs….would would have to manually go into the archives to see them. I’m not sure if the problem I’m experiencing is the same one you mention above (I’m not a programmer). I’m not sure what I need to do….
Thanks,
Sandra