webmaster@1: TRUE, 'default' => "''")); webmaster@1: break; webmaster@1: } webmaster@1: webmaster@1: return $ret; webmaster@1: } webmaster@1: webmaster@1: /** webmaster@1: * Implementation of hook_uninstall(). webmaster@1: */ webmaster@1: function statistics_uninstall() { webmaster@1: // Remove tables. webmaster@1: drupal_uninstall_schema('statistics'); webmaster@1: webmaster@1: variable_del('statistics_count_content_views'); webmaster@1: variable_del('statistics_enable_access_log'); webmaster@1: variable_del('statistics_flush_accesslog_timer'); webmaster@1: variable_del('statistics_day_timestamp'); webmaster@1: variable_del('statistics_block_top_day_num'); webmaster@1: variable_del('statistics_block_top_all_num'); webmaster@1: variable_del('statistics_block_top_last_num'); webmaster@1: } webmaster@1: webmaster@1: /** webmaster@1: * Implementation of hook_schema(). webmaster@1: */ webmaster@1: function statistics_schema() { webmaster@1: $schema['accesslog'] = array( franck@19: 'description' => 'Stores site access information for statistics.', webmaster@1: 'fields' => array( webmaster@1: 'aid' => array( webmaster@1: 'type' => 'serial', webmaster@1: 'not null' => TRUE, franck@19: 'description' => 'Primary Key: Unique accesslog ID.', webmaster@1: ), webmaster@1: 'sid' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 64, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => '', franck@19: 'description' => 'Browser session ID of user that visited page.', webmaster@1: ), webmaster@1: 'title' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 255, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'Title of page visited.', webmaster@1: ), webmaster@1: 'path' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 255, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'Internal path to page visited (relative to Drupal root.)', webmaster@1: ), webmaster@1: 'url' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 255, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'Referrer URI.', webmaster@1: ), webmaster@1: 'hostname' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 128, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'Hostname of user that visited the page.', webmaster@1: ), webmaster@1: 'uid' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => FALSE, webmaster@1: 'default' => 0, franck@19: 'description' => 'User {users}.uid that visited the page.', webmaster@1: ), webmaster@1: 'timer' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'Time in milliseconds that the page took to load.', webmaster@1: ), webmaster@1: 'timestamp' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'Timestamp of when the page was visited.', webmaster@1: ), webmaster@1: ), webmaster@1: 'indexes' => array( webmaster@1: 'accesslog_timestamp' => array('timestamp'), webmaster@1: 'uid' => array('uid'), webmaster@1: ), webmaster@1: 'primary key' => array('aid'), webmaster@1: ); webmaster@1: webmaster@1: return $schema; webmaster@1: } webmaster@1: