-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdisqus.install
93 lines (88 loc) · 2.04 KB
/
disqus.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @file
* Provides any required installation or upgrade path requirements.
*/
/**
* Implementation of hook_schema().
*/
function disqus_schema() {
$schema = array();
$schema['disqus'] = array(
'fields' => array(
'did' => array(
'type' => 'serial',
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('did'),
'indexes' => array(
'nid' => array('nid'),
'status' => array('status'),
),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function disqus_uninstall() {
$variables = array(
'disqus_combination_widget_colortheme',
'disqus_combination_widget_defaulttabview',
'disqus_combination_widget_excerpt_length',
'disqus_combination_widget_hide_mods',
'disqus_combination_widget_items',
'disqus_developer',
'disqus_domain',
'disqus_inherit_login',
'disqus_localization',
'disqus_location',
'disqus_logo',
'disqus_nodetypes',
'disqus_popular_threads_items',
'disqus_publickey',
'disqus_recent_comments_avatarsize',
'disqus_recent_comments_excerpt_length',
'disqus_recent_comments_items',
'disqus_recent_comments_showavatars',
'disqus_secretkey',
'disqus_sso',
'disqus_top_commenters_avatarsize',
'disqus_top_commenters_hide_mods',
'disqus_top_commenters_items',
'disqus_top_commenters_showavatars',
'disqus_use_site_logo',
'disqus_userapikey',
'disqus_weight',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}
/**
* Updates from Drupal 6 to 7.
*/
function disqus_update_7000() {
// Nothing.
}
/**
* Updates Disqus with support for toggling comments per node.
*/
function disqus_update_7001() {
if (!db_table_exists('disqus')) {
drupal_install_schema('disqus');
}
}