Changeset 5181 for extensions/NBC_UserAdvManager/trunk/maintain.inc.php
- Timestamp:
- Mar 18, 2010, 11:08:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/maintain.inc.php
r5086 r5181 1 1 <?php 2 2 3 if(!defined(" NBC_UAM_PATH")) define('NBC_UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');4 if (!defined(' NBC_UAM_ROOT')) {5 define(' NBC_UAM_ROOT', dirname(__FILE__).'/');6 } 7 8 include_once ( NBC_UAM_PATH.'include/constants.php');9 include_once ( NBC_UAM_PATH.'include/functions.inc.php');3 if(!defined("UAM_PATH")) define('UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 4 if (!defined('UAM_ROOT')) { 5 define('UAM_ROOT', dirname(__FILE__).'/'); 6 } 7 8 include_once (UAM_PATH.'include/constants.php'); 9 include_once (UAM_PATH.'include/functions.inc.php'); 10 10 11 11 … … 26 26 $q = ' 27 27 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 28 VALUES (" nbc_UserAdvManager","'.addslashes(serialize($default1)).'","NBC_UAM parameters")28 VALUES ("UserAdvManager","'.addslashes(serialize($default1)).'","UAM parameters") 29 29 ;'; 30 30 pwg_query($q); … … 39 39 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. 40 40 41 Note: After this period, your account will be permanently deleted.' );41 Note: After this period, your account will be permanently deleted.','Thank you to have confirmed your email address and your registration on the gallery. Have fun !','Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.'); 42 42 43 43 $q = ' 44 44 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 45 VALUES (" nbc_UserAdvManager_ConfirmMail","'.addslashes(serialize($default2)).'","NBC_UAM ConfirmMail parameters")45 VALUES ("UserAdvManager_ConfirmMail","'.addslashes(serialize($default2)).'","UAM ConfirmMail parameters") 46 46 ;'; 47 47 pwg_query($q); … … 136 136 upgrade_213(); 137 137 } 138 139 140 /* Check for upgrade from 2.14.1 to 2.14.2 */ 141 /* *************************************** */ 142 $query1 = ' 143 SELECT param 144 FROM '.CONFIG_TABLE.' 145 WHERE param = "nbc_UserAdvManager_ConfirmMail" 146 ;'; 147 $count1 = mysql_num_rows(pwg_query($query1)); 148 149 $query1 = ' 150 SELECT param 151 FROM '.CONFIG_TABLE.' 152 WHERE param = "nbc_UserAdvManager_ConfirmMail" 153 ;'; 154 $count2 = mysql_num_rows(pwg_query($query1)); 155 156 if ($count1 == 1 or $count2 == 1) 157 { 158 /* upgrade from branch 2.14.1 to 2.14.2 */ 159 /* ************************************ */ 160 upgrade_214_1(); 161 } 138 162 } 139 163 … … 143 167 global $conf; 144 168 145 if (isset($conf[' nbc_UserAdvManager']))169 if (isset($conf['UserAdvManager'])) 146 170 { 147 171 $q = ' 148 172 DELETE FROM '.CONFIG_TABLE.' 149 WHERE param=" nbc_UserAdvManager"173 WHERE param="UserAdvManager" 150 174 ;'; 151 175 … … 153 177 } 154 178 155 if (isset($conf[' nbc_UserAdvManager_ConfirmMail']))179 if (isset($conf['UserAdvManager_ConfirmMail'])) 156 180 { 157 181 $q = ' 158 182 DELETE FROM '.CONFIG_TABLE.' 159 WHERE param=" nbc_UserAdvManager_ConfirmMail"183 WHERE param="UserAdvManager_ConfirmMail" 160 184 ;'; 161 185 … … 303 327 ;'; 304 328 pwg_query($query); 305 } 329 330 upgrade_214_1(); 331 } 332 } 333 334 function upgrade_214_1() 335 { 336 global $conf; 337 338 /* Changing parameter name */ 339 $q = ' 340 UPDATE '.CONFIG_TABLE.' 341 SET param = "UserAdvManager" 342 WHERE param = "nbc_UserAdvManager" 343 ;'; 344 pwg_query($q); 345 346 $q = ' 347 UPDATE '.CONFIG_TABLE.' 348 SET param = "UserAdvManager_ConfirmMail" 349 WHERE param = "nbc_UserAdvManager_ConfirmMail" 350 ;'; 351 pwg_query($q); 352 353 /* Upgrading ConfirmMail options */ 354 $conf_UAM2 = explode(';', $conf['UserAdvManager_ConfirmMail']); 355 356 $upgrade_UAM2 = array($conf_UAM2[0],$conf_UAM2[1],$conf_UAM2[2],$conf_UAM2[3],$conf_UAM2[4],'Thank you to have confirmed your email address and your registration on the gallery. Have fun !','Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.'); 357 358 $query = ' 359 UPDATE '.CONFIG_TABLE.' 360 SET value = "'.addslashes(serialize($upgrade_UAM2)).'" 361 WHERE param = "UserAdvManager_ConfirmMail" 362 ;'; 363 pwg_query($query); 306 364 } 307 365 ?>
Note: See TracChangeset
for help on using the changeset viewer.