source: extensions/Register_FluxBB/tags/2.4.0/maintain.inc.php @ 10627

Last change on this file since 10627 was 9885, checked in by Eric, 13 years ago

Piwigo 2.2 compliance (nicer URL for admin panel)

  • Property svn:eol-style set to LF
File size: 1.8 KB
Line 
1<?php
2
3if(!defined("REGFLUXBB_PATH")) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.REGFLUXBB_DIR.'/');
4//ini_set('error_reporting', E_ALL);
5//ini_set('display_errors', true);
6
7include_once (PHPWG_ROOT_PATH.'/include/constants.php');
8include_once (REGFLUXBB_PATH.'include/constants.php');
9include_once (REGFLUXBB_PATH.'include/functions.inc.php');
10
11
12function plugin_install()
13{
14  global $prefixeTable;
15
16  $q = '
17INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
18VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
19;';
20   
21  pwg_query($q);
22 
23  $q = "
24CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
25  id_user_pwg smallint(5) NOT NULL default '0',
26  id_user_FluxBB int(10) NOT NULL default '0',
27PRIMARY KEY  (id_user_pwg),
28  KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
29)
30;";
31
32  pwg_query($q);
33
34}
35
36function plugin_activate()
37{
38  global $conf;
39
40/* Cleaning obsolete files */
41/* *********************** */
42  regfluxbb_obsolete_files();
43
44/* Check version < 2.3.0 */
45  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
46 
47  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
48  {
49    $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0';
50               
51    $query = '
52UPDATE '.CONFIG_TABLE.'
53SET value="'.$upgrade_RFBB.'"
54WHERE param="Register_FluxBB"
55LIMIT 1
56;';
57                pwg_query($query);
58  }
59}
60
61function plugin_uninstall()
62{
63  global $conf;
64
65  if (isset($conf['Register_FluxBB']))
66  {
67    $q = '
68DELETE FROM '.CONFIG_TABLE.'
69WHERE param="Register_FluxBB" LIMIT 1
70;';
71
72    pwg_query($q);
73  }
74 
75  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
76  pwg_query( $q );
77
78}
79?>
Note: See TracBrowser for help on using the repository browser.