1 | <?php |
---|
2 | |
---|
3 | if(!defined("REGFLUXBB_DIR")) define('REGFLUXBB_DIR' , basename(dirname(__FILE__))); |
---|
4 | if(!defined("REGFLUXBB_PATH")) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.REGFLUXBB_DIR.'/'); |
---|
5 | //ini_set('error_reporting', E_ALL); |
---|
6 | //ini_set('display_errors', true); |
---|
7 | |
---|
8 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
9 | include_once (REGFLUXBB_PATH.'include/constants.php'); |
---|
10 | include_once (REGFLUXBB_PATH.'include/functions.inc.php'); |
---|
11 | |
---|
12 | |
---|
13 | function plugin_install() |
---|
14 | { |
---|
15 | global $prefixeTable; |
---|
16 | |
---|
17 | $q = ' |
---|
18 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
19 | VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB") |
---|
20 | ;'; |
---|
21 | |
---|
22 | pwg_query($q); |
---|
23 | |
---|
24 | $q = " |
---|
25 | CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." ( |
---|
26 | id_user_pwg smallint(5) NOT NULL default '0', |
---|
27 | id_user_FluxBB int(10) NOT NULL default '0', |
---|
28 | PRIMARY KEY (id_user_pwg), |
---|
29 | KEY id_user_pwg (id_user_pwg, id_user_FluxBB) |
---|
30 | ) |
---|
31 | ;"; |
---|
32 | |
---|
33 | pwg_query($q); |
---|
34 | |
---|
35 | } |
---|
36 | |
---|
37 | function plugin_activate() |
---|
38 | { |
---|
39 | global $conf; |
---|
40 | |
---|
41 | /* Cleaning obsolete files */ |
---|
42 | /* *********************** */ |
---|
43 | regfluxbb_obsolete_files(); |
---|
44 | } |
---|
45 | |
---|
46 | function plugin_uninstall() |
---|
47 | { |
---|
48 | global $conf; |
---|
49 | |
---|
50 | if (isset($conf['Register_FluxBB'])) |
---|
51 | { |
---|
52 | $q = ' |
---|
53 | DELETE FROM '.CONFIG_TABLE.' |
---|
54 | WHERE param="Register_FluxBB" LIMIT 1 |
---|
55 | ;'; |
---|
56 | |
---|
57 | pwg_query($q); |
---|
58 | } |
---|
59 | |
---|
60 | $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';'; |
---|
61 | pwg_query( $q ); |
---|
62 | |
---|
63 | } |
---|
64 | ?> |
---|