<?php
defined('PHP168_PATH') or die();

/**
* 首页生成静态
**/

//$this_controller->check_admin_action($ACTION) or message('no_privilege');
$site = $_GET['site'];
$sdata = $this_system->get_site($site);

		
	//定义生成静态的常量
	define('P8_GENERATE_HTML', true);
	$uri = '/s.php/'. $site;

	$_SERVER['_REQUEST_URI'] = $uri;
	ob_start();
	require PHP168_PATH .'s.php';
	$content = ob_get_clean();
	
	$index_file = $this_system->path.'/html/'.$site.'/index.html';
	
	write_file($index_file, $content);
	@chmod($index_file, 0644);
	if(REQUEST_METHOD == 'GET'){
		message('html_success',$sdata['domain'],2);
	}else{
		echo $sdata['domain']?$sdata['domain']:$sdata['htmlurl'];
	}


