Changeset 5064 for extensions/NBC_UserAdvManager/trunk/maintain.inc.php
- Timestamp:
- Mar 6, 2010, 7:37:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/maintain.inc.php
r5056 r5064 8 8 include_once (NBC_UAM_PATH.'include/constants.php'); 9 9 include_once (NBC_UAM_PATH.'include/functions.inc.php'); 10 10 11 11 12 function plugin_install() … … 21 22 Best regards, 22 23 23 The admin of the gallery.','false' );24 The admin of the gallery.','false','false'); 24 25 25 26 $q = ' … … 28 29 ;'; 29 30 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 44 32 45 33 $default2 = array('false',5,'Hello. … … 59 47 pwg_query($q); 60 48 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);*/75 49 76 50 $q = " … … 98 72 } 99 73 74 100 75 function plugin_activate() 101 76 { 102 77 global $conf; 103 78 104 79 /* Cleaning obsolete files */ 105 update_files($plugin_id); 80 /* *********************** */ 81 clean_obsolete_files(); 106 82 107 83 108 84 /* Check for upgrade from 2.10 to 2.11 */ 109 $query = ' 85 /* *********************************** */ 86 $query = ' 110 87 SELECT * 111 88 FROM '.CONFIG_TABLE.' … … 116 93 if ($count == 0) 117 94 { 118 /* upgrade from branch 2.10 to 2.11 */ 95 /* upgrade from branch 2.10 to 2.11 */ 96 /* ******************************** */ 119 97 upgrade_210(); 120 98 } … … 122 100 123 101 /* Check for upgrade from 2.11 to 2.12 */ 102 /* *********************************** */ 124 103 if (!table_exist(USER_LASTVISIT_TABLE)) 125 104 { 126 /* upgrade from branch 2.11 to 2.12 */ 105 /* upgrade from branch 2.11 to 2.12 */ 106 /* ******************************** */ 127 107 upgrade_211(); 128 108 } … … 130 110 131 111 /* Check for upgrade from 2.12 to 2.13 */ 112 /* *********************************** */ 132 113 $query = ' 133 114 SELECT * … … 141 122 if ($numfields < 6) 142 123 { 143 /* upgrade from branch 2.12 to 2.13 */ 124 /* upgrade from branch 2.12 to 2.13 */ 125 /* ******************************** */ 144 126 upgrade_212(); 145 127 } 146 128 147 129 148 /* Serializing conf parameters - Available since 2.13.5 */ 130 /* Serializing conf parameters - Available since 2.14.0 */ 131 /* **************************************************** */ 149 132 if (unserialize($conf['nbc_UserAdvManager']) === false) 150 133 { 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(); 171 137 } 172 138 } … … 205 171 206 172 173 // +----------------------------------------------------------+ 174 // | Upgrading database from old plugin versions | 175 // +----------------------------------------------------------+ 176 207 177 /* upgrade from branch 2.10 to 2.11 */ 178 /* ******************************** */ 208 179 function upgrade_210() 209 180 { … … 229 200 230 201 /* upgrade from branch 2.11 to 2.12 */ 202 /* ******************************** */ 231 203 function upgrade_211() 232 204 { … … 271 243 272 244 /* upgrade from branch 2.12 to 2.13 */ 245 /* ******************************** */ 273 246 function upgrade_212() 274 247 { … … 297 270 ;'; 298 271 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 /* ******************************** */ 280 function upgrade_213() 281 { 282 $data = explode(';', $conf['nbc_UserAdvManager']); 283 284 $query = ' 285 UPDATE '.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 = ' 296 UPDATE '.CONFIG_TABLE.' 297 SET value = "'.addslashes(serialize($data)).'" 298 WHERE param = "nbc_UserAdvManager_ConfirmMail" 299 ;'; 300 pwg_query($query); 301 } 305 302 } 306 303 ?>
Note: See TracChangeset
for help on using the changeset viewer.