Ignore:
Timestamp:
Mar 3, 2013, 5:42:11 PM (11 years ago)
Author:
Eric
Message:

Next version is 2.5.0 :
Compliance with Piwigo 2.5
Code refactory : Change config variables to assoc array and $_POST vars control before writing conf in database - Thx to flop25 for his advices ;-)
Update zh_CN, thanks to : winson and dennisyan
Add pt_BR, thanks to : flaviove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_Access_Manager/include/upgradedb.inc.php

    r11070 r21117  
    4545  $Newconf_CM = unserialize($conf_CM['value']);
    4646 
    47   $Newconf_CM[0] = $version;
     47  $Newconf_CM[CMVersion] = $version;
    4848 
    4949  $update_conf = serialize($Newconf_CM);
     
    128128  conf_update_param('CommentsManager', pwg_db_real_escape_string($update_conf));
    129129}
     130
     131
     132/* upgrade from 2.4 to 2.5 */
     133/* *********************** */
     134function upgradeCM_240_250()
     135{
     136  global $conf;
     137
     138  // Upgrading options - Changing config variables to assoc array
     139  // ------------------------------------------------------------
     140 
     141  // Upgrade $conf_CM options
     142  $conf_CM = unserialize($conf['CommentsManager']);
     143
     144  $Newconf_CM = array(
     145    'CMVersion'               => $conf_CM[0],
     146    'CM_No_Comment_Anonymous' => $conf_CM[1],
     147    'CM_GROUPCOMM'            => $conf_CM[2],
     148    'CM_ALLOWCOMM_GROUP'      => $conf_CM[3],
     149    'CM_GROUPVALID1'          => $conf_CM[4],
     150    'CM_VALIDCOMM1_GROUP'     => $conf_CM[5],
     151    'CM_GROUPVALID2'          => $conf_CM[6],
     152    'CM_VALIDCOMM2_GROUP'     => $conf_CM[7]
     153  );
     154
     155  // unset obsolete conf
     156  // -------------------
     157  for ($i = 0; $i <= 7; $i++)
     158  {
     159    unset ($conf_CM[$i]);
     160  }
     161
     162  $update_conf = serialize($Newconf_CM);
     163
     164  conf_update_param('CommentsManager', pwg_db_real_escape_string($update_conf));
     165}
    130166?>
Note: See TracChangeset for help on using the changeset viewer.