您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 莆田分类信息网,免费分类信息发布

织梦如何实现自动更新主页功能

2024/3/25 1:36:46发布26次查看
织梦如何实现自动更新主页功能?
推荐学习:织梦cms
织梦dedecms实现自动更新主页功能
<?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'"); } ?>
以上就是织梦如何实现自动更新主页功能的详细内容。
莆田分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录