sNews Forum

sNews 1.6 (previous version) => sNewsMU (sNews Multi User version) => MU Mods => Topic started by: feiming on May 24, 2008, 08:54:20 pm

Title: [Mod] reCaptcha
Post by: feiming on May 24, 2008, 08:54:20 pm
Description:Preventing spam while helping to digitize books.

Screenshot
(http://snews.zyrax.net/recaptcha.png)

Demo
http://campuschronicle.cc/news/login/ (http://campuschronicle.cc/news/login/)

Step 0
Backup

Step 1
Download this recaptcha.txt (http://snews.zyrax.net/recaptcha.txt) rename to recaptcha.php and upload.
Download this http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest (http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest),extract recaptcha-php-*.zip and upload recaptchalib.php.
*both file should be in the same directory with snewsMU.php

Step 2
In recaptcha.php,enter your reCaptcha public and private key which you can get it from here http://recaptcha.net/whyrecaptcha.html
Quote
   $publickey = "your reCaptcha public key";
   $privatekey = "your reCaptcha private key";

Step 3
In snewsMU.php,find
Quote
/*** END OF SETTINGS & VARIABLES, EDIT BELOW THIS LINE ONLY IF YOU KNOW WHAT YOU'RE DOING ***/
and paste
Quote
/*** END OF SETTINGS & VARIABLES, EDIT BELOW THIS LINE ONLY IF YOU KNOW WHAT YOU'RE DOING ***/

include('recaptcha.php');

Step 4
Find all of
Quote
is_numeric($_POST['calc']) && mathCaptcha($_POST['calc'], $_POST['sum'])
and replace them with
Quote
reCaptcha($_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'])

Step 5
Find all of
Quote
mathCaptcha($_POST['calc'], $_POST['sum'])
and replace them with
Quote
reCaptcha($_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'])

Step 6
Find all of
Quote
mathCaptcha()
and replace them with
Quote
reCaptcha()