Function Staticindex (){ $ Content = $ Smarty -> Fetch('index.html ', True ); // This is the built-in function for generating static pages. $ Static_name = Root_path.'index.html '; // This is the current path file for generating static pages Fopen ( $ Static_name , 'A '); // Open this file @ File_put_contents ( $ Static_name , $ Content ); // Last written in Return True ;} // Static list page, static by category Function Staticcontent (){ // Number of static calls required $ IDS =Array (); // Get all content $ IDS = $ This -> Getlistids (); // This method gets all the content. The red text below corresponds to its method. Foreach ( $ IDS As $ K => $ Value ){ // Echo $ value ['catid']; If (! File_exists (Root_path. 'demo /')){ // Check whether this folder is in the root directory. If not, create the demo folder. Mkdir (Root_path. 'demo /' );} If (! File_exists (Root_path. 'demo /'. $ Value ['Catid']) { // Check whether there is a corresponding category folder under this folder. Mkdir (Root_path. 'demo /'. $ Value ['Catid']);} $ Html_content = $ This -> Getdemocontent ( $ Value ['Demoid' ]); $ Static_name = Root_path. 'demo /'. $ Value ['Catid']. '/'. $ Value Using 'demoid'0000.'.html' ; Fopen ( $ Static_name , 'A' );@ File_put_contents ( $ Static_name , $ Html_content );} Return True ;} // Obtain the page ID to be static Function Getlistids (){ $ SQL = "Select * from { $ This -> Tablepre} demo order by demoid ASC" ; $ Rs =$ This -> DB-> getall ( $ SQL ); If ( $ Rs ){ Return $ Rs ;} Else { Return False ;}} // Static content single page Function Getdemocontent ( $ ID ){ Global $ Smarty , $ View_templates , $ Admin_templates ; Loadmodel ( Array ('Demo' )); $ Demo = New Demo (); $ Content =''; $ Smarty -> Template_dir = root_path. $ View_templates ; $ Getmobanone = $ This -> Getmobandetail ( $ ID ); $ Mobandetail = $ Demo -> Mobanlist ( $ ID ); Foreach ( $ Mobandetail As $ K => $ V ){ $ Smarty -> Assign ( $ K , $ V );} $ This -> Catid = $ Getmobanone ['Catid' ]; $ Smarty -> Assign ('pre _ title ', $ Mobandetail ['Membername' ]); $ Smarty -> Assign ('mobandetail ', $ Mobandetail ); $ Content = $ Smarty -> Fetch('demo_show.html ', True ); $ Smarty -> Template_dir = root_path. $ View_templates ; Return $ Content ;}