| 1 |
<?php
|
| 2 |
// $Id: textlinkads.install,v 1.3 2008/06/05 23:36:00 mikejoconnor Exp $
|
| 3 |
|
| 4 |
function textlinkads_schema() {
|
| 5 |
$schema['textlinkads'] = array(
|
| 6 |
'description' => t('The base table for the Text-Link-Ads.com module'),
|
| 7 |
'fields' => array(
|
| 8 |
'tlid' => array(
|
| 9 |
'description' => t('The primary id for an ad'),
|
| 10 |
'type' => 'serial',
|
| 11 |
'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(
|
| 20 |
'description' => t('the url for the ad'),
|
| 21 |
'type' => 'varchar',
|
| 22 |
'length' => 255,
|
| 23 |
'not null' => TRUE,
|
| 24 |
'default' => '',
|
| 25 |
),
|
| 26 |
'text' => array(
|
| 27 |
'description' => t('The ad text'),
|
| 28 |
'type' => 'varchar',
|
| 29 |
'length' => 255,
|
| 30 |
'not null' => TRUE,
|
| 31 |
'default' => '',
|
| 32 |
),
|
| 33 |
'beforetext' => array(
|
| 34 |
'description' => t('Text to be displayed before the ad'),
|
| 35 |
'type' => 'varchar',
|
| 36 |
'length' => 255,
|
| 37 |
'not null' => TRUE,
|
| 38 |
'default' => '',
|
| 39 |
),
|
| 40 |
'aftertext' => array(
|
| 41 |
'description' => t('Text to be displayed after the ad'),
|
| 42 |
'type' => 'varchar',
|
| 43 |
'length' => 255,
|
| 44 |
'not null' => TRUE,
|
| 45 |
'default' => '',
|
| 46 |
),
|
| 47 |
'rsstext' => array(
|
| 48 |
'description' => t('The rss ad text'),
|
| 49 |
'type' => 'varchar',
|
| 50 |
'length' => 255,
|
| 51 |
'not null' => TRUE,
|
| 52 |
'default' => '',
|
| 53 |
),
|
| 54 |
'rssbeforetext' => array(
|
| 55 |
'description' => t('Text to be displayed before the rss ad'),
|
| 56 |
'type' => 'varchar',
|
| 57 |
'length' => 255,
|
| 58 |
'not null' => TRUE,
|
| 59 |
'default' => '',
|
| 60 |
),
|
| 61 |
'rssaftertext' => array(
|
| 62 |
'description' => t('Text to be displayed after the rss ad'),
|
| 63 |
'type' => 'varchar',
|
| 64 |
'length' => 255,
|
| 65 |
'not null' => TRUE,
|
| 66 |
'default' => '',
|
| 67 |
),
|
| 68 |
),
|
| 69 |
'primary key' => array('tlid'),
|
| 70 |
);
|
| 71 |
return $schema;
|
| 72 |
}
|
| 73 |
|
| 74 |
function textlinkads_install() {
|
| 75 |
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() {
|
| 83 |
drupal_uninstall_schema('textlinkads');
|
| 84 |
variable_del('textlinkads_inlinks_max_sync_post_id');
|
| 85 |
variable_del('textlinkads_inlinks_last_sync_post_id');
|
| 86 |
}
|
| 87 |
|
| 88 |
function textlinkads_update_1() {
|
| 89 |
textlinkads_check_update();
|
| 90 |
variable_del('textlinkads_ad_data');
|
| 91 |
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 |
}
|