Skip to content


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.

Related Posts

  1. 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...
  2. 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...
  3. Empowering JavaScript Through jQuery Once I discovered jQuery, my life as a web developer changed. There are few libraries, tools, etc. that I can honestly say have completely changed the way I code. In all honesty, jQuery makes the difficult aspects of JavaScript and turns them into a strength. I recommend it over any...
  4. 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...
  5. ASP .NET Ajax - Straight forward and simple, the way it should be. I have to say, I'm very impressed with the implementation of ASP .NET AJAX. After creating several projects in .NET, converting several of my pages to implement AJAX was beyond easy. It was incredible. It takes all the "thinking" out of AJAX and just makes it work. Now, I'm not...

Posted in General.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.

Powered by WP Hashcash