| 1 |
<?php |
<?php |
| 2 |
// $Id: textlinkads.install,v 1.2 2007/02/08 20:01:10 kbahey Exp $ |
// $Id: textlinkads.install,v 1.3 2008/06/05 23:36:00 mikejoconnor Exp $ |
| 3 |
|
|
| 4 |
function textlinkads_schema() { |
function textlinkads_schema() { |
| 5 |
$schema['textlinkads'] = array( |
$schema['textlinkads'] = array( |
| 10 |
'type' => 'serial', |
'type' => 'serial', |
| 11 |
'not null' => TRUE, |
'not null' => TRUE, |
| 12 |
), |
), |
| 13 |
|
'nid' => array( |
| 14 |
|
'description' => t('The nid associated with an inlinks ad'), |
| 15 |
|
'type' => 'int', |
| 16 |
|
'length' => 11, |
| 17 |
|
'not null' => TRUE, |
| 18 |
|
), |
| 19 |
'url' => array( |
'url' => array( |
| 20 |
'description' => t('the url for the ad'), |
'description' => t('the url for the ad'), |
| 21 |
'type' => 'varchar', |
'type' => 'varchar', |
| 73 |
|
|
| 74 |
function textlinkads_install() { |
function textlinkads_install() { |
| 75 |
drupal_install_schema('textlinkads'); |
drupal_install_schema('textlinkads'); |
| 76 |
|
include_once(drupal_get_path('module', 'textlinkads') .'/textlinkads.module'); |
| 77 |
|
textlinkads_inlinks_set_max_post_id(); |
| 78 |
|
variable_set('textlinkads_inlinks_last_sync_post_id', 0); |
| 79 |
|
textlinkads_inlinks_notify_tla('install'); |
| 80 |
} |
} |
| 81 |
|
|
| 82 |
function textlinkads_uninstall() { |
function textlinkads_uninstall() { |
| 83 |
drupal_uninstall_schema('textlinkads'); |
drupal_uninstall_schema('textlinkads'); |
| 84 |
|
variable_del('textlinkads_inlinks_max_sync_post_id'); |
| 85 |
|
variable_del('textlinkads_inlinks_last_sync_post_id'); |
| 86 |
} |
} |
|
/* |
|
|
* Import links from existing variable. |
|
| 87 |
|
|
| 88 |
function textlinkads_update_1() { |
function textlinkads_update_1() { |
|
textlinkads_install(); |
|
| 89 |
textlinkads_check_update(); |
textlinkads_check_update(); |
| 90 |
variable_del('textlinkads_ad_data'); |
variable_del('textlinkads_ad_data'); |
| 91 |
return array(); |
return array(); |
| 92 |
} |
} |
|
*/ |
|
| 93 |
|
|
| 94 |
|
function textlinkads_update_2() { |
| 95 |
|
$return = array(); |
| 96 |
|
db_add_field($return, 'textlinkads', 'nid', array('type' => 'int', length => 11, 'not null' => TRUE)); |
| 97 |
|
return array(); |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
function textlinkads_update_3() { |
| 101 |
|
$return = array(); |
| 102 |
|
$schema['textlinkads_inlinks'] = array( |
| 103 |
|
'description' => t('The this table allows node level permission to sell links within a post'), |
| 104 |
|
'fields' => array( |
| 105 |
|
'nid' => array( |
| 106 |
|
'description' => t('The node id'), |
| 107 |
|
'type' => 'int', |
| 108 |
|
'length' => 11, |
| 109 |
|
'not null' => TRUE, |
| 110 |
|
), |
| 111 |
|
'status' => array( |
| 112 |
|
'description' => t('The status of inlinks for the node'), |
| 113 |
|
'type' => 'int', |
| 114 |
|
'length' => 1, |
| 115 |
|
'not null' => TRUE, |
| 116 |
|
'default' => 0, |
| 117 |
|
), |
| 118 |
|
), |
| 119 |
|
'primary key' => array('nid'), |
| 120 |
|
); |
| 121 |
|
db_create_table($return, 'textlinkads_inlinks', $schema['textlinkads_inlinks']); |
| 122 |
|
return $return; |
| 123 |
|
} |