5
* @version $Id: acp_update.php,v 1.9 2007/11/19 17:00:13 acydburn Exp $
6
* @copyright (c) 2005 phpBB Group
7
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
14
if (!defined('IN_PHPBB'))
26
function main($id, $mode)
28
global $config, $db, $user, $auth, $template, $cache;
29
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
31
$user->add_lang('install');
33
$this->tpl_name = 'acp_update';
34
$this->page_title = 'ACP_VERSION_CHECK';
36
// Get current and latest version
40
$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
44
trigger_error($errstr, E_USER_WARNING);
47
$info = explode("\n", $info);
48
$latest_version = trim($info[0]);
50
$announcement_url = trim($info[1]);
51
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
53
// Determine automatic update...
54
$sql = 'SELECT config_value
55
FROM ' . CONFIG_TABLE . "
56
WHERE config_name = 'version_update_from'";
57
$result = $db->sql_query($sql);
58
$version_update_from = (string) $db->sql_fetchfield('config_value');
59
$db->sql_freeresult($result);
61
$current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
63
$up_to_date_automatic = (version_compare(str_replace('rc', 'RC', strtolower($current_version)), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true;
64
$up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($config['version'])), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true;
66
$template->assign_vars(array(
67
'S_UP_TO_DATE' => $up_to_date,
68
'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
69
'S_VERSION_CHECK' => true,
70
'U_ACTION' => $this->u_action,
72
'LATEST_VERSION' => $latest_version,
73
'CURRENT_VERSION' => $config['version'],
74
'AUTO_VERSION' => $version_update_from,
76
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
b'\\ No newline at end of file'