校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 網(wǎng)站建設(shè) > 建站知識 > 織夢cms如何每分鐘審核一篇文章并且生成首頁

織夢cms如何每分鐘審核一篇文章并且生成首頁

POST TIME:2019-09-30 11:13

dede 每分鐘審核一篇文章并且生成首頁:
直接進入正題:
plus下新建文件 makeid.php 內(nèi)容如下:

<?php $lasttime=filemtime($_SERVER['DOCUMENT_ROOT']."/index.html"); $interval=180; //更新時間秒為單位180秒=3分鐘 3分鐘審核一篇 if((time()-$lasttime)>$interval) { require_once(dirname(__FILE__)."/../include/common.inc.php"); $row = $dsql->GetOne("select id from`dede_archives` where arcrank = -1"); // 找到未審核的文章排序根據(jù)你的要求修改下 $aid= $row['id']; if($aid!=''){ //審核文章 $upquery = "Update `dede_archives` set arcrank =0 where id='$aid';"; $upquery1 = "Update `dede_arctiny` set arcrank =0 where id='$aid';"; $rs = $dsql->ExecuteNoneQuery($upquery); $rs1 = $dsql->ExecuteNoneQuery($upquery1); $isremote = (empty($isremote)? 0 : $isremote); function MakeArt($aid, $mkindex=FALSE, $ismakesign=FALSE, $isremote=0) { global $envs, $typeid; require_once(DEDEINC.'/arc.archives.class.php'); if($ismakesign) $envs['makesign'] = 'yes'; $arc = new Archives($aid); $reurl = $arc->MakeHtml($isremote); return $reurl; } $arcID=$aid; $artUrl = MakeArt($aid,true,true,$isremote); require_once(DEDEINC.'/arc.partview.class.php'); $envs = $_sys_globals = array(); $envs['aid'] = 0; $pv = new PartView(); $row = $pv->dsql->GetOne('SELECT * FROM `cn_homepageset`'); $templet = str_replace("{style}", $cfg_df_style, $row['templet']); $homeFile = dirname(__FILE__).'/'.$row['position']; $homeFile = str_replace("//", "/", str_replace("", "/", $homeFile)); $fp = fopen($homeFile, 'w') or die("無法更新網(wǎng)站主頁到:$homeFile 位置"); fclose($fp); $tpl = $cfg_basedir.$cfg_templets_dir.'/'.$templet; if(!file_exists($tpl)) { $tpl = $cfg_basedir.$cfg_templets_dir.'/default/index.htm'; if(!file_exists($tpl)) exit("無法找到主頁模板:$tpl "); } $GLOBALS['_arclistEnv'] = 'index'; $pv->SetTemplet($tpl); $pv->SaveToHtml($homeFile); $pv->Close(); exit(); }else exit(); } ?>

然后在首頁模板里面最后面加入 <script src="/plus/mkaid.php" language="javascript"></script> 就ok了



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 南华县| 东乡县| 金山区| 九龙县| 庐江县| 黄石市| 塔河县| 泰来县| 涟源市| 泸水县| 阿图什市| 上犹县| 桐庐县| 景泰县| 兰坪| 义马市| 贵定县| 苏尼特左旗| 建水县| 左贡县| 三河市| 交城县| 新野县| 利辛县| 股票| 永清县| 谷城县| 贵溪市| 远安县| 邵阳市| 友谊县| 龙陵县| 南丹县| 乌审旗| 紫阳县| 稷山县| 浦城县| 砚山县| 贺州市| 永吉县| 云安县|