Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | function plugin_install() { |
---|
5 | global $prefixeTable; |
---|
6 | |
---|
7 | /* create table to store filters */ |
---|
8 | pwg_query( |
---|
9 | 'CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'category_filters` ( |
---|
10 | `category_id` smallint(5) unsigned NOT NULL, |
---|
11 | `type` varchar(16) NOT NULL, |
---|
12 | `cond` varchar(16) NULL, |
---|
13 | `value` text |
---|
14 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
---|
15 | ;'); |
---|
16 | |
---|
17 | /* add a collumn to image_category_table */ |
---|
18 | pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` ADD `smart` ENUM("true", "false") NOT NULL DEFAULT "false";'); |
---|
19 | |
---|
20 | /* config parameter */ |
---|
21 | // pwg_query("INSERT INTO `" . CONFIG_TABLE . "` |
---|
22 | // VALUES ('SmartAlbums', '', 'Configuration for SmartAlbums plugin');"); |
---|
23 | } |
---|
24 | |
---|
25 | function plugin_uninstall() { |
---|
26 | global $prefixeTable; |
---|
27 | |
---|
28 | pwg_query('DROP TABLE `' . $prefixeTable . 'category_filters`;'); |
---|
29 | pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` DROP `smart`;'); |
---|
30 | pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = "SmartAlbums";'); |
---|
31 | } |
---|
32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.