Mollom is a great spam and bot protection tool for Drupal that protects Drupal's core forms and Webforms.
But what about custom forms we create with Drupal's Form API?
Thanks to Mollom's own api this is simple. Here's a snippet that we recently used to protect a custom password recovery form: -
<?php
function example_ibix_mollom_form_list() {
$forms['example_form_id'] = array(
'title' => t('Example Friendly Form Name'),
);
return $forms;
}
function example_mollom_form_info($form_id) {
switch ($form_id) {
case 'example_form_id':
$form_info = array(
'mode' => MOLLOM_MODE_CAPTCHA,
);
return $form_info;
break;
}
}
?>
Once we implement these hooks our form is displayed in the list of forms on Mollom's protection pages.
It's easy to add more options and change Mollom's mode too. Take a look at the mollom.api.php file included in mollom's module to see the full implentation.