You are here

function spamicide_install in Spamicide 6

Same name and namespace in other branches
  1. 8 spamicide.install \spamicide_install()
  2. 5 spamicide.install \spamicide_install()
  3. 7 spamicide.install \spamicide_install()

Implementation of hook_install(). Create the tables required for the spamicide module

File

./spamicide.install, line 99
This module provides yet another tool to eliminate spam.

Code

function spamicide_install() {
  drupal_install_schema('spamicide');

  // insert some defaults
  $form_ids = array(
    'comment_form',
    'contact_mail_user',
    'contact_mail_page',
    'user_register',
    'user_pass',
    'user_login',
    'user_login_block',
  );
  foreach ($form_ids as $form_id) {
    db_query("INSERT INTO {spamicide} (form_id, enabled, removable) VALUES ('%s', 1, 0)", $form_id);
  }
  drupal_set_message(t('The installation of the spamicide table and some default entries was successful.'), 'status');
  drupal_set_message(t('You can now <a href="!spamicide_admin">configure the Spamicide module</a> for your site.', array(
    '!spamicide_admin' => url('admin/settings/spamicide'),
  )), 'status');
}