Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | function plugin_install() |
---|
6 | { |
---|
7 | global $prefixeTable; |
---|
8 | |
---|
9 | if (!defined('ADDINFO_TABLE')) define('ADDINFO_TABLE', $prefixeTable.'AddInfo_images'); |
---|
10 | $query = "CREATE TABLE IF NOT EXISTS ". ADDINFO_TABLE ." ( |
---|
11 | id SMALLINT( 5 ) UNSIGNED NOT NULL , |
---|
12 | info1 VARCHAR( 255 ) NOT NULL , |
---|
13 | info2 VARCHAR( 255 ) NOT NULL , |
---|
14 | info3 VARCHAR( 255 ) NOT NULL , |
---|
15 | PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; |
---|
16 | $result = pwg_query($query); |
---|
17 | |
---|
18 | $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("AddInfo","datecreate","AddInfo");'; |
---|
19 | pwg_query($query); |
---|
20 | |
---|
21 | } |
---|
22 | |
---|
23 | function plugin_activate() |
---|
24 | { |
---|
25 | global $conf; |
---|
26 | if (empty($conf['AddInfo'])) |
---|
27 | { |
---|
28 | $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("AddInfo","datecreate","AddInfo");'; |
---|
29 | pwg_query($query); |
---|
30 | } |
---|
31 | } |
---|
32 | |
---|
33 | function plugin_uninstall() |
---|
34 | { |
---|
35 | global $prefixeTable; |
---|
36 | |
---|
37 | $q = 'DROP TABLE ' . $prefixeTable . 'AddInfo_images;'; |
---|
38 | pwg_query($q); |
---|
39 | |
---|
40 | $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="AddInfo" LIMIT 1;'; |
---|
41 | pwg_query($q); |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.