None of your links worked for me, so I downloaded it from the Wiki. The Readme there didn't work at all, but I figured it out. The files changed where you have to add the code. This is how I made it work:
1. Upload generate_image.php to the /zen folder, change the permisson on this file to 777 (allow write to everybody). Upload code.png to the /zen/images folder 2. Open the image.php in the folder of your current theme. Add `<? include('zen/generate_code.php');?>` Add `` where you ant the picture with the Captcha to be, add `"/>`where you want the input box to be. In the default theme this would mean to find `
" class="inputbox" />
` and after this add `
<? include('zen/generate_code.php');?>
"/>
`
4. Open /zen/functions-controller.php Find the lines ` $commentadded = $_zp_current_image->addComment(strip_tags($_POST['name']), strip_tags($_POST['email']),
$website, kses($_POST['comment'], zp_conf('allowed_tags')));` in the zp_handle_comment function. Change this to `$commentadded = $_zp_current_image->addComment(strip_tags($_POST['name']), strip_tags($_POST['email']), $website,
5. Open /zen/class-image.php Find the `function addComment($name, $email, $website, $comment) {` and replace this line with `function addComment($name, $email, $website, $comment,$code,$code_ok) {` A few lines further in this function you'll find ` $comment = trim($comment);`. After this add `$code = trim($code);
$code_ok = trim($code_ok);` and replace ` if (empty($email) || !is_valid_email_zp($email) || empty($name) || empty($comment)) {` with ` if (empty($email) || !is_valid_email_zp($email) || empty($name) || empty($comment) || (md5($code)<>$code_ok)) {`
Comments
In other case, i will rebuild it
or
http://gratulog.free.fr/up/zenphoto_comment_protection.zip
(Sorry for my bad english, i'm french)
http://gregoryb.dyndns.org/public/scripts/zenphoto_comment_protection.zip
http://www.gregserveur.com/public/scripts/zenphoto_comment_protection.zip
1. Upload generate_image.php to the /zen folder, change the permisson on this file to 777 (allow write to everybody).
Upload code.png to the /zen/images folder
2. Open the image.php in the folder of your current theme.
Add `<? include('zen/generate_code.php');?>`
Add `` where you ant the picture with the Captcha to be, add `"/>`where you want the input box to be.
In the default theme this would mean to find
`
" class="inputbox" />
`
and after this add
`
<? include('zen/generate_code.php');?>
"/>
`
4. Open /zen/functions-controller.php
Find the lines
` $commentadded = $_zp_current_image->addComment(strip_tags($_POST['name']), strip_tags($_POST['email']),
$website, kses($_POST['comment'], zp_conf('allowed_tags')));`
in the zp_handle_comment function.
Change this to
`$commentadded = $_zp_current_image->addComment(strip_tags($_POST['name']), strip_tags($_POST['email']), $website,
kses($_POST['comment'], zp_conf('allowed_tags'))``,strip_tags($_POST['code']),$_POST['code_h']);`
5. Open /zen/class-image.php
Find the `function addComment($name, $email, $website, $comment) {`
and replace this line with `function addComment($name, $email, $website, $comment,$code,$code_ok) {`
A few lines further in this function you'll find ` $comment = trim($comment);`.
After this add `$code = trim($code);
$code_ok = trim($code_ok);`
and replace ` if (empty($email) || !is_valid_email_zp($email) || empty($name) || empty($comment)) {`
with ` if (empty($email) || !is_valid_email_zp($email) || empty($name) || empty($comment) || (md5($code)<>$code_ok)) {`
Other themes will have to add a printCaptcha() function call to their comment input block.