View source
<?php
function httpbl_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {httpbl} (\n hostname varchar(128) NOT NULL,\n status tinyint(2) NOT NULL default '0',\n expire int(11) NOT NULL default '0',\n PRIMARY KEY (hostname),\n INDEX (expire)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
db_query("CREATE TABLE {httpbl} (\n hostname varchar(128) NOT NULL PRIMARY KEY,\n status smallint NOT NULL default 0,\n expire int NOT NULL default 0\n );");
db_query("CREATE INDEX {httpbl}_expire_idx on {httpbl} (expire);");
break;
}
}
function httpbl_uninstall() {
db_query('DROP TABLE {httpbl}');
variable_del('httpbl_accesskey');
variable_del('httpbl_check');
variable_del('httpbl_footer');
variable_del('httpbl_link');
variable_del('httpbl_log');
variable_del('httpbl_stats');
variable_del('httpbl_stat_black');
variable_del('httpbl_stat_comment');
variable_del('httpbl_stat_grey');
variable_del('httpbl_threatlevel');
variable_del('httpbl_message_black');
variable_del('httpbl_message_grey');
variable_del('httpbl_word');
}