[3531] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | |
---|
| 5 | function plugin_install() |
---|
| 6 | { |
---|
| 7 | global $prefixeTable, $conf; |
---|
| 8 | |
---|
| 9 | $query = 'SHOW TABLES LIKE "' . $prefixeTable . 'flash_gallery"'; |
---|
| 10 | $result = pwg_query($query); |
---|
| 11 | if (!mysql_fetch_row($result)) |
---|
| 12 | { |
---|
| 13 | $q = 'CREATE TABLE `' . $prefixeTable . 'flash_gallery` ( |
---|
| 14 | `id` smallint(5) NOT NULL, |
---|
| 15 | `pos` smallint(5) NOT NULL, |
---|
| 16 | `name` text NOT NULL, |
---|
| 17 | `descr` varchar(255) default NULL, |
---|
| 18 | `type` varchar(255) NOT NULL, |
---|
| 19 | `datas` longtext default NULL, |
---|
| 20 | `ext_datas` longtext default NULL, |
---|
| 21 | `users` varchar(255) default NULL, |
---|
| 22 | `groups` varchar(255) default NULL, |
---|
| 23 | `show_title` enum(\'true\',\'false\') NOT NULL, |
---|
| 24 | `on_home` enum(\'true\',\'false\') NOT NULL, |
---|
| 25 | `on_home_global` text NOT NULL, |
---|
| 26 | `on_cats` enum(\'true\',\'false\') NOT NULL, |
---|
| 27 | `cats` longtext default NULL, |
---|
| 28 | `recurs_cats` enum(\'true\',\'false\') NOT NULL, |
---|
| 29 | `replace_thumb` enum(\'true\',\'false\') NOT NULL, |
---|
| 30 | `replace_cats` enum(\'true\',\'false\') NOT NULL, |
---|
| 31 | `height` smallint(9) default NULL, |
---|
| 32 | `transparent` enum(\'true\',\'false\') NOT NULL, |
---|
| 33 | `fullscreen` enum(\'true\',\'false\') NOT NULL, |
---|
| 34 | `bgcolor` varchar(7) default NULL, |
---|
[3663] | 35 | `maxcomment` smallint(9) default 0, |
---|
[3531] | 36 | |
---|
| 37 | PRIMARY KEY (`id`), |
---|
| 38 | KEY `on_home` (`on_home`), |
---|
| 39 | KEY `on_cats` (`on_cats`) |
---|
| 40 | ) DEFAULT CHARSET=utf8;'; |
---|
| 41 | pwg_query($q); |
---|
| 42 | |
---|
| 43 | // Main Bloc insertion |
---|
[3663] | 44 | $q = "INSERT INTO `" . $prefixeTable . "flash_gallery` (`id`, `pos`, `name`, `descr`, `type`, `datas`, `ext_datas`,`users`, `groups`, `show_title`, `on_home`, `on_home_global`, `on_cats`, `cats`, `recurs_cats`, `replace_thumb`, `replace_cats`, `height`, `transparent`, `fullscreen`, `bgcolor`, `maxcomment`) |
---|
| 45 | VALUES (0, 1, 'MainBlock', NULL, 'MainBlock', NULL, NULL, 'guest,generic,normal,admin,webmaster', NULL, 'true', 'true', 'global', 'true', NULL, 'false', 'false', 'false', NULL, 'false', 'false', '#FFFFFF', '0');"; |
---|
[3531] | 46 | pwg_query($q); |
---|
| 47 | |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | function plugin_activate() |
---|
| 53 | { |
---|
| 54 | global $prefixeTable; |
---|
| 55 | |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | function plugin_uninstall() |
---|
| 59 | { |
---|
| 60 | global $prefixeTable; |
---|
| 61 | |
---|
| 62 | $q = 'DROP TABLE ' . $prefixeTable . 'flash_gallery;'; |
---|
| 63 | pwg_query($q); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | ?> |
---|