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

资源来源网络,如需授权,请更换源码,模块仅供学习,如需商用请购买正版授权,本栏目不提供技术服务,积分不够请签到!如何签到?系统升级暂停签到,恢复关注公告!
如遇下载链接蓝奏网盘打不开lanzous替换成lanzoux尝试! 广告

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

织梦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'”); } ?>

以上就是织梦如何实现自动更新主页功能的详细内容,更多请关注风格酷其它相关文章!

©下载资源版权归作者所有;本站所有资源均来源于网络,仅供学习使用,请支持正版!
风格酷模板网 » 织梦如何实现自动更新主页功能
NOTICE:【咨询风格酷】客服QQ:1131734965
NOTICE:【咨询风格酷】客服微信:wwwxmamnet
NOTICE:【风格酷模板网②群】QQ群:288678775
☉免责声明:本站所有模板均来自用户分享和网络收集,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。
☉如果源码网盘地址失效!或有其他问题,请点我报错,谢谢合作!
☉人民币与积分汇率为1比10,即1元=10积分.有任何疑问请联系客服
☉如有其他问题,请加网站客服QQ(1131734965)进行交流。
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解!
☉源码、模板等资源会随着技术、环境的升级而存在部分问题,还请慎重选择。

发表评论

风格酷模板网www.xmam.net分享优质网站模板

立即查看 了解详情