////////
- //
- Zhangshulin-Hui Jia Studio
- //
- Module name:woods-bhtml.php
- Abstract: Generating a static HTML handler end
- version:2.0
- Copyright 1001-1006, All rights reserved for Hui Jia 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 the The
- Above copyright notice. By the Software Huijia Studio
- Maintenance, if you have a queries please contact us.
- Thank.
- //
- This software is free software and allows the use, copying, modification and distribution of the software and its documentation.
- All copies of the above copyright notice must appear in any place where this software is used. This software is provided by
- HPE Studio Maintenance, if you have any questions please contact us. Thank you for using.
- //
- /////////////
- This file can only be loaded at the end of the program
- /*--__ Generating HTML files----beign----____*/
- if ($make _html)
- {
- $buffer = Ob_get_flush ();
- if ($go _html)//whether to go directly to the HTML file display or PHP read the content output (0:php read Output 1: Direct turn)
- {
- /*--__ handles the problem of seed size resulting from the creation of 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);
- /*--__ handles the problem of seed size resulting from the creation of HTML files--______end--_*/
- }
$fp = fopen (html_file, "w");
- if ($FP)
- {
- Fwrite ($fp, $buffer);
- Fclose ($FP);
- }
- }
- /*--__ Generating HTML files----beign----____*/
- ?>
Copy Code
///////////////////////////////////////////////////////////////////////////////
- //
- Zhangshulin-Hui Jia Studio
- //
- Module name:woods-thtml.php
- Abstract: Generating a 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 for Hui Jia 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 the The
- Above copyright notice. By the Software Huijia Studio
- Maintenance, if you have a queries please contact us.
- Thank.
- //
- This software is free software and allows the use, copying, modification and distribution of the software and its documentation.
- All copies of the above copyright notice must appear in any place where this software is used. This software is provided by
- HPE Studio Maintenance, if you have any questions please contact us. Thank you for using.
- //
- ///////////////////////////////////////////////////////////////////////////////
- This file can only be loaded at the beginning of the program
- Ob_start ();
- /*--determines if an HTML file has been generated and jumps to the HTML page if it is generated--begin--__*/
- $qstring = Isset ($_server["query_string"])? $_server["Query_string"]: "";
- if ($qstring)//program adds handle to get request
- {
- $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 if the last HTML file was generated in the past 1 times, if not directly output the file contents
- {
- if ($show _html)//whether to display in HTML static page (0 is not displayed in HTML display 1 in HTML display)
- {
- if ($go _html)//whether to go directly to the HTML file display or PHP read the content output (0:php read Output 1: Direct turn)
- {
- Header ("Location:".) html_file);//Direct turn
- }
- Else
- {
- Echo (file_get_contents (html_file));//Read display
- }
- Exit (0);
- }
- }
- }
- /*--determines if an HTML file has been generated and jumps to the HTML page if it is generated--end--__*/
- ?>
Copy Code
///////////////////////////////////////////////////////////////////////////////
- //
- Zhangshulin-Hui Jia Studio
- //
- Module Name:index.php
- Abstract: Home Information
- version:1.0
- Date 2006-11-7
- //
- Copyright 2001-2006, All rights reserved for Hui Jia 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 the The
- Above copyright notice. By the Software Huijia Studio
- Maintenance, if you have a queries please contact us.
- Thank.
- //
- This software is free software and allows the use, copying, modification and distribution of the software and its documentation.
- All copies of the above copyright notice must appear in any place where this software is used. This software is provided by
- HPE Studio Maintenance, if you have any questions please contact us. Thank you for using.
- //
- ///////////////////////////////////////////////////////////////////////////////
- Require ("woods-thtml.php");//Generate HTML processing header
- if (count ($_get) < 1 && count ($_post) < 1) {require ("woods-thtml.php");} Generating an HTML processing header
Require ("{$exec _file}");//Registry language definition file
- foreach ($lang as $key = $value)
- {
- $ATPL [Strtoupper ($key). " _lang "] = $value;
- }
- /*------List Common sense go up items--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 Codeyou may be interested in the article:three ways to generate static pages in PHP and the code in detail PHP generates static page functions (php2html) example PHP method for generating static pages (three functions) PHP writes a static page generated by a class that generates HTML static pages for all content in the database to generate static pages on a regular basis. PHP generates a static page in a detailed tutorial on how to generate a pseudo-static page in Apache PHP writes about the static page of the spider Crawling record code smarty generated static Page method PHP generates a static page method Apache cannot access pseudo-static page solutions |