Rev | Line | |
---|
[9421] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | // Configuration par défaut |
---|
| 5 | define('default_config' , serialize(array( |
---|
[12356] | 6 | 'nb_messages' => 5, |
---|
| 7 | 'free_name' => false, |
---|
[9421] | 8 | ))); |
---|
| 9 | |
---|
| 10 | // Installation |
---|
| 11 | function plugin_install() { |
---|
[12356] | 12 | global $prefixeTable; |
---|
[9421] | 13 | |
---|
[12356] | 14 | pwg_query("CREATE TABLE `" . $prefixeTable . "admin_messages` ( |
---|
| 15 | `id` INT NOT NULL AUTO_INCREMENT , |
---|
| 16 | `add_date` DATETIME NOT NULL , |
---|
| 17 | `author` VARCHAR( 255 ) NOT NULL , |
---|
| 18 | `content` TEXT NULL , |
---|
| 19 | PRIMARY KEY ( `id` ) |
---|
| 20 | ) DEFAULT CHARSET=utf8;"); |
---|
| 21 | |
---|
| 22 | pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('admin_messages', '" . default_config . "', 'Parametres du plugin Admin Messages');"); |
---|
[9421] | 23 | } |
---|
| 24 | |
---|
| 25 | // Désinstallation |
---|
| 26 | function plugin_uninstall() { |
---|
[12356] | 27 | global $prefixeTable; |
---|
[9421] | 28 | |
---|
[12356] | 29 | pwg_query("DROP TABLE `" . $prefixeTable . "admin_messages`;"); |
---|
| 30 | pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'admin_messages';"); |
---|
[9421] | 31 | } |
---|
| 32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.