Ignore:
Timestamp:
Mar 25, 2011, 6:09:55 PM (14 years ago)
Author:
Eric
Message:

Renaming plugin directory from NBC_UserAdvManager to UserAdvManager on plugin upgrade

File:
1 edited

Legend:

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

    r9846 r9853  
    2424The admin of the gallery.','false','false','false','false','false','Sorry [username], your account has been deleted due to a too long time passed since your last visit at [mygallery].','Sorry [username], your account has been deprecated due to a too long time passed since your last visit at [mygallery]. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at [mygallery]. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.','false','Sorry, your account has been deleted because you have not validated your registration in requested time. Please, try registration with a valid and non blocked email account.','false');
    2525
    26   $q = '
     26        $query = '
     27SELECT param
     28  FROM '.CONFIG_TABLE.'
     29WHERE param = "UserAdvManager"
     30;';
     31  $count = pwg_db_num_rows(pwg_query($query));
     32 
     33  if ($count == 0)
     34  {
     35    $q = '
    2736INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    2837VALUES ("UserAdvManager","'.addslashes(serialize($default1)).'","UAM parameters")
    2938  ;';
    30   pwg_query($q);
     39    pwg_query($q);
     40  }
    3141
    3242
     
    4151Note: After this period, your account will be permanently deleted.','You have confirmed that you are human and may now use [mygallery]! Welcome [username]!','Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.');
    4252
    43   $q = '
     53        $query = '
     54SELECT param
     55  FROM '.CONFIG_TABLE.'
     56WHERE param = "UserAdvManager_ConfirmMail"
     57;';
     58  $count = pwg_db_num_rows(pwg_query($query));
     59 
     60  if ($count == 0)
     61  {
     62    $q = '
    4463INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    4564VALUES ("UserAdvManager_ConfirmMail","'.addslashes(serialize($default2)).'","UAM ConfirmMail parameters")
    4665  ;';
    47   pwg_query($q);
    48  
    49   $q = '
     66    pwg_query($q);
     67  }
     68
     69        $query = '
     70SELECT param
     71  FROM '.CONFIG_TABLE.'
     72WHERE param = "UserAdvManager_Redir"
     73;';
     74  $count = pwg_db_num_rows(pwg_query($query));
     75 
     76  if ($count == 0)
     77  {
     78    $q = '
    5079INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    5180VALUES ("UserAdvManager_Redir","0","UAM Redirections")
    5281  ;';
    53   pwg_query($q);
     82    pwg_query($q);
     83  }
    5484
    5585// Set current plugin version in config table
    5686  $plugin =  PluginInfos(UAM_PATH);
    5787  $version = $plugin['version'];
    58   $q = '
     88
     89        $query = '
     90SELECT param
     91  FROM '.CONFIG_TABLE.'
     92WHERE param = "UserAdvManager_Redir"
     93;';
     94  $count = pwg_db_num_rows(pwg_query($query));
     95 
     96  if ($count == 0)
     97  {
     98    $q = '
    5999INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    60100VALUES ("UserAdvManager_Version","'.$version.'","UAM version check")
    61101  ;';
    62  
    63   pwg_query($q);
     102    pwg_query($q);
     103  }
    64104
    65105
Note: See TracChangeset for help on using the changeset viewer.