<?php
/*____生成html文件________beign__________*/
if ($make_html)
{
$buffer = ob_get_flush();
if ($go_html)//是否直接轉到html文件顯示還是php讀得內容輸出(0:php讀內容輸出1:直接轉)
{
/*__處理因生成了html文件而產生的種徑問題______begin_______*/
$search = array(
"/(src=|action=|href=|ajaxread/()/"/ie",
"http://./././e",
"http://.///./e",
"http://././/http://///ies",
"http://././/#/",
"http://'/./'/e",
"http://././/javascript:/ies");
$replace = array(
"'//1/"../'",
"'..'",
"'.'",
"'http://'",
"#",
"'/'../''",
"'javascript:'");
$buffer = preg_replace($search, $replace, $buffer);
/*___處理因生成了html文件而產生的種徑問題_____end_____*/
}
$fp = fopen(html_file, "w");
if ($fp)
{
fwrite($fp, $buffer);
fclose($fp);
}
}
/*_______生成html文件_________beign________*/
?>
<?php
ob_start();
/*____判斷是否已生成了html文件,若生成了則跳轉到html頁面___begin_____*/
$qstring = isset($_server["query_string"]) ? $_server["query_string"] : "";
if ($qstring)//程序加了get請求的處理
{
$qstring = str_replace("=", "", $qstring);
define("html_file", "./h/{$efilename}-{$qstring}.html");
}
else
{
define("html_file", "./h/{$efilename}.html");
}
if (file_exists(html_file))
{
$lcft = filemtime(html_file);//last create file time
if (($lcft + 3600) > time())//判斷上次生成html文件是否以過去1時間,若沒有才直接輸出文件內容
{
if ($show_html)//是否以html靜態(tài)頁面展示(0不以html展顯1以html展顯)
{
if ($go_html)//是否直接轉到html文件顯示還是php讀得內容輸出(0:php讀內容輸出1:直接轉)
{
header("location: " . html_file);//直接轉
}
else
{
echo(file_get_contents(html_file));//讀出展顯
}
exit(0);
}
}
}
/*___判斷是否已生成了html文件,若生成了則跳轉到html頁面_____end_____*/
?>
<?php
require("woods-thtml.php");//生成html處理頭
//if (count($_get) < 1 && count($_post) < 1){require("woods-thtml.php");}//生成html處理頭
require("{$exec_file}");//注冊語言定義文件
foreach ($lang as $key => $value)
{
$atpl[strtoupper($key) ."_lang"] = $value;
}
/*__________列表常識向上走的項_______end_______*/
include("woods-templates.php");
$tpl = new woodstpl("./templates/");
$tpl->require_tpl("header.html");
$tpl->set_file();
$tpl->block("ebcorp", $scorp);
$tpl->block("news", $news);
$tpl->block("product", $product);
$tpl->block("ebpname_msg", $spname);
$tpl->block("lore", $lore);
$tpl->require_tpl("footer.html");
$tpl->parse($atpl, true);
$tpl = null;
/*_____模板操作________end_____________*/
require("woods-bhtml.php");//生成html處理尾
?>
新聞熱點
疑難解答