source: extensions/Register_FluxBB/include/upgradedb.inc.php @ 21424

Last change on this file since 21424 was 21424, checked in by Eric, 11 years ago

Next version is 2.5.0 :

  • Compliance with Piwigo 2.5
  • Core code refactory : Plugin's configuration vars are now serialized in database
  • Admin panel refactory : No more tabs
  • Admin panel refactory : Clear and dark administration theme compatibility
  • English language reference review and improved
  • Compliance improved with FluxBB 1.5 - Register_FluxBB is still compatible with 1.2 and 1.4 FluxBB forums
  • Update tr_TR, thanks to : LazBoy
  • Update it_IT, thanks to : Ericnet
  • Update pl_PL, thanks to : K.S.
File size: 1.7 KB
Line 
1<?php
2/**
3 * @author Eric@piwigo.org
4 * 
5 * Upgrade processes for old plugin version
6 * Called from maintain.inc.php on plugin activation
7 *
8 */
9
10if(!defined('REGFLUXBB_PATH'))
11{
12  define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
13}
14
15include_once (REGFLUXBB_PATH.'include/functions.inc.php');
16
17// +----------------------------------------------------------+
18// |       Upgrading database from old plugin versions        |
19// +----------------------------------------------------------+
20
21/* upgrade from 2.4.x to 2.5.0 */
22/* *************************** */
23function upgrade_240_250()
24{
25  global $conf;
26
27  load_language('plugin.lang', REGFLUXBB_PATH);
28
29  $plugin =  RegFluxBB_Infos(REGFLUXBB_PATH);
30  $version = $plugin['version'];
31
32  // Upgrading options - Changing config variables to assoc array
33  // ------------------------------------------------------------
34
35  $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
36
37  $Newconf_RegFluxBB = array(
38    'REGFLUXBB_VERSION' => $version,
39    'FLUXBB_PREFIX'     => $conf_RegFluxBB[0],
40    'FLUXBB_ADMIN'      => $conf_RegFluxBB[1],
41    'FLUXBB_GUEST'      => $conf_RegFluxBB[2],
42    'FLUXBB_DEL_PT'     => $conf_RegFluxBB[3],
43    'FLUXBB_CONFIRM'    => $conf_RegFluxBB[4],
44    'FLUXBB_DETAIL'     => $conf_RegFluxBB[5],
45    'FLUXBB_UAM_LINK'   => $conf_RegFluxBB[6],
46    'FLUXBB_GROUP'      => $conf_RegFluxBB[7]
47  );
48
49  $update_conf = serialize($Newconf_RegFluxBB);
50
51  $q = '
52DELETE FROM '.CONFIG_TABLE.'
53WHERE param="Register_FluxBB" LIMIT 1
54;';
55
56  pwg_query($q);
57
58  $q = '
59INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
60VALUES ("Register_FluxBB","'.pwg_db_real_escape_string($update_conf).'","Register_FluxBB parameters")
61  ;';
62
63  pwg_query($q);
64}
65?>
Note: See TracBrowser for help on using the repository browser.