//自动生成HTML版
if(isset($_GET['cache']))
{
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `#@__homepage`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->SaveToHtml(dirname(__FILE__).'/index.html');
include(dirname(__FILE__).'/index.html');
exit();
}
if(isset($_GET['cache']))
{
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `#@__homepage`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->SaveToHtml(dirname(__FILE__).'/index.html');
include(dirname(__FILE__).'/index.html');
exit();
}
{
require_once (dirname(__FILE__) . "/include/common.inc.php");//包含文件 common.inc.php
require_once DEDEINC."/partview.class.php"; //包含文件
$GLOBALS['_arclistEnv'] = 'index'; //设置全局变量
$row = $dsql->GetOne("Select * From `#@__homepage`");//从数据库读取一行数据
$row['templet'] = MfTemplet($row['templet']);//将返回的数据赋值给templet
$pv = new PartView(); //实例化
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);//设置模板文件
$pv->SaveToHtml(dirname(__FILE__).'/index.html');//保存静态文件
include(dirname(__FILE__).'/index.html');//包含静态文件
exit();
}
if里面的代码上面解释已经很到位了。