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 ); |
|