source: extensions/Mail_supervisor/maintain.inc.php @ 4040

Revision 4040, 3.1 KB checked in by cljosse, 10 years ago (diff)

[mail_supervisor] insert multi tabs

Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23if  (!defined('PHPWG_ROOT_PATH')) 
24{
25  die('Hacking attempt!');
26}
27
28if(!defined("MAIL_SUPERV_PATH"))
29  define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
30
31include_once (MAIL_SUPERV_PATH.'include/constants.php');
32include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
33
34function plugin_install()
35{
36
37// efface free mail
38$q = '
39  SELECT  count(`id`) as total   FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail"   ;';
40     $plugs = mysql_fetch_array(pwg_query($q));
41 $nb= $plugs['total'];
42
43  if (count($nb)>=1) { 
44 /*          $q = '
45UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE `id` LIKE "free_mail"';
46        pwg_query($q);
47   pwg_query( $q );*/
48      $q = '
49      DELETE FROM '.PLUGINS_TABLE.'
50      WHERE `id` LIKE "free_mail"
51    ;';
52    pwg_query($q);             
53        $q = 'DROP TABLE IF EXISTS '.FREE_MAIL_TABLE.';';
54                 
55   pwg_query( $q );
56      $q = '
57      DELETE FROM '.CONFIG_TABLE.'
58      WHERE param="free_mail"
59    ;';
60    pwg_query($q);
61       
62       
63               
64 }
65
66
67         
68
69               
70 
71  $q = '
72    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
73    VALUES ("mail_superv","on,on,off ,off,off","Parametres du plugin Mail superviseur")
74  ;';
75  pwg_query($q);
76
77
78vérif_base();
79
80}
81
82
83
84function plugin_uninstall()
85{
86  global $conf;
87
88  if (isset($conf['mail_superv']))
89  {
90
91    $q = '
92      DELETE FROM '.CONFIG_TABLE.'
93      WHERE param="mail_superv"
94    ;';
95
96    pwg_query($q);
97
98
99
100  $q = 'DROP TABLE '.MAIL_SUPERV_TABLE.';';
101   pwg_query( $q );
102   }
103 
104}
105
106
107
108?>
Note: See TracBrowser for help on using the repository browser.