Rev | Line | |
---|
[27650] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | |
---|
| 5 | function plugin_install() |
---|
| 6 | { |
---|
| 7 | include(dirname(__FILE__).'/admin/config_default.inc.php'); |
---|
| 8 | |
---|
| 9 | $query = ' |
---|
| 10 | INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
| 11 | VALUES ("thumbnail_tooltip" , "'.addslashes(serialize($config_default)).'" , "Thumbnail Tooltip plugin parameters");'; |
---|
| 12 | pwg_query($query); |
---|
| 13 | |
---|
| 14 | $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';'; |
---|
| 15 | $result = array_from_query($query, 'Field'); |
---|
| 16 | if (!in_array('thumbnail_tooltip', $result)) |
---|
| 17 | { |
---|
| 18 | pwg_query('ALTER TABLE '.HISTORY_TABLE.' ADD `thumbnail_tooltip` ENUM(\'true\', \'false\') NULL DEFAULT NULL'); |
---|
| 19 | } |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | function plugin_uninstall() |
---|
| 23 | { |
---|
| 24 | $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="thumbnail_tooltip" LIMIT 1;'; |
---|
| 25 | pwg_query($query); |
---|
| 26 | |
---|
| 27 | $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';'; |
---|
| 28 | $result = array_from_query($query, 'Field'); |
---|
| 29 | if (in_array('thumbnail_tooltip', $result)) |
---|
| 30 | { |
---|
| 31 | $q = ' ALTER TABLE '.HISTORY_TABLE.' DROP `thumbnail_tooltip`'; |
---|
| 32 | pwg_query( $q ); |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.