The front-end homepage is blank and the user experience is optimized;
Open the makehtml_homepage.php file in the default DEDE/directory! This file is mainly used to process homepage data generation;
Well, our goal is very clear. When the background generates the HTML file of the front-end homepage, it cannot be blank!
The method is very simple. I am not talking nonsense either:
First, find the following code in the file:
$remotepos = empty($remotepos)? '/index.html' : $remotepos;$isremote = empty($isremote)? 0 : $isremote;$serviterm = empty($serviterm)? "" : $serviterm;$homeFile = DEDEADMIN."/".$position;$homeFile = str_replace("\\","/",$homeFile);$homeFile = str_replace("//","/",$homeFile);
Append a piece of code after the above Code:
$homeBakFile = str_replace($position,"../index_bak.html",$homeFile);
Continue down:
$ Fp = fopen ($ homeFile, "r") or die ("the file name you specified is incorrect and cannot be created"); fclose ($ fp );
The following code is also appended:
$ Cfp = fopen ($ homeBakFile, "w") or die ("the file name you specified is incorrect and cannot be created"); fclose ($ cfp );
Continue to find:
$pv->SaveToHtml($homeFile);
Changed:
$pv->SaveToHtml($homeBakFile);
And append a piece of code below:
copy($homeBakFile,$homeFile);
OK. Now, you can generate a static Homepage without any blank page!
The principle is also very simple: generate data in another file, and then copy it to the official file!
This article from the "against the wind" blog, please be sure to keep this source http://windchaser.blog.51cto.com/5742634/1297757