You are here

custom.install in Spam 5.3

File

filters/custom/custom.install
View source
<?php

function custom_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
    default:
      db_query("CREATE TABLE {spam_custom} (\n        cid int(11) unsigned NOT NULL auto_increment,\n        filter varchar(255) NOT NULL default '',\n        style int(3) unsigned default '0', # text, regex, URL\n        status int(2) signed default '0', # spam, notspam...\n        scan int(3) unsigned default '0', # header, body, referrer\n        action int(3) unsigned default '0', # delete, mail\n        matches int(11) unsigned default '0', # counter\n        last int(11) unsigned default '0', # last match\n        weight int(3) signed default '0', # order filters\n        PRIMARY KEY cid (cid),\n        KEY filter (filter),\n        KEY matches (matches),\n        KEY last (last),\n        KEY weight (weight)\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
  }
}
function custom_uninstall() {
  db_query('DROP TABLE {spam_custom}');
  drupal_set_message('The spam_custom table has been dropped.');
}

Functions