| 1 |
<?php |
<?php |
| 2 |
// $Id: follow.install,v 1.1.2.1 2009/04/29 20:37:20 q0rban Exp $ |
// $Id: follow.install,v 1.2 2009/10/30 21:09:28 pwolanin Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 10 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 11 |
*/ |
*/ |
| 12 |
function follow_install() { |
function follow_install() { |
| 13 |
drupal_install_schema('follow'); |
return; |
| 14 |
|
// @todo: Add a default link to this site's node RSS feed. |
| 15 |
|
db_insert('follow_links') |
| 16 |
|
->fields(array( |
| 17 |
|
'name' => 'self', |
| 18 |
|
'url' => 'rss.xml', |
| 19 |
|
'uid' => 0, |
| 20 |
|
'weight' => 0, |
| 21 |
|
)) |
| 22 |
|
->execute(); |
| 23 |
} |
} |
| 24 |
|
|
| 25 |
/** |
/** |
| 27 |
*/ |
*/ |
| 28 |
function follow_schema() { |
function follow_schema() { |
| 29 |
$schema['follow_links'] = array( |
$schema['follow_links'] = array( |
| 30 |
'description' => t('Stores sitewide and user follow links.'), |
'description' => 'Stores sitewide and user follow links.', |
| 31 |
'fields' => array( |
'fields' => array( |
| 32 |
'lid' => array( |
'lid' => array( |
| 33 |
'type' => 'serial', |
'type' => 'serial', |
| 34 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 35 |
'not null' => TRUE, |
'not null' => TRUE, |
| 36 |
'description' => t('Unique identifier for the {follow_links}.'), |
'description' => 'Unique identifier for the {follow_links}.', |
| 37 |
), |
), |
| 38 |
'name' => array( |
'name' => array( |
| 39 |
'type' => 'varchar', |
'type' => 'varchar', |
| 40 |
'length' => 255, |
'length' => 255, |
| 41 |
'not null' => TRUE, |
'not null' => TRUE, |
| 42 |
'default' => '', |
'default' => '', |
| 43 |
'description' => t("The machine name of the {follow_links}."), |
'description' => "The machine name of the {follow_links}.", |
| 44 |
), |
), |
| 45 |
'uid' => array( |
'uid' => array( |
| 46 |
'type' => 'int', |
'type' => 'int', |
| 60 |
'not null' => TRUE, |
'not null' => TRUE, |
| 61 |
'default' => 0, |
'default' => 0, |
| 62 |
'size' => 'tiny', |
'size' => 'tiny', |
| 63 |
'description' => t('The weight of this {follow_links}.'), |
'description' => 'The weight of this {follow_links}.', |
| 64 |
), |
), |
| 65 |
), |
), |
| 66 |
'primary key' => array('lid'), |
'primary key' => array('lid'), |
| 75 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 76 |
*/ |
*/ |
| 77 |
function follow_uninstall() { |
function follow_uninstall() { |
|
drupal_uninstall_schema('follow'); |
|
| 78 |
variable_del('follow_user_block_title'); |
variable_del('follow_user_block_title'); |
| 79 |
variable_del('follow_site_block_title'); |
variable_del('follow_site_block_title'); |
| 80 |
variable_del('follow_site_block_user'); |
variable_del('follow_site_block_user'); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
function follow_update_7000() { |
| 84 |
cache_clear_all('follow:networks', 'cache'); |
cache_clear_all('follow:networks', 'cache'); |
| 85 |
|
return array(); |
| 86 |
} |
} |
| 87 |
|
|