Hey - have you managed to figure this out yet? (I realize this top is a few months old now, so I thought I'd ask.)
If you haven't - or for anybody else who happens across this topic and wants to know how - here's how I did it on my forum:
1. If you haven't already done it, sign up for reCAPTCHA, and download the reCAPTCHA PHP Library at: http://recaptcha.net/
2. Again, if you haven't already done so, extract recaptchalib.php from the PHP Library into your punBB root directory.
3a. Open up post.php.
3b. Find (should be around line 27):
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
After it, add:
require_once('recaptchalib.php');
$publickey = "youpublickey";
$privatekey = "yourprivatekey";
(Obviously, replace yourpublickey and yourprivatekey with your public and private reCAPTCHA keys.)
3c. Find (should be around line 140):
if ($pun_config['p_force_guest_email'] == '1' || $email != '')
{
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
$errors[] = $lang_common['Invalid e-mail'];
}
After it, add:
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
message("The <b>reCAPTCHA</b> wasn't entered correctly. Go back and try it again.");
}
3d. Find (should be around line 531):
<div class="inform">
<fieldset>
<legend><?php echo $lang_common['Options'] ?></legend>
<div class="infldset">
<div class="rbox">
<?php echo implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
</div>
</div>
</fieldset>
<?php
}
?>
</div>
After it, add:
<?php
if ($pun_user['is_guest'])
{
?>
<div class="inform">
<fieldset>
<legend>Are you human?</legend>
<?php echo recaptcha_get_html($publickey, $error); ?>
</fieldset>
</div>
<?php
}
?>
4. Save, upload, and you're done!
A couple quick notes:
These instructions were written for punBB version 1.2.19 - though they should work for other 1.2.x versions, I can't guarantee it.
These instructions make it so that guests only, not registered members, are required to use the captcha. If you'd like to require a captcha for members and guests, and can't figure it out, let me know.
I probably couldn't have figured this out without a little help from 36 Invisible's article on setting up reCaptcha for punBB registrations - so thanks to him.
If you have any questions, just let me know!
Also: if anyone finds a better way to do this (I went in, with the exception of a few ideas from 36 Invisible's post, pretty much blind here), please let me know!