source: extensions/lightbox/maintain.inc.php @ 29080

Last change on this file since 29080 was 3609, checked in by patdenice, 15 years ago

Convert all php and tpl files in Unix format for my plugins.

File size: 979 bytes
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5function plugin_install()
6{
7  include(dirname(__FILE__).'/admin/config_default.inc.php');
8
9  $query = '
10INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
11VALUES ("lightbox" , "'.addslashes(serialize($config_default)).'" , "Lightbox plugin parameters");';
12  pwg_query($query);
13
14  $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';';
15  $result = array_from_query($query, 'Field');
16  if (!in_array('lightbox', $result))
17  {
18    pwg_query('ALTER TABLE '.HISTORY_TABLE.' ADD `lightbox` ENUM(\'true\', \'false\') NULL DEFAULT NULL');
19  }
20}
21
22function plugin_uninstall()
23{
24  $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="lightbox" LIMIT 1;';
25  pwg_query($query);
26
27  $query = 'SHOW FULL COLUMNS FROM ' . HISTORY_TABLE . ';';
28  $result = array_from_query($query, 'Field');
29  if (in_array('lightbox', $result))
30  {
31    $q = ' ALTER TABLE '.HISTORY_TABLE.' DROP `lightbox`';
32    pwg_query( $q );
33  }
34}
35
36?>
Note: See TracBrowser for help on using the repository browser.