-
-
//////// - //
- // Zhang Shulin - Huijia Studio
- //
- // Module Name: woods-bhtml.php
- // Abstract: Generate the bottom of the static HTML handler
- // Version: 2.0
- // Copyright 1001-1006, all copyright protection by Huijia Studio
//The software for free software, allowing use, copy,
- //modify and distribute the software and files. Any
- //use of this software must place a copy of all the
- //above copyright notice. By the software Huijia studio
- //maintenance, if you have any queries please contact us.
- //Thank you.
- //
- //This software is free software, and you are allowed to use, copy, modify, and distribute this software and its documentation.
- //All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
- //Huijia Studio. If you have any questions, please contact us. Thank you for using it.
- //
- /////////////
- //This file can only be loaded at the end of the program
- /*--__Generate HTML file----beign----____ */
- if ($make_html)
- {
- $buffer = ob_get_flush();
- if ($go_html)//Whether it is directly transferred to the HTML file display or the PHP read content output (0: PHP read content output 1: Direct transfer )
- {
- /*--__Handle path problems caused by generating HTML files--______begin--_*/
- $search = array(
- "/(src=|action=|href=|ajaxRead ()"/ie",
- "/.../e",
- "/././e",
- "/../http:///ies",
- "/../#/" ,
- "/'.'/e",
- "/../javascript:/ies");
$replace = array(
- "'\1"../'" ,
- "'..'",
- "'.'",
- "'http://'",
- "#",
- "''..''",
- "'javascript:'");
- $buffer = preg_replace($search, $replace, $buffer);
- /*--__Handle the seed path problem caused by generating HTML files--______end--_*/
- }
$fp = fopen(HTML_FILE, "w");
- if ($fp)
- {
- fwrite($fp, $buffer);
- fclose($fp);
- }
- }
- /*- -__Generate HTML file----beign----____*/
- ?>
-
Copy code
-
-
- ///////////////////////////////////////////////////// /////////////////////////////
- //
- // Zhang Shulin - Huijia Studio
- //
- // Module Name: woods-thtml.php
- // Abstract: Generate static HTML handler header
- // Version: 2.0
- // Date 1006-11-25
- // Copyright 1001-1006, Hoojar studio All Rights Reserved
- //
- // Copyright 1001-1006, all rights reserved by Huijia Studio
//The software for free software, allowing use, copy,
- //modify and distribute the software and files. Any
- // use of this software must place a copy of all the
- //above copyright notice. By the software Huijia studio
- //maintenance, if you have any queries please contact us.
- //Thank you.
- //
- //this The software is free software, and you are allowed to use, copy, modify, and distribute the software and its documentation.
- //All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
- //Huijia Studio. If you have any questions, please contact us. Thank you for using it.
- //
- ///////////////////////////////////////////////// ///////////////////////////////////
- //This file can only be loaded at the beginning of the program
- ob_start();
- /*--Determine whether the HTML file has been generated. If so, jump to the HTML page--begin--__*/
- $qstring = isset($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING" "] : "";
- if ($qstring)//The program adds GET request processing
- {
- $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())//Determine whether the last time the HTML file was generated was 1 time in the past, if If not, output the file content directly
- {
- if ($show_html)//Whether to display it as an HTML static page (0 does not display it in HTML, 1 displays it in html)
- {
- if ($go_html)//Whether it goes directly to HTML The file display is still the content output read by PHP (0: PHP read content output 1: direct transfer)
- {
- header("Location: " . HTML_FILE);//direct transfer
- }
- else
- {
- echo(file_get_contents(HTML_FILE) );//Read the display
- }
- exit(0);
- }
- }
- }
- /*--Determine whether the HTML file has been generated, and if so, jump to the HTML page --end--__* /
- ?>
-
Copy code
-
-
- //////////////////////////////////// /////////////////////////////////////////////
- //
- // Zhang Shulin - Huijia Studio
- //
- // Module Name: index.php
- // Abstract: Home page information
- // Version: 1.0
- // Date 2006-11-7
- //
- // Copyright 2001-2006 , All copyrights are protected by Huijia Studio
//The software for free software, allowing use, copy,
- //modify and distribute the software and files. Any
- //use of this software must place a copy of all the
- //above copyright notice. By the software Huijia studio
- //maintenance, if you have any queries please contact us.
- //Thank you.
- //
- //This software is free software , allowing the use, copying, modification, and distribution of this software and its documentation.
- //All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
- //Huijia Studio. If you have any questions, please contact us. Thank you for using it.
- //
- ///////////////////////////////////////////////// ///////////////////////////////////
- require("woods-thtml.php");//Generate HTML processing Header
- //if (count($_GET) < 1 && count($_POST) < 1){require("woods-thtml.php");}//Generate HTML processing header
- < ;p>require("{$exec_file}");//Register language definition file
- foreach ($lang as $key => $value)
- {
- $atpl[strtoupper($key) ."_LANG"] = $value;
- }
- /*------List items going up --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;
- /*--__Template operation----end----*/
- require("woods-bhtml.php");//Generate HTML processing Tail
- ?>
-
Copy code
Articles you may be interested in:
Three methods and code details for generating static pages in PHP
Example of php generating static page function (php2html)
How to generate static pages in php (three functions)
A class written in php to generate static pages
Code to generate html static pages from all content in the database
How to automatically generate static pages on a virtual host at regular intervals
Detailed tutorial on generating static pages with php
Solution to the problem that pseudo-static pages cannot be accessed in apache
Code written by php about spider crawling records of static pages
How to generate static pages using smarty
How to generate static pages with PHP
Solution to the problem that apache cannot access pseudo-static pages
|