<?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'"); } ?>
织梦CMS教程
织梦CMS自动更新主页方法
织梦CMS教程
admin
2020-12-21
共人阅读
版权声明:文章搜集于网络,如有侵权请联系本站,转载请说明出处:https://www.51yma.cn/jiaocheng/dedecms/113.html
文章来源:
上一篇:织梦CMS显示用户ip地址方法
热门推荐
-
01织梦后台管理员账号或者密码忘记的解决方法!和修改管理员账号密码的插件 606
-
02织梦cms调用父级栏目链接和名称 568
-
03DEDECMS二次开发图片ALT自动换成标题 555
-
04织梦CMS调用时间标签大全 545
-
05织梦CMS调用当前会员信息方法 541