帝國(guó)cms 批量定期審核 代碼 或者插件 我知道帝國(guó)cms 任務(wù)可以自動(dòng)刷新主頁(yè)和欄目
將下面的代碼添加到主頁(yè)模板中,量放在底部。
在/e/建立文件夾htmlindex并設(shè)置777權(quán)限
保存以下代碼/e/htmlindex/index_html.php
修改刷新時(shí)間,將文件中的1200改為您想要的時(shí)間,單位為秒。
require("../class/connect.php");
include("../class/db_sql.php");
include("../class/config.php");
include("../class/functions.php");
include("../class/t_functions.php");
requireLoadLang("pub/fun.php");
require("../data/dbcache/class.php");
require("../data/dbcache/MemberLevel.php");
include("../class/chtmlfun.php");
$link=db_connect();
$empire=newmysqlquery();
$filepath_s="indexhtmlhc.txt";
$time=time();
@$filemtime=(int)filemtime($filepath_s) 1200;
file_exists()函數(shù)檢查文件或目錄是否存在。
mkdir()函數(shù)創(chuàng)建目錄。
time()函數(shù)返回當(dāng)前時(shí)間Unix時(shí)間戳。
filemtime()函數(shù)返回文件內(nèi)容上次的修改時(shí)間。
if(!file_exists($filepath_s)){
fopen($filepath_s,'w');
@chmod($filepath_s,0777);
ReIndex();
}elseif(!file_exists($filepath_s)||(filemtime($filepath_s) 1200)
評(píng)論