*/ /** * Implementation of hook_install(). */ function technorati_install() { $result = drupal_install_schema('technorati'); if (count($result) > 0) { drupal_set_message(t('technorati module installed.')); } else { drupal_set_message(t('technorati table creation failed. Please "uninstall" the module and retry.')); } } /** * Implementation of hook_uninstall(). */ function technorati_uninstall() { drupal_uninstall_schema('technorati'); // delete variables variable_del('technorati_display_type'); foreach (node_get_types() as $node_type => $node_name) { variable_del('technorati_node_type_'. $node_type); } drupal_set_message(t('technorati module uninstalled.')); } /** * Implementation of hook_schema(). */ function technorati_schema() { $schema['technorati'] = array( 'fields' => array( 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'tags' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE, 'default' => '') ), 'indexes' => array( 'nid' => array('nid') ), 'primary key' => array('nid'), ); return $schema; }