set_prefilter('comments_on_albums', 'prefilter_easycaptcha'); } function prefilter_easycaptcha($content, $smarty) { $search = '{$comment_add.CONTENT}

'; return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); } function check_easycaptcha($action, $comment) { global $conf, $page; if (!is_a_guest()) return $action; if (!easycaptcha_check()) { if ($conf['EasyCaptcha']['comments_action'] == 'reject') $page['errors'][] = l10n('Invalid answer'); return ($action != 'reject') ? $conf['EasyCaptcha']['comments_action'] : 'reject'; } return $action; }