| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/**
|
| 4 |
* Installs the SimpleBlogroll module
|
| 5 |
* type.
|
| 6 |
* @file
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_install().
|
| 11 |
*/
|
| 12 |
function simpleblogroll_install() {
|
| 13 |
drupal_set_message('SimpleBlogroll installed.');
|
| 14 |
drupal_set_message('Created \'simpleblogroll\' table in database.');
|
| 15 |
drupal_install_schema('simpleblogroll');
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_uninstall().
|
| 20 |
*/
|
| 21 |
function simpleblogroll_uninstall() {
|
| 22 |
drupal_uninstall_schema('simpleblogroll');
|
| 23 |
variable_del('simpleblogroll_feeds');
|
| 24 |
variable_del('simpleblogroll_display');
|
| 25 |
variable_del('simpleblogroll_cron_run');
|
| 26 |
variable_del('simpleblogroll_cron_runs');
|
| 27 |
variable_del('simpleblogroll_on_submit');
|
| 28 |
variable_del('simpleblogroll_parse');
|
| 29 |
variable_del('display_time_new');
|
| 30 |
variable_del('display_links');
|
| 31 |
variable_del('simpleblogroll_info');
|
| 32 |
drupal_set_message('SimpleBlogroll uninstalled.');
|
| 33 |
drupal_set_message('Deleted \'simpleblogroll\' table from database.');
|
| 34 |
drupal_set_message('All module setting have been deleted.');
|
| 35 |
}
|
| 36 |
|
| 37 |
/**
|
| 38 |
* advanced_help's initial schema.
|
| 39 |
*/
|
| 40 |
function simpleblogroll_schema() {
|
| 41 |
$schema['simpleblogroll'] = array(
|
| 42 |
'description' => t('Stores feed info and feed contents.'),
|
| 43 |
'fields' => array(
|
| 44 |
'feed_title' => array(
|
| 45 |
'type' => 'varchar',
|
| 46 |
'length' => '255',
|
| 47 |
'default' => '',
|
| 48 |
'not null' => TRUE,
|
| 49 |
'description' => t('The fetched title.'),
|
| 50 |
),
|
| 51 |
'feed_url' => array(
|
| 52 |
'type' => 'varchar',
|
| 53 |
'length' => '255',
|
| 54 |
'default' => '',
|
| 55 |
'not null' => TRUE,
|
| 56 |
'description' => t('The feeds URL.'),
|
| 57 |
),
|
| 58 |
'site_url' => array(
|
| 59 |
'type' => 'varchar',
|
| 60 |
'length' => '255',
|
| 61 |
'default' => '',
|
| 62 |
'not null' => TRUE,
|
| 63 |
'description' => t('The URL of the feeds site.'),
|
| 64 |
),
|
| 65 |
'last_item' => array(
|
| 66 |
'type' => 'varchar',
|
| 67 |
'length' => '255',
|
| 68 |
'default' => '',
|
| 69 |
'not null' => TRUE,
|
| 70 |
'description' => t('The latest items title.'),
|
| 71 |
),
|
| 72 |
'item_url' => array(
|
| 73 |
'type' => 'varchar',
|
| 74 |
'length' => '255',
|
| 75 |
'default' => '',
|
| 76 |
'not null' => TRUE,
|
| 77 |
'description' => t('The latest items url.'),
|
| 78 |
),
|
| 79 |
'timestamp' => array(
|
| 80 |
'type' => 'int',
|
| 81 |
'length' => '11',
|
| 82 |
'default' => '0',
|
| 83 |
'not null' => TRUE,
|
| 84 |
'description' => t('The fetching timestamp.'),
|
| 85 |
),
|
| 86 |
),
|
| 87 |
'indexes' => array('feed_url' => array('feed_url')),
|
| 88 |
'primary key' => array('feed_title'),
|
| 89 |
);
|
| 90 |
|
| 91 |
return $schema;
|
| 92 |
}
|