Quote from: Wiseguy at Feb 26, 2009, 10:43 AMThe problem here is that it included a double negative, as it was first checking that $saveComment is true and then checking a bunch of variables were not true - one of which was $this->config["captcha"] is inactive. So in summary to fix it I simply changed the following:
$this->config["captcha"] == 0
to
$this->config["captcha"] == 1
Please attention to
!
code is correct.
! ($this->config["captcha"] == 0) returns true when $this->config["captcha"] is 1 or 2 (or any else).
I have problem with CAPTCHA (in php config), i can’t use it but i need it like you.
So i created a custom captcha like this and a new customfield,
in form template:
....
<div class="jot-err">
[+form.error:select=`
....
&2= Are you OK? Today is [+form.field.custom.myvericode+]?!
....
`+]
</div>
....
Today is:
<select name="myVericode">
<option value="Sat">Sat</option>
<option value="Sun">Sun</option>
<option value="Mon">Mon</option>
<option value="Tue">Tue</option>
<option value="Wed">Wed</option>
<option value="Thu">Thu</option>
<option value="Fri">Fri</option>
</select>
....
and add this in jot.class.inc.php after Jot captcha check (line 548):
if ($saveComment && !( strtolower(date("D")) == strtolower($_POST['myVericode']) ) ){
$this->form['error'] = 2; // My Veriword / Captcha incorrect
unset($pObj);
return;
}
and in Jot call: [!Jot? .... &customfields=`.... ,myVericode` ...!]
You can also use usual trick, a CSS hidden field:
<input type="text" name="myVeriword" value="0" style="display:none;" />
user won’t see this field and can not change it’s value so....
if ($saveComment && $_POST['myVericode'] != 0){
$this->form['error'] = 2; // My Veriword / Captcha incorrect
unset($pObj);
return;
}
Robots can not pass these way.... (i hope)