<?
require 'common.inc.php';
require 'safe.inc.php';
if (file_exists('cache.phpleft')) {
	deletehtml('cache.phpleft');
	msg('第一次访问系统更新缓存！', 'phpleft.php?file=cache');
	exit();
}
if ($post=='delinstall'){
$dirpath=PL_ROOT.'install';
deldir($dirpath);
echo gourl('main.php','0');	
}else{
$opts = array(
  'http'=>array(
    'method'=>"GET",
    'timeout'=>1,
   )
);
$context = stream_context_create($opts);
define('ThisFile', ThisFile());
plcenter(inTemplate(ThisFile));
$url =  's/'.$_SERVER['PHP_SELF'];
//$upurl = 'http://www.'.SOFTNAME.'.com/update.html'; //升级提示，根据phpleft.com官方版本号对比，请勿去掉。
//$update = file_get_contents($upurl,false, $context);
error_reporting(0);
$new_update = $update ? $update : PL_DAY;
$safe['adminpath'] = strpos($url,"/admin/") > 0 ? '1': 0;
$safe['installpath'] = file_exists('../install') ? '1': 0;
$safe['update'] = 0;//$new_update > PL_DAY ? '1': 0;
$safe_n = $safe['adminpath']+$safe['installpath']+$safe['update'];
include inTemplate(ThisFile);
echo '<script type="text/javascript" src="http://www.phpleft.com/center.php?url='.PL_URL.'"></script>';
}
?>