2.0rc2 doesn´t work correctly, when more captcha are displayed on one page (for example one in login modul, and one in main content).
When you click any of the reload button, always first captcha on the side will be rfefreshed in the database.
The reason is in javascript, function spamfixreload is specified twice, and even it has argument ID of captcha Image, so the correct one image will be refreshed, It doesn't have argument for captcha_id.
Simple sulution, but not perfect, is to modify reload.php in captcha plugin to add captcha_id, for example like this:
function reloadCode($captcha)
{
$code = "<script type=\"text/javascript\">";
$code .= "function spamfixreload (id,captcha_id) {";
$code .= "var a= Math.floor(Math.random()*1000); ";
$code .= "var neuesbild = document.getElementById(id);";
$code .= "neuesbild.src = \"".JURI::base()."components/com_easycaptcha/captchas/$captcha->captcha_name/captcha.php?captcha_id=\"+captcha_id+\"&reload=\"+a;}";
$code .= "</script>";
return $code;
}
function reloadButton($id, $image=null, $captcha)
{
if($image)
{
$button = "<a href=\"javascript:spamfixreload('$id','".$captcha->captcha_id."')\"><img src=\"$image\" title=\"".JTEXT::_('Regenerate Code')."\" alt=\"".JTEXT::_('Regenerate Code')."\" border=\"0\" /></a>";
}
else
{
$button = "<a href=\"javascript:spamfixreload('$id','".$captcha->captcha_id."')\"><img src=\"".JURI::base()."components/com_easycaptcha/images/reload.gif\" title=\"".JTEXT::_('Regenerate Code')."\" alt=\"".JTEXT::_('Regenerate Code')."\" border=\"0\" /></a>";
}
return $button;
}
an ofcourse class.easycaptcha.php like this
function getReloadButton($id, $image=null)
{
include_once(ABSOLUTEPATH.DS."captchas".DS.$this->captcha_name.DS."reload.php");
return reloadButton($id, $image, $this);
}