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