<?php
require dirname(__FILE__) . '/../jxcms/common.php';
$notice = Cache :: read('remotenotice_client', '', 0, 'Data');
if (R('uptime')) {
	$notice[0] = TIME;
	Cache :: write('remotenotice_client', $notice, '', 'Data');
	exit;
}
$today = date('Y-m-d');
$time = empty($notice[0]) ? 0 : $notice[0];
$date = empty($notice[1]) ? 0 : $notice[1];
$url = rawurlencode(APP_URL);
$data = @file_get_contents('http://www.jxcms.com/remotenotice.php?version=' . JXCMS_VERSION . '&release=' . JXCMS_RELEASE . '&url=' . $url . '&time=' . $time . '&ip=' . IP);
if ($data) {
	$data = base64_decode($data);
	$data = unserialize($data);
	if (!$data['isupdate'] || $data['content'] == 'uptime') {
		$data['time'] = TIME;
		if ($data['content'] == 'uptime') $data['content'] = '';
	}
	Cache :: write('remotenotice_client', array($data['time'], date('Y-m-d')), '', 'Data');
	echo $data['content'];
}

?>