Download lb_recaptcha.php.txt
<?php
/******************************************
lb_recaptcha v0.2 (2007.06.26)
< cyber slug labs at g mail dot com >
http://cyberslug.net
This plugin adds support for ReCAPTCHA to
Loudblog. A small hack to loudblogtags.php
is required to replace the built-in anti-spam
check with the CAPTCHA check.
URL: http://cyberslug.net/software/recaptcha.php
About:
ReCAPTCHA is a free service that protects
against spam while helping proofread OCR
scans done by the Internet Archive.
You will need to download recaptchalib.php
to your plugins directory and sign up for
your free account keys to use this plugin.
URL: http://recaptcha.net/plugins/php/
******************************************/
require_once('recaptchalib.php');
function recaptcha () {
global $settings;
$publickey = "";
$privatekey = "";
$return = "";
$error = null;
if (isset($_POST['commentpreview'])) {
$return = recaptcha_get_html($publickey, $error);
}
if (isset($_POST['commentsubmit'])) {
if ($_POST["recaptcha_response_field"]) {
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
$return = "OK";
} else {
$return = "Anti-Spam Error! (".$resp->error.") - Please try again.";
}
} else {
$return = "Please make certain to answer the anti-spam question.";
}
}
return $return;
}
?>