php
require_once (dirname(__FILE__) . “/../include/common.inc.php”);
$row = $dsql->GetOne(“Select uptime From `cmsxx_arccache` where md5hash = ‘autonew‘;”);
if(!is_array($row)) exit(autonew(5));
$interval=60; //时间 秒
if(time() – $row[‘uptime'] < $interval ) exit();
autonew($no);
function machom($no=”){
define(‘DEDEADMIN', ereg_replace(“[/\]{1,}”,'/',dirname(__FILE__) ) );
require_once(dirname(__FILE__).”/../include/common.inc.php”);
require_once(dirname(__FILE__).”/../include/arc.partview.class.php”);
$dsql = new DedeSql(false);
$row = $dsql->GetOne(“Select * From cmsxx_homepageset”);
$dsql->Close();
$templet=$row[‘templet'];
$position=$row[‘position'];
$homeFile = DEDEADMIN.”/”.$position;
$homeFile = str_replace(“\”,”/”,$homeFile);
$homeFile = str_replace(“//”,”/”,$homeFile);
$templet = str_replace(“{style}”,$cfg_df_style,$templet);
$pv = new PartView();
$GLOBALS[‘_arclistEnv'] = ‘index';
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir.”/”.$templet);
$pv->SaveToHtml($homeFile);
}
function autonew($no=”){
global $dsql;
$sql = “SELECT id FROM `cmsxx_archives` where arcrank <>'0′ limit $no ;”;
$dsql->SetQuery($sql);
$dsql->Execute();
while($row = $dsql->GetArray()){
$id = $row[‘id'];
$time = time() – rand(0,$interval * 10);
$dsql->ExecuteNoneQuery(“Update `cmsxx_arctiny` set `arcrank`='0′, `sortrank`='$time' where id = ‘$id';”);
$dsql->ExecuteNoneQuery(“Update `cmsxx_archives` set `arcrank`='0′, `sortrank`='$time', `pubdate`='$time' where id = ‘$id';”);
}
machom($no);
$dsql->ExecuteNoneQuery(“Update `cmsxx_arccache` set `uptime`=”.time().” where md5hash = ‘autonew'”);
}
?>
织梦模板DEDECMS实现自动更新主页功能的代码
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《织梦模板DEDECMS实现自动更新主页功能的代码》
文章链接:https://www.ibytx.com/748.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
文章名称:《织梦模板DEDECMS实现自动更新主页功能的代码》
文章链接:https://www.ibytx.com/748.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
相关推荐
#十月狂欢#Hostease:购虚拟主机送独立IP,购买美国/香港服务器,加送125个独立IP,可选不同C段,新老同享,先到先得,送完即止
#即将结束#SiteGround:19周年庆特别优惠,外贸主机/WordPress主机,年付低至$23.88,月付$1.99起
SiteGround:19周年庆特别优惠,外贸主机/WordPress主机,年付低至$23.88,月付$1.99起
bacloud黑五促销:便宜服务器,E5v4U26Q独立服务器6折,Linux KVM VPS 5折,虚拟主机7折,可选美国/荷兰/立陶宛机房
php中方法和函数的区别
Laravel框架Warning: require(../vendor/autoload.php): failed to open stream: No such file or directory in .../autoload.php on line 17错误的解决办法
php获取前一小时、前一天、三天前、前一个月、三个月前、前一年的时间
php数组去重函数array_unique()

博悦天下


