set_prefilter('cf_form', 'captcha_prefilter'); $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'].'.cfg.php',1)); } function captcha_prefilter($content, $smarty) { $search = '   '; $replace = ' {\'Antibot test\'|@translate} {$CAPTCHA} ' ."\n".$search; return str_replace($search, $replace, $content); } function check_captcha($infos) { global $conf; if (!is_a_guest()) return $infos; if (!chk_crypt($_POST['code'])) { load_language('plugin.lang', CRYPTO_PATH); array_push($infos['errors'], l10n('Invalid Captcha')); } return $infos; } ?>