get('Your database is out of date, please make sure to upgrade').'
'.
$GLOBALS['I18N']->get('Your version').' : '.$dbversion.'
'.
$GLOBALS['I18N']->get('phplist version').' : '.VERSION.
'
'.PageLink2('upgrade', $GLOBALS['I18N']->get('Upgrade'))
);
$upgrade_required = 1;
}
} else {
Info($GLOBALS['I18N']->get('Database has not been initialised').'. '.
$GLOBALS['I18N']->get('go to').' '.
PageLink2('initialise&firstinstall=1', $GLOBALS['I18N']->get('Initialise Database')).' '.
$GLOBALS['I18N']->get('to continue'), 1);
$GLOBALS['firsttime'] = 1;
$_SESSION['firstinstall'] = 1;
return;
}
//# trigger this somewhere else?
refreshTlds();
// check for latest version
$checkinterval = sprintf('%d', getConfig('check_new_version'));
if (empty($checkinterval)) {
$checkinterval = 7;
}
$showUpdateAvail = !empty($_GET['showupdate']); //# just to check the design
$thisversion = VERSION;
$thisversion = preg_replace("/[^\.\d]/", '', $thisversion);
$latestversion = getConfig('updateavailable');
$showUpdateAvail = $showUpdateAvail || (!empty($latestversion) && !versionCompare($thisversion, $latestversion));
if (!$showUpdateAvail && $checkinterval) {
//#https://mantis.phplist.com/view.php?id=16815
$query = sprintf('select date_add(value, interval %d day) < now() as needscheck from %s where item = "updatelastcheck"',
$checkinterval, $tables['config']);
$needscheck = Sql_Fetch_Row_Query($query);
if ($needscheck[0] != '0') {
@ini_set('user_agent', NAME.' (phplist version '.VERSION.')');
@ini_set('default_socket_timeout', 5);
if ($fp = @fopen('https://www.phplist.com/files/LATESTVERSION', 'r')) {
$latestversion = fgets($fp);
$latestversion = preg_replace("/[^\.\d]/", '', $latestversion);
@fclose($fp);
if (!versionCompare($thisversion, $latestversion)) {
//# remember this, so we can remind about the update, without the need to check the phplist site
//# hmmm, this causes it to be "stuck" on the last version checked
SaveConfig('updateavailable', $latestversion, 0, true);
$showUpdateAvail = true;
}
}
SaveConfig('updatelastcheck', date('Y-m-d H:i:s', time()), 0, true);
}
}
if ($showUpdateAvail) {
echo '