source: extensions/SmartAlbums/maintain.inc.php @ 11333

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

clean code, use TokenInput

File size: 1012 bytes
RevLine 
[10871]1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4function plugin_install() {
5        global $prefixeTable;
6
7  /* create table to store filters */
[11333]8        pwg_query(
9'CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'category_filters` (
10  `category_id` smallint(5) unsigned NOT NULL,
11  `type` varchar(16) NOT NULL,
12  `cond` varchar(16) NULL,
13  `value` text
14) ENGINE=MyISAM DEFAULT CHARSET=utf8
15;');
[10871]16 
17  /* add a collumn to image_category_table */
[11333]18  pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` ADD `smart` ENUM("true", "false") NOT NULL DEFAULT "false";');
[10871]19     
20  /* config parameter */
21  // pwg_query("INSERT INTO `" . CONFIG_TABLE . "`
22    // VALUES ('SmartAlbums', '', 'Configuration for SmartAlbums plugin');");
23}
24
25function plugin_uninstall() {
26        global $prefixeTable;
27 
[11333]28  pwg_query('DROP TABLE `' . $prefixeTable . 'category_filters`;');
29  pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` DROP `smart`;');
30  pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = "SmartAlbums";');
[10871]31}
32?>
Note: See TracBrowser for help on using the repository browser.