-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
62 lines (53 loc) · 1.91 KB
/
extension.driver.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
<?php
Class extension_email_statistics extends Extension{
public function about(){
return array(
'name' => 'Email Statistics',
'version' => '0.1',
'release-date' => '2011-11-26',
'author' => array(
'name' => 'Huib Keemink',
'website' => 'http://www.creativedutchmen.com',
'email' => '[email protected]'
)
);
}
public function install()
{
$query = 'CREATE TABLE IF NOT EXISTS `tbl_email_statistics` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`newsletter_id` int(11) unsigned NOT NULL,
`key` varchar(200) DEFAULT NULL,
`useragent` text DEFAULT NULL,
`ip` varchar(15) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
if(!Symphony::Database()->query($query)) return false;
$query = 'CREATE TABLE IF NOT EXISTS `tbl_email_statistics_opens` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`statistics_id` int(11) unsigned NOT NULL,
`date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
if(!Symphony::Database()->query($query)) return false;
$query = 'CREATE TABLE IF NOT EXISTS `tbl_email_statistics_clicks` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`statistics_id` int(11) unsigned NOT NULL,
`date` datetime DEFAULT NULL,
`url` text DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
if(!Symphony::Database()->query($query)) return false;
return true;
}
public function uninstall()
{
$query = 'DROP TABLE IF EXISTS `tbl_email_statistics`';
if(!Symphony::Database()->query($query)) return false;
$query = 'DROP TABLE IF EXISTS `tbl_email_statistics_clicks`';
if(!Symphony::Database()->query($query)) return false;
$query = 'DROP TABLE IF EXISTS `tbl_email_statistics_opens`';
if(!Symphony::Database()->query($query)) return false;
return true;
}
}