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( |
---|
| 6 | 'nb_messages' => 5, |
---|
| 7 | 'free_name' => false, |
---|
| 8 | ))); |
---|
| 9 | |
---|
| 10 | // Installation |
---|
| 11 | function plugin_install() { |
---|
| 12 | global $prefixeTable; |
---|
| 13 | |
---|
| 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` ) |
---|
[9786] | 20 | ) DEFAULT CHARSET=utf8;"); |
---|
[9421] | 21 | |
---|
| 22 | pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('admin_messages', '" . default_config . "', 'Parametres du plugin Admin Messages');"); |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | // Désinstallation |
---|
| 26 | function plugin_uninstall() { |
---|
| 27 | global $prefixeTable; |
---|
| 28 | |
---|
| 29 | pwg_query("DROP TABLE `" . $prefixeTable . "admin_messages`;"); |
---|
| 30 | pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'admin_messages';"); |
---|
| 31 | } |
---|
| 32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.