Hi

Thanks for the great module.

I was wondering if there are any plans to implement support for Mollom. I believe Mollom has a hook that allows other modules forms to appear in its form list.

CommentFileSizeAuthor
#8 mailchimp.module.patch1.37 KBdmcdenissen

Comments

YK85’s picture

Version: 6.x-2.4 » 6.x-2.x-dev

subscribing

sk33lz’s picture

subscribing

gg4’s picture

+1

rj’s picture

Component: Miscellaneous » General

subscribe

jtbayly’s picture

+1

opegasus’s picture

+1

mvc’s picture

Status: Active » Closed (duplicate)

there's already a d7 request for this feature: #1321152: Mollom Integration
i imagine that this would only make its way to d6 as a backport from d7, so i'll close this issue.

dmcdenissen’s picture

StatusFileSize
new1.37 KB

I included a patch to add the mollom integration, you can also add the following code at the end of the file mailchimp.module:

/**
 * Implements hook_mollom_form_list().
 */
function mailchimp_mollom_form_list() {
  global $user;
  $mailchimp_list = _mailchimp_get_available_lists($user);  
  if(isset($mailchimp_list) && count($mailchimp_list > 0)) {
    foreach($mailchimp_list as $key => $val) {
      $forms['mailchimp_subscribe_anon_form_'.$key] = array(
       'title' => t('Mailchimp - anonymous user: ').$val->label,
      );
      $forms['mailchimp_subscribe_auth_form_'.$key] = array(
       'title' => t('Mailchimp - Authenticated user: ').$val->label,
      );
    }
  }
  return $forms;
}

/**
 * Implements hook_mollom_form_info().
 */
function mailchimp_mollom_form_info($form_id) {
  $availablemollomlists = array();
  global $user;
  $mailchimp_list = _mailchimp_get_available_lists($user);  
  if(isset($mailchimp_list) && count($mailchimp_list > 0)) {
    foreach($mailchimp_list as $key => $val) {
      $availablemollomlists[] = 'mailchimp_subscribe_anon_form_'.$key;
      $availablemollomlists[] = 'mailchimp_subscribe_auth_form_'.$key;
    }
  }
  if(in_array($form_id, $availablemollomlists)) {
    return array();
  }
}