source: extensions/AddInfo/maintain.inc.php @ 28145

Last change on this file since 28145 was 21631, checked in by ddtddt, 12 years ago

[extensions] - AddInfo - change to 2.5 - chose emplacement imfo

File size: 1.0 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5function plugin_install()
6{
7    global $prefixeTable;
8
9if (!defined('ADDINFO_TABLE')) define('ADDINFO_TABLE', $prefixeTable.'AddInfo_images');
10        $query = "CREATE TABLE IF NOT EXISTS ". ADDINFO_TABLE ." (
11id SMALLINT( 5 ) UNSIGNED NOT NULL ,
12info1 VARCHAR( 255 ) NOT NULL ,
13info2 VARCHAR( 255 ) NOT NULL ,
14info3 VARCHAR( 255 ) NOT NULL ,
15PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
16        $result = pwg_query($query);
17       
18        $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("AddInfo","datecreate","AddInfo");';
19    pwg_query($query);
20
21}
22
23function plugin_activate()
24{
25  global $conf;
26  if (empty($conf['AddInfo']))
27  {
28        $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("AddInfo","datecreate","AddInfo");';
29    pwg_query($query);
30  }
31}
32
33function plugin_uninstall()
34{
35        global $prefixeTable;
36
37        $q = 'DROP TABLE ' . $prefixeTable . 'AddInfo_images;';
38    pwg_query($q);
39       
40        $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="AddInfo" LIMIT 1;';
41    pwg_query($q);
42}
43
44
45?>
Note: See TracBrowser for help on using the repository browser.