1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | function plugin_install() |
---|
6 | { |
---|
7 | global $prefixeTable; |
---|
8 | |
---|
9 | $q = 'CREATE TABLE ' . $prefixeTable . 'meta( |
---|
10 | id SMALLINT( 5 ) UNSIGNED NOT NULL , |
---|
11 | metaname VARCHAR( 255 ) NOT NULL , |
---|
12 | metaval lONGTEXT NOT NULL , |
---|
13 | metatype VARCHAR( 255 ) NOT NULL , |
---|
14 | PRIMARY KEY (id))DEFAULT CHARSET=utf8;'; |
---|
15 | pwg_query($q); |
---|
16 | |
---|
17 | $q = ' |
---|
18 | INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (1,"author","","name");'; |
---|
19 | pwg_query($q); |
---|
20 | |
---|
21 | $q = ' |
---|
22 | INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (2,"keywords","","name");'; |
---|
23 | pwg_query($q); |
---|
24 | |
---|
25 | $q = ' |
---|
26 | INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (3,"Description","","name");'; |
---|
27 | pwg_query($q); |
---|
28 | |
---|
29 | $q = ' |
---|
30 | INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (4,"robots","follow","name");'; |
---|
31 | pwg_query($q); |
---|
32 | |
---|
33 | if (!defined('meta_img_TABLE')) define('meta_img_TABLE', $prefixeTable.'meta_img'); |
---|
34 | $query = "CREATE TABLE IF NOT EXISTS ". meta_img_TABLE ." ( |
---|
35 | id SMALLINT( 5 ) UNSIGNED NOT NULL , |
---|
36 | metaKeyimg VARCHAR( 255 ) NOT NULL , |
---|
37 | PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; |
---|
38 | $result = pwg_query($query); |
---|
39 | |
---|
40 | if (!defined('meta_cat_TABLE')) define('meta_cat_TABLE', $prefixeTable.'meta_cat'); |
---|
41 | $query = "CREATE TABLE IF NOT EXISTS ". meta_cat_TABLE ." ( |
---|
42 | id SMALLINT( 5 ) UNSIGNED NOT NULL , |
---|
43 | metaKeycat VARCHAR( 255 ) NOT NULL , |
---|
44 | PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; |
---|
45 | $result = pwg_query($query); |
---|
46 | |
---|
47 | $majm='meta 2.0.5'; |
---|
48 | |
---|
49 | $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("'.$majm.'",1,"MAJ meta");'; |
---|
50 | pwg_query($query); |
---|
51 | } |
---|
52 | |
---|
53 | function plugin_uninstall() |
---|
54 | { |
---|
55 | |
---|
56 | $majm='meta 2.0.5'; |
---|
57 | global $prefixeTable; |
---|
58 | |
---|
59 | $q = 'DROP TABLE ' . $prefixeTable . 'meta;'; |
---|
60 | pwg_query($q); |
---|
61 | |
---|
62 | $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="'.$majm.'" LIMIT 1;'; |
---|
63 | pwg_query($q); |
---|
64 | |
---|
65 | $q = 'DROP TABLE ' . $prefixeTable . 'meta_img;'; |
---|
66 | pwg_query($q); |
---|
67 | |
---|
68 | $q = 'DROP TABLE ' . $prefixeTable . 'meta_cat;'; |
---|
69 | pwg_query($q); |
---|
70 | } |
---|
71 | |
---|
72 | |
---|
73 | ?> |
---|