source: extensions/Comments_on_Albums/maintain.inc.php @ 14328

Last change on this file since 14328 was 11267, checked in by mistic100, 13 years ago

big code cleaning

File size: 1.2 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4// Default configuration
5define(
6  'default_config', 
7  serialize(array(
8    'icon_color' => 'outline_ff3363.png',
9    'icon_color_over' => 'outline_ff7700.png',
10    ))
11  );
12
13// Installation
14function plugin_install() 
15{
16  global $prefixeTable;
17
18  pwg_query("
19CREATE 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;");
31 
32  pwg_query("
33INSERT INTO " . CONFIG_TABLE . "(param,value,comment)
34VALUES(
35  'comments_on_albums',
36  '" . default_config . "',
37  'Comments on Albums plugin'
38)
39;");
40}
41
42// Uninstallation
43function plugin_uninstall() 
44{
45  global $prefixeTable;
46
47  pwg_query("DROP TABLE `" . $prefixeTable . "comments_categories`;");
48  pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'comments_on_albums';");
49}
50?>
Note: See TracBrowser for help on using the repository browser.