-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathupd.disqus.php
130 lines (103 loc) · 2.79 KB
/
upd.disqus.php
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ExpressionEngine - by EllisLab
*
* @package ExpressionEngine
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
* @license http://expressionengine.com/user_guide/license.html
* @link http://expressionengine.com
* @since Version 2.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* Disqus Module Install/Update File
*
* @package ExpressionEngine
* @subpackage Addons
* @category Module
* @author Marc Tanis
* @link
*/
class Disqus_upd {
public $version = '1.0';
private $EE;
/**
* Constructor
*/
public function __construct()
{
$this->EE =& get_instance();
}
// ----------------------------------------------------------------
/**
* Installation Method
*
* @return boolean TRUE
*/
public function install()
{
$mod_data = array(
'module_name' => 'Disqus',
'module_version' => $this->version,
'has_cp_backend' => "y",
'has_publish_fields' => 'n'
);
$this->EE->db->insert('modules', $mod_data);
$data = array(
'class' => 'Disqus' ,
'method' => 'sync'
);
$this->EE->db->insert('actions', $data);
$this->EE->load->dbforge();
/**
* In order to setup your custom tables, uncomment the line above, and
* start adding them below!
*/
$this->EE->db->query("CREATE TABLE IF NOT EXISTS `".$this->EE->db->dbprefix('disqus_settings')."` (
`id` INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` INT(6) NOT NULL,
`secret_key` varchar(100) NOT NULL,
`shortname` varchar(100) NOT NULL,
`last_sync` int(12) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`site_id`));");
return TRUE;
}
// ----------------------------------------------------------------
/**
* Uninstall
*
* @return boolean TRUE
*/
public function uninstall()
{
$mod_id = $this->EE->db->select('module_id')
->get_where('modules', array(
'module_name' => 'Disqus'
))->row('module_id');
$this->EE->db->where('module_id', $mod_id)
->delete('module_member_groups');
$this->EE->db->where('module_name', 'Disqus')
->delete('modules');
$this->EE->load->dbforge();
$this->EE->db->query("DROP TABLE IF EXISTS ".$this->EE->db->dbprefix('disqus_settings'));
// Delete your custom tables & any ACT rows
// you have in the actions table
return TRUE;
}
// ----------------------------------------------------------------
/**
* Module Updater
*
* @return boolean TRUE
*/
public function update($current = '')
{
// If you have updates, drop 'em in here.
return TRUE;
}
}
/* End of file upd.disqus.php */
/* Location: /system/expressionengine/third_party/disqus/upd.disqus.php */