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 | `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , |
---|
12 | `email` VARCHAR( 255 ) NOT NULL , |
---|
13 | `image_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT "0", |
---|
14 | `category_id` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT "0", |
---|
15 | `registration_date` DATETIME NOT NULL, |
---|
16 | `validated` ENUM( "true", "false" ) NOT NULL DEFAULT "false", |
---|
17 | UNIQUE KEY `UNIQUE` (`email`, `image_id`, `category_id`) |
---|
18 | ) DEFAULT CHARSET=utf8 |
---|
19 | ;'); |
---|
20 | |
---|
21 | /* config parameter */ |
---|
22 | // pwg_query(' |
---|
23 | // INSERT INTO `' . CONFIG_TABLE . '` |
---|
24 | // VALUES ( |
---|
25 | // "Subscribe_to_Comments", |
---|
26 | // "'.serialize(array()).'", |
---|
27 | // "Configuration for Subscribe_to_Comments plugin" |
---|
28 | // ) |
---|
29 | // ;'); |
---|
30 | |
---|
31 | } |
---|
32 | |
---|
33 | function plugin_uninstall() |
---|
34 | { |
---|
35 | global $prefixeTable; |
---|
36 | |
---|
37 | /* delete table and config */ |
---|
38 | pwg_query('DROP TABLE `' . $prefixeTable . 'subscribe_to_comments`;'); |
---|
39 | // pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = "Subscribe_to_Comments";'); |
---|
40 | } |
---|
41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.