|
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 = 10800;//自动更新时间,单位为秒 |
|
12 |
$fpath = "../data/last_time.inc";//记录更新时间文件,如果不能达到目的,请检查是否有读取权限。 |
|
14 |
if( empty($last_time)) |
|
16 |
if( sp_input($_GET['renew'])=="now") |
|
17 |
$last_time = 0; if((time()-$last_time)>=$autotime ) |
|
19 |
define('DEDEADMIN', ereg_replace("[/\]{1,}",'/',dirname(__FILE__) ) ); |
|
20 |
require_once(DEDEADMIN."/../include/common.inc.php"); |
|
21 |
require_once(DEDEINC."/arc.partview.class.php"); |
|
22 |
/* $row = $dsql->GetOne("Select * From dede_homepageset"); |
|
24 |
$templet=$row['templet']; |
|
25 |
$position=$row['position']; |
|
27 |
$templet = “default/index.htm”;//这里是首页<U><A href="http://www.dederen.com" target=_blank>模板</A></U>位置,当前是dede默认首面位置。 |
|
28 |
$position = "../index.html"; |
|
29 |
$homeFile = dirname(__FILE__)."/".$position; |
|
30 |
$homeFile = str_replace("\", "/", $homeFile ); |
|
31 |
$homeFile = str_replace( "//", "/", $homeFile ); |
|
33 |
$pv ->SetTemplet( $cfg_basedir.$cfg_templets_dir."/".$templet ); |
|
34 |
$pv -> SaveToHtml( $homeFile ); |
|
36 |
$file = fopen( $fpath, "w"); |
|
37 |
fwrite( $file, "<?php "); |
|
38 |
fwrite( $file,"$last_time=".time()."; "); |
|
39 |
fwrite( $file, '?>' ); fclose( $file ); |
|