02 |
function sp_input( $text ) |
04 |
$text = trim( $text ); |
05 |
$text = htmlspecialchars( $text ); |
06 |
if (!get_magic_quotes_gpc()) |
07 |
return addslashes( $text ); |
11 |
$autotime = 3600;//自动更新时间,单位为秒,这里我设为一小时,大家可以自行更改。 |
12 |
$fpath = "../data/last_time.inc" ;//记录更新时间文件,如果不能达到目的,请检查是否有读取权限。 |
14 |
if ( empty($last_time)) |
16 |
if ( sp_input($_GET[ 'renew' ])== "now" ) |
18 |
if (( time ()-$last_time)>=$autotime ) |
20 |
define( 'DEDEADMIN' , ereg_replace( "[/\\]{1,}" , '/' , dirname (__FILE__) ) ); |
21 |
require_once(DEDEADMIN. "/../include/common.inc.php" ); |
22 |
require_once(DEDEINC. "/arc.partview.class.php" ); |
24 |
$row = $dsql->GetOne( "Select * From dede_homepageset" ); |
26 |
$templet=$row[ 'templet' ]; |
27 |
$position=$row[ 'position' ]; |
29 |
$templet = “tnbjh/index.htm”;//这里是首页模板位置,当前是dede默认首面位置www.80zhan.com织梦模板 |
30 |
$position = "../index.html" ; |
31 |
$homeFile = dirname (__FILE__). "/" .$position; |
32 |
$homeFile = str_replace( "\\" , "/" , $homeFile ); |
33 |
$homeFile = str_replace( "//" , "/" , $homeFile ); |
35 |
$pv ->SetTemplet( $cfg_basedir.$cfg_templets_dir. "/" .$templet ); |
36 |
$pv -> SaveToHtml( $homeFile ); |
38 |
$ file = fopen( $fpath, "w" ); |
39 |
fwrite( $ file , "<?php\n" ); |
40 |
fwrite( $ file , "\$last_time=" . time (). ";\n" ); |
41 |
fwrite( $ file , '?>' ); |
|