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