Line 34 | Line 34 |
---|
$this->page_title = 'ACP_VERSION_CHECK';
// Get current and latest version
|
$this->page_title = 'ACP_VERSION_CHECK';
// Get current and latest version
|
$errstr = ''; $errno = 0;
| $info = htmlspecialchars(obtain_latest_version_info(request_var('versioncheck_force', false)));
|
|
|
$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
if ($info === false)
| if (empty($info))
|
{
|
{
|
trigger_error($errstr, E_USER_WARNING);
| trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
|
}
$info = explode("\n", $info); $latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
|
}
$info = explode("\n", $info); $latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
|
| $announcement_url = (strpos($announcement_url, '&') === false) ? str_replace('&', '&', $announcement_url) : $announcement_url;
|
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
|
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
|
| // next feature release $next_feature_version = $next_feature_announcement_url = false; if (isset($info[2]) && trim($info[2]) !== '') { $next_feature_version = trim($info[2]); $next_feature_announcement_url = trim($info[3]); }
|
// Determine automatic update... $sql = 'SELECT config_value
| // Determine automatic update... $sql = 'SELECT config_value
|
Line 59 | Line 65 |
---|
$db->sql_freeresult($result);
$current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
|
$db->sql_freeresult($result);
$current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
|
$up_to_date_automatic = (version_compare(str_replace('rc', 'RC', strtolower($current_version)), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true; $up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($config['version'])), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true;
| |
$template->assign_vars(array(
|
$template->assign_vars(array(
|
'S_UP_TO_DATE' => $up_to_date, 'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
| 'S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='), 'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='),
|
'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action,
|
'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action,
|
| 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'),
|
'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], 'AUTO_VERSION' => $version_update_from,
|
'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], 'AUTO_VERSION' => $version_update_from,
|
| 'NEXT_FEATURE_VERSION' => $next_feature_version,
|
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
|
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
|
| 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false,
|
)); } }
| )); } }
|