Ignore:
Timestamp:
Mar 6, 2010, 7:37:18 PM (14 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager] Pre-2.14.0

  • Changing next version. It'll be a full version upgrade
  • Improving database upgrade process
  • Bug 1308 re-fixed
  • Bug 1392 fixed
  • Bug 1466 fixed
  • Bug 1485 fixed
  • Update of language files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/maintain.inc.php

    r5056 r5064  
    88include_once (NBC_UAM_PATH.'include/constants.php');
    99include_once (NBC_UAM_PATH.'include/functions.inc.php');
     10
    1011
    1112function plugin_install()
     
    2122Best regards,
    2223
    23 The admin of the gallery.','false');
     24The admin of the gallery.','false','false');
    2425
    2526  $q = '
     
    2829  ;';
    2930  pwg_query($q);
    30  
    31 /*  $q = '
    32 INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    33 VALUES ("nbc_UserAdvManager","false;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false;false;10;Hello.
    34        
    35 This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
    36 
    37 On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
    38 
    39 Best regards,
    40 
    41 The admin of the gallery.;false","Parametres du plugin nbc UserAdvManager")
    42   ;';
    43   pwg_query($q);*/
     31
    4432
    4533  $default2 = array('false',5,'Hello.
     
    5947  pwg_query($q);
    6048
    61 
    62 /*  $q = '
    63 INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    64 VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
    65                
    66 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
    67 
    68 Note: After this period, your account will be permanently deleted.;false;Hello.
    69 
    70 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by clicking on the link in the message you should have received when you registered.
    71 
    72 Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail")
    73   ;';
    74   pwg_query($q);*/
    7549
    7650        $q = "
     
    9872}
    9973
     74
    10075function plugin_activate()
    10176{
    102           global $conf;
     77  global $conf;
    10378
    10479/* Cleaning obsolete files */
    105     update_files($plugin_id);
     80/* *********************** */
     81  clean_obsolete_files();
    10682
    10783
    10884/* Check for upgrade from 2.10 to 2.11 */
    109           $query = '
     85/* *********************************** */
     86        $query = '
    11087SELECT *
    11188  FROM '.CONFIG_TABLE.'
     
    11693        if ($count == 0)
    11794        {
    118          /* upgrade from branch 2.10 to 2.11 */
     95  /* upgrade from branch 2.10 to 2.11 */
     96  /* ******************************** */
    11997                upgrade_210();
    12098        }
     
    122100
    123101/* Check for upgrade from 2.11 to 2.12 */
     102/* *********************************** */
    124103  if (!table_exist(USER_LASTVISIT_TABLE))
    125104  {
    126     /* upgrade from branch 2.11 to 2.12 */
     105  /* upgrade from branch 2.11 to 2.12 */
     106  /* ******************************** */
    127107                upgrade_211();
    128108  }
     
    130110
    131111/* Check for upgrade from 2.12 to 2.13 */
     112/* *********************************** */
    132113  $query = '
    133114SELECT *
     
    141122  if ($numfields < 6)
    142123  {
    143     /* upgrade from branch 2.12 to 2.13 */
     124  /* upgrade from branch 2.12 to 2.13 */
     125  /* ******************************** */
    144126    upgrade_212();
    145127  }
    146128
    147129
    148 /* Serializing conf parameters - Available since 2.13.5 */
     130/* Serializing conf parameters - Available since 2.14.0 */
     131/* **************************************************** */
    149132  if (unserialize($conf['nbc_UserAdvManager']) === false)
    150133  {
    151     $data = explode(';', $conf['nbc_UserAdvManager']);
    152 
    153     $query = '
    154 UPDATE '.CONFIG_TABLE.'
    155   SET value = "'.addslashes(serialize($data)).'"
    156   WHERE param = "nbc_UserAdvManager"
    157 ;';
    158     pwg_query($query);
    159   }
    160  
    161   if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false)
    162   {
    163     $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']);
    164 
    165     $query = '
    166 UPDATE '.CONFIG_TABLE.'
    167   SET value = "'.addslashes(serialize($data)).'"
    168   WHERE param = "nbc_UserAdvManager_ConfirmMail"
    169 ;';
    170     pwg_query($query);
     134  /* upgrade from branch 2.13 to 2.14 */
     135  /* ******************************** */
     136    upgrade_213();
    171137  }
    172138}
     
    205171
    206172
     173// +----------------------------------------------------------+
     174// |       Upgrading database from old plugin versions        |
     175// +----------------------------------------------------------+
     176
    207177/* upgrade from branch 2.10 to 2.11 */
     178/* ******************************** */
    208179function upgrade_210()
    209180{
     
    229200
    230201/* upgrade from branch 2.11 to 2.12 */
     202/* ******************************** */
    231203function upgrade_211()
    232204{
     
    271243
    272244/* upgrade from branch 2.12 to 2.13 */
     245/* ******************************** */
    273246function upgrade_212()
    274247{
     
    297270;';
    298271                pwg_query($query);
    299   }
    300 }
    301 
    302 function update_files($plugin_id)
    303 {
    304   $clean = clean_obsolete_files(UAM_OBSOLETE);
     272   
     273    upgrade_213();
     274  }
     275}
     276
     277
     278/* upgrade from branch 2.13 to 2.14 */
     279/* ******************************** */
     280function upgrade_213()
     281{
     282  $data = explode(';', $conf['nbc_UserAdvManager']);
     283
     284  $query = '
     285UPDATE '.CONFIG_TABLE.'
     286  SET value = "'.addslashes(serialize($data)).'"
     287  WHERE param = "nbc_UserAdvManager"
     288;';
     289  pwg_query($query);
     290 
     291  if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false)
     292  {
     293    $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']);
     294
     295    $query = '
     296UPDATE '.CONFIG_TABLE.'
     297  SET value = "'.addslashes(serialize($data)).'"
     298  WHERE param = "nbc_UserAdvManager_ConfirmMail"
     299;';
     300    pwg_query($query);
     301  }
    305302}
    306303?>
Note: See TracChangeset for help on using the changeset viewer.