Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | function plugin_install() |
---|
5 | { |
---|
6 | global $prefixeTable; |
---|
7 | |
---|
8 | /* create table to store subscribtions */ |
---|
9 | pwg_query(' |
---|
10 | CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'subscribe_to_comments` ( |
---|
11 | `email` varchar(255) NOT NULL, |
---|
12 | `image_id` mediumint(8) NOT NULL DEFAULT 0, |
---|
13 | `category_id` smallint(5) NOT NULL DEFAULT 0, |
---|
14 | `registration_date` datetime NOT NULL, |
---|
15 | `validated` enum("true", "false") NOT NULL DEFAULT "false", |
---|
16 | UNIQUE KEY `UNIQUE` (`mail`, `image_id`, `category_id`) |
---|
17 | ) DEFAULT CHARSET=utf8 |
---|
18 | ;'); |
---|
19 | |
---|
20 | /* config parameter */ |
---|
21 | // pwg_query(' |
---|
22 | // INSERT INTO `' . CONFIG_TABLE . '` |
---|
23 | // VALUES ( |
---|
24 | // "Subscribe_to_Comments", |
---|
25 | // "'.serialize(array()).'", |
---|
26 | // "Configuration for Subscribe_to_Comments plugin" |
---|
27 | // ) |
---|
28 | // ;'); |
---|
29 | |
---|
30 | } |
---|
31 | |
---|
32 | function plugin_uninstall() |
---|
33 | { |
---|
34 | global $prefixeTable; |
---|
35 | |
---|
36 | /* delete table and config */ |
---|
37 | // pwg_query('DROP TABLE `' . $prefixeTable . 'subscribe_to_comments`;'); |
---|
38 | pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = "Subscribe_to_Comments";'); |
---|
39 | } |
---|
40 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.