Rev | Line | |
---|
[9624] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
[9641] | 4 | // Default configuration |
---|
[11267] | 5 | define( |
---|
| 6 | 'default_config', |
---|
| 7 | serialize(array( |
---|
| 8 | 'icon_color' => 'outline_ff3363.png', |
---|
| 9 | 'icon_color_over' => 'outline_ff7700.png', |
---|
| 10 | )) |
---|
| 11 | ); |
---|
[9641] | 12 | |
---|
[9624] | 13 | // Installation |
---|
[11267] | 14 | function plugin_install() |
---|
| 15 | { |
---|
[10984] | 16 | global $prefixeTable; |
---|
[9624] | 17 | |
---|
[11267] | 18 | pwg_query(" |
---|
| 19 | CREATE TABLE `" . $prefixeTable . "comments_categories` ( |
---|
| 20 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, |
---|
| 21 | `category_id` mediumint(8) unsigned NOT NULL DEFAULT '0', |
---|
| 22 | `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
---|
| 23 | `author` varchar(255) DEFAULT NULL, |
---|
| 24 | `author_id` smallint(5) DEFAULT NULL, |
---|
| 25 | `content` longtext, |
---|
| 26 | `validated` enum('true','false') NOT NULL DEFAULT 'false', |
---|
| 27 | `validation_date` datetime DEFAULT NULL, |
---|
| 28 | PRIMARY KEY (`id`) |
---|
| 29 | ) DEFAULT CHARSET=utf8 |
---|
| 30 | ;"); |
---|
[10984] | 31 | |
---|
[11267] | 32 | pwg_query(" |
---|
| 33 | INSERT INTO " . CONFIG_TABLE . "(param,value,comment) |
---|
| 34 | VALUES( |
---|
| 35 | 'comments_on_albums', |
---|
| 36 | '" . default_config . "', |
---|
| 37 | 'Comments on Albums plugin' |
---|
| 38 | ) |
---|
| 39 | ;"); |
---|
[9624] | 40 | } |
---|
| 41 | |
---|
| 42 | // Uninstallation |
---|
[11267] | 43 | function plugin_uninstall() |
---|
| 44 | { |
---|
[10984] | 45 | global $prefixeTable; |
---|
[9624] | 46 | |
---|
[10984] | 47 | pwg_query("DROP TABLE `" . $prefixeTable . "comments_categories`;"); |
---|
| 48 | pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'comments_on_albums';"); |
---|
[9624] | 49 | } |
---|
| 50 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.