' .'
'. __('Please check your user lists if you have upgraded from a version < 4.0','amr-users') .'
' .__('If you are using "user registration date" in a user list, you may need to adjust the format.','amr-users') .'
'. '' .''); } function amr_check_for_upgrades () { // NB must be in order of the oldest changes first // called from ausers_get_option // should already have values then - and will not be new ? global $amain, $aopt; if (empty($amain)) $amain = ausers_get_option('amr-users-main'); //if (WP_DEBUG) echo ''; // must be in admin and be admin if (!is_admin() or !(current_user_can('manage_options')) ) return; // handle a series of updates in order if (!isset($amain['version'])) $amain['version'] = '0'; // really old? if (version_compare($amain['version'],AUSERS_VERSION,'=')) return; // if same version, don't repeat check $prev = $amain['version']; echo PHP_EOL.''; // closing div at end
printf(__('Previous version was %s. ', 'amr-users'),$prev );
_e('New version activated. ', 'amr-users');
_e('We may need to process some updates.... checking now... ', 'amr-users');
// do old changes first - user may not have updated for a while....
if ((!isset($amain['version'])) or
(version_compare($amain['version'],'3.1','<'))) { // convert old options from before 3.1
echo '
';
printf(__('Prev version less than %s', 'amr-users'),'3.1.');
if (!isset($amain['csv_text']))
$amain['csv_text'] = ('
');
if (!isset($amain['refresh_text']))
$amain['refresh_text'] = ('
');
ausers_update_option('amr-users-main',$amain );
echo '
'.__('Image links updated.', 'amr-users');
echo '
'.__('New Pagination option default to yes for all lists.', 'amr-users').'
'; if (!isset($amain['show_pagination'])) { foreach ($amain['names'] as $i => $n) { $amain['show_pagination'][$i] = true; } } } //user_registration_date // 20170115 if ((!isset($amain['version'])) or (version_compare($amain['version'],'4.0','<'))) { // check for before 4.0, echo ''.__('Change dummy user registration date to real user registered with new format options.', 'amr-users').'
'; // first get the 'ago' format in for the existing 'registered days ago' option $aopt = ausers_get_option('amr-users' ); // then convert any user_registered_date fields across to the user_registered $aopt = str_replace('user_registration_date', 'user_registered', $aopt); ausers_update_option('amr-users',$aopt ); $nice_names = (ausers_get_option ('amr-users-nicenames')); if (!empty ($nice_names['user_registration_date'])) { unset ($nice_names['user_registration_date']); ausers_update_option ('amr-users-nicenames',$nice_names); } } $amain['version'] = AUSERS_VERSION; ausers_update_option('amr-users-main',$amain ); // was 'amr-users-no-lists' echo ''.__('Finished Update Checks', 'amr-users').' '; echo ' ' .__('Please read the changelog','amr-users' ).''; echo '
'.PHP_EOL; echo '