<?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自动更新主页方法
我的站长站
2020-11-07
共人阅读
最新更新
-
织梦CMS一键清除站外网址链接SQL语句
我们大量采集或者复制内容,就会遗漏许多的站外网址链接,一个个清除,总会有漏网之鱼,那么可以用SQL一键清除站外...
-
织梦CMS列表页调用软件大小方法
织梦CMS在软件列表页调用软件大小,默认调用方法:{dede:list pagesize='10'}[field:softsize/]{/dede:...
-
织梦CMS更新广告不显示BUG修复方法
原因分析织梦CMS后台更新了广告,但前台依旧不显示没变化,这个原因基本都是缓存的问题,如何修复这个BUG了,我的站...
-
修改织梦cms标签TAG不限制长度
织梦cms标签默认长度只能写12个字符,也就是6个汉字,多出的字符就会自动截断或直接不入库,下面我的站长站分享如...
-
{dede:arclist keyword='动态获取关键词'}bug修复
{dede:arclist keyword='关键词'}来调用文章列表时,只在其中一个栏目里生效,在其他栏目,仍然显示上一...