statistics_filter.install in Statistics Filter 5
File
statistics_filter.install
View source
<?php
function statistics_filter_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$queries = db_query("CREATE TABLE {statistics_filter_browsers} (\n browser varchar(255) NOT NULL default '',\n counter INT DEFAULT '0' NOT NULL,\n is_crawler TINYINT(1) DEFAULT '0' NOT NULL,\n PRIMARY KEY (browser)\n ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
if ($queries) {
drupal_set_message(t('Statistics Filter tables installed into the database'));
}
else {
drupal_set_message(t('There was a problem installing the Statistics Filter tables.'), 'error');
}
break;
case 'pgsql':
break;
}
}
function statistics_filter_uninstall() {
db_query('DROP TABLE {statistics_filter_browsers}');
variable_del('statistics_filter_noadmin');
variable_del('statistics_filter_roles');
variable_del('statistics_filter_crawlers');
}