Changeset 21424 for extensions/Register_FluxBB/maintain.inc.php
- Timestamp:
- Mar 10, 2013, 2:16:32 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/maintain.inc.php
r17457 r21424 1 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); 2 if(!defined('REGFLUXBB_PATH')) 3 { 4 define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 5 } 6 6 7 7 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 8 include_once (REGFLUXBB_PATH.'include/constants.php');9 8 include_once (REGFLUXBB_PATH.'include/functions.inc.php'); 10 11 9 12 10 function plugin_install() 13 11 { 14 global $prefixeTable ;12 global $prefixeTable, $conf; 15 13 14 // Set current plugin version in config table 15 $plugin = RegFluxBB_Infos(REGFLUXBB_PATH); 16 $version = $plugin['version']; 17 18 // Default global parameters for RegisterFluxBB conf 19 // ------------------------------------------------- 20 $defaultRegFluxBB = array( 21 'REGFLUXBB_VERSION' => $version, 22 'FLUXBB_PREFIX' => '', 23 'FLUXBB_ADMIN' => '', 24 'FLUXBB_GUEST' => '', 25 'FLUXBB_DEL_PT' => 'false', 26 'FLUXBB_CONFIRM' => 'false', 27 'FLUXBB_DETAIL' => 'false', 28 'FLUXBB_UAM_LINK' => 'false', 29 'FLUXBB_GROUP' => '' 30 ); 31 32 // Create RegisterFluxBB conf if not already exists 33 // ------------------------------------------------ 34 $query = ' 35 SELECT param 36 FROM '.CONFIG_TABLE.' 37 WHERE param = "Register_FluxBB" 38 ;'; 39 $count = pwg_db_num_rows(pwg_query($query)); 40 41 if ($count == 0) 42 { 43 $q = ' 44 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 45 VALUES ("Register_FluxBB","'.pwg_db_real_escape_string(serialize($defaultRegFluxBB)).'","Register_FluxBB parameters") 46 ;'; 47 pwg_query($q); 48 } 49 50 // Create relation table between FluxBB and Piwigo 51 // ----------------------------------------------- 16 52 $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', 53 CREATE TABLE IF NOT EXISTS '.Register_FluxBB_ID_TABLE.' ( 54 id_user_pwg smallint(5) NOT NULL default "0", 55 id_user_FluxBB int(10) NOT NULL default "0", 27 56 PRIMARY KEY (id_user_pwg), 28 57 KEY id_user_pwg (id_user_pwg, id_user_FluxBB) 29 58 ) 30 ; ";59 ;'; 31 60 32 61 pwg_query($q); … … 42 71 regfluxbb_obsolete_files(); 43 72 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])) 73 include_once (REGFLUXBB_PATH.'include/upgradedb.inc.php'); 74 75 /* Database upgrade */ 76 /* **************** */ 77 $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 78 79 if (isset($conf_RegFluxBB[0]) and strpos($conf_RegFluxBB[0],"{") === false) /* Version < 2.5.0 */ 48 80 { 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'; 81 upgrade_240_250(); 82 } 50 83 51 conf_update_param('Register_FluxBB', pwg_db_real_escape_string($upgrade_RFBB)); 52 } 84 /* Update plugin version number in #_config table */ 85 /* and check consistency of #_plugins table */ 86 /* ********************************************** */ 87 RegFluxBB_version_update(); 88 89 /* Reload plugin parameters */ 90 /* ************************ */ 91 load_conf_from_db('param like \'Register_FluxBB\''); 53 92 } 54 93 … … 66 105 pwg_query($q); 67 106 } 68 107 69 108 $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';'; 70 109 pwg_query( $q );
Note: See TracChangeset
for help on using the changeset viewer.