1 | <?php |
---|
2 | |
---|
3 | if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
4 | //ini_set('error_reporting', E_ALL); |
---|
5 | //ini_set('display_errors', true); |
---|
6 | |
---|
7 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
8 | include_once (REGFLUXBB_PATH.'include/constants.php'); |
---|
9 | include_once (REGFLUXBB_PATH.'include/functions.inc.php'); |
---|
10 | |
---|
11 | |
---|
12 | function plugin_install() |
---|
13 | { |
---|
14 | global $prefixeTable; |
---|
15 | |
---|
16 | $q = ' |
---|
17 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
18 | VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB") |
---|
19 | ;'; |
---|
20 | |
---|
21 | pwg_query($q); |
---|
22 | |
---|
23 | $q = " |
---|
24 | CREATE 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', |
---|
27 | PRIMARY 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 | |
---|
36 | function 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 | conf_update_param('Register_FluxBB', pwg_db_real_escape_string($upgrade_RFBB)); |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | function plugin_uninstall() |
---|
56 | { |
---|
57 | global $conf; |
---|
58 | |
---|
59 | if (isset($conf['Register_FluxBB'])) |
---|
60 | { |
---|
61 | $q = ' |
---|
62 | DELETE FROM '.CONFIG_TABLE.' |
---|
63 | WHERE param="Register_FluxBB" LIMIT 1 |
---|
64 | ;'; |
---|
65 | |
---|
66 | pwg_query($q); |
---|
67 | } |
---|
68 | |
---|
69 | $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';'; |
---|
70 | pwg_query( $q ); |
---|
71 | |
---|
72 | } |
---|
73 | ?> |
---|