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

Last change on this file since 10903 was 10871, checked in by mistic100, 14 years ago

repository for SmartAlbums

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