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, |
---|
35 | |
---|
36 | PRIMARY KEY (`id`), |
---|
37 | KEY `on_home` (`on_home`), |
---|
38 | KEY `on_cats` (`on_cats`) |
---|
39 | ) DEFAULT CHARSET=utf8;'; |
---|
40 | pwg_query($q); |
---|
41 | |
---|
42 | // Main Bloc insertion |
---|
43 | $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`) |
---|
44 | 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');"; |
---|
45 | pwg_query($q); |
---|
46 | |
---|
47 | } |
---|
48 | |
---|
49 | } |
---|
50 | |
---|
51 | function plugin_activate() |
---|
52 | { |
---|
53 | global $prefixeTable; |
---|
54 | |
---|
55 | } |
---|
56 | |
---|
57 | function plugin_uninstall() |
---|
58 | { |
---|
59 | global $prefixeTable; |
---|
60 | |
---|
61 | $q = 'DROP TABLE ' . $prefixeTable . 'flash_gallery;'; |
---|
62 | pwg_query($q); |
---|
63 | } |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | ?> |
---|