_php instance of generating static HTML Speed class library with PHP

Source: Internet
Author: User
Tags abstract documentation html page require reserved
Copy Code code as follows:

<?php
///////////////////////////////////////////////////////////////////////////////
//
Zhangshulin-Hui Jia Studio
//
Module name:woods-bhtml.php
Abstract: Generate static HTML handler tail end
version:2.0
Date 1006-11-25
Author:woods Zhang
website:http://www.hoojar.com/
Email:hoojar@53.com
Msn:hoojar@hotmail.com
Copyright 1001-1006, Hoojar studio all Rights Reserved
//
Copyright 1001-1006, All rights reserved by Hui Jia Studio

The software for free software, allowing use, copy,
Modify and distribute the software and files. Any
Use this software must place a copy of the
Above copyright notice. By the Software Huijia Studio
Maintenance, if you are have any queries please contact us.
Thank you.
//
This software is free software that allows the use, copying, modification and distribution of the software and its documentation.
Any copies of the above copyright notices will be available wherever this software is used. This software is provided by the
Hui Jia 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
/*________________ Generate HTML file ______________________beign________________________________*/
if ($make _html)
{
$buffer = Ob_get_flush ();
if ($go _html)//whether directly to the HTML file display or PHP read content output (0:php read content Output 1: Direct turn)
{
/*__________ handles the problem of the seed path 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);
/*__________ handles the problem of the seed path caused by generating HTML files ____________________end_______________*/
}

$fp = fopen (html_file, "w");
if ($FP)
{
Fwrite ($fp, $buffer);
Fclose ($FP);
}
}
/*________________ Generate HTML file ______________________beign________________________________*/
?>

<?php
///////////////////////////////////////////////////////////////////////////////
//
Zhangshulin-Hui Jia Studio
//
Module name:woods-thtml.php
Abstract: Generating static HTML handler headers
version:2.0
Date 1006-11-25
Author:woods Zhang
website:http://www.hoojar.com/
Email:hoojar@53.com
Msn:hoojar@hotmail.com
Copyright 1001-1006, Hoojar studio all Rights Reserved
//
Copyright 1001-1006, All rights reserved by Hui Jia Studio

The software for free software, allowing use, copy,
Modify and distribute the software and files. Any
Use this software must place a copy of the
Above copyright notice. By the Software Huijia Studio
Maintenance, if you are have any queries please contact us.
Thank you.
//
This software is free software that allows the use, copying, modification and distribution of the software and its documentation.
Any copies of the above copyright notices will be available wherever this software is used. This software is provided by the
Hui Jia 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 whether an HTML file has been generated, and jumps to an HTML page if it is generated ___________begin__________*/
$qstring = Isset ($_server["query_string"])? $_server["Query_string"]: "";
if ($qstring)//program adds a 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 ())//To determine whether the last generation of HTML file in the past 1 times, if not to output directly the contents of the file
{
if ($show _html)//is displayed in an HTML static page (0 does not show HTML display 1 with HTML display)
{
if ($go _html)//whether directly to the HTML file display or PHP read content output (0:php read content Output 1: Direct turn)
{
Header ("Location:"). html_file);/Direct turn
}
Else
{
Echo (file_get_contents (html_file));//Read exhibited
}
Exit (0);
}
}
}
/*___________ determines whether an HTML file has been generated, and jumps to an HTML page if it is generated ___________end__________*/
?>

<?php
///////////////////////////////////////////////////////////////////////////////
//
Zhangshulin-Hui Jia Studio
//
Module Name:index.php
Abstract: Home Information
version:1.0
Date 2006-11-7
Author:woods Zhang
website:http://www.hoojar.com/
Cemail:hoojar@163.com
Msn:hoojar@hotmail.com
Copyright 2001-2006, Hoojar studio all Rights Reserved
//
Copyright 2001-2006, All rights reserved by Hui Jia Studio

The software for free software, allowing use, copy,
Modify and distribute the software and files. Any
Use this software must place a copy of the
Above copyright notice. By the Software Huijia Studio
Maintenance, if you are have any queries please contact us.
Thank you.
//
This software is free software that allows the use, copying, modification and distribution of the software and its documentation.
Any copies of the above copyright notices will be available wherever this software is used. This software is provided by the
Hui Jia Studio Maintenance, if you have any questions please contact us. Thank you for using.
//
///////////////////////////////////////////////////////////////////////////////
Require ("woods-thtml.php");//Generate HTML Processing headers
if (count ($_get) < 1 && count ($_post) < 1) {require ("woods-thtml.php"); Generate HTML Processing headers

Require ("{$exec _file}");//Register language definition file
foreach ($lang as $key => $value)
{
$ATPL [Strtoupper ($key). " _lang "] = $value;
}
/*____________________________________ list Common sense go up the item __________________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 Operations _________________________end___________________________________*/
Require ("woods-bhtml.php");//Generate HTML processing tail
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.