Last change
on this file since 32524 was
30100,
checked in by sarybe, 10 years ago
|
[Thumbnail_Tooltip] Bug fix for html and double quotes in comment
|
File size:
1.1 KB
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | function plugin_install() |
---|
10 | |
---|
11 | { |
---|
12 | |
---|
13 | include(dirname(__FILE__).'/admin/config_default.inc.php'); |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | $query = ' |
---|
18 | |
---|
19 | INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
20 | |
---|
21 | VALUES ("thumbnail_tooltip" , "'.addslashes(serialize($config_default)).'" , "Thumbnail Tooltip plugin parameters");'; |
---|
22 | |
---|
23 | pwg_query($query); |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';'; |
---|
28 | |
---|
29 | $result = array_from_query($query, 'Field'); |
---|
30 | |
---|
31 | if (!in_array('thumbnail_tooltip', $result)) |
---|
32 | |
---|
33 | { |
---|
34 | |
---|
35 | pwg_query('ALTER TABLE '.HISTORY_TABLE.' ADD `thumbnail_tooltip` ENUM(\'true\', \'false\') NULL DEFAULT NULL'); |
---|
36 | |
---|
37 | } |
---|
38 | |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | function plugin_uninstall() |
---|
44 | |
---|
45 | { |
---|
46 | |
---|
47 | $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="thumbnail_tooltip" LIMIT 1;'; |
---|
48 | |
---|
49 | pwg_query($query); |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';'; |
---|
54 | |
---|
55 | $result = array_from_query($query, 'Field'); |
---|
56 | |
---|
57 | if (in_array('thumbnail_tooltip', $result)) |
---|
58 | |
---|
59 | { |
---|
60 | |
---|
61 | $q = ' ALTER TABLE '.HISTORY_TABLE.' DROP `thumbnail_tooltip`'; |
---|
62 | |
---|
63 | pwg_query( $q ); |
---|
64 | |
---|
65 | } |
---|
66 | |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.