您现在的位置是:首页 > 教程 > dedecms教程dedecms教程
dede织梦实现未审核内容每分钟审核一篇并更新至首页的方法
林文冲2023-10-13 20:00:13dedecms教程已有人查阅
导读plus下新建文件 makeid.php 内容如下:然后在首页模板里面之后面加入;就ok了
plus下新建文件 makeid.php 内容如下:
<?php
$lasttime=filemtime($_SERVER['DOCUMENT_ROOT']."/index.html");
$interval=180; //更新时间秒为单位180秒=3分钟 3分钟审核一篇 代码号:www.ebingou.cn
if((time()-$lasttime)>$interval)
{
require_once(dirname(__FILE__)."/../include/common.inc.php");
$row = $dsql->GetOne("select id from`dede_archives` where arcrank = -1"); // 找到未审核的文章排序根据你的要求修改下
$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("无法更新网站主页到:$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了
本文标签:
很赞哦! ()
相关文章
随机图文
dedecms5.6留言本插件怎么调用{dede:}标签或头部尾部
今天在仿一套DEDECMS模板的时候正好碰到了需要制作dedecms系统自带的留言板插件模板!百度搜索了下,有很多人都想在留言本guestbook.htm里实现dede的标签调用dede织梦验证码不显示的解决方法
织梦程序验证码突然不显示,大家可以按如下步骤去排查: 1.下载文件data/safe/inc_safe_config.php到本地,用记事本打开,检查最末godday空间下的织梦cms出现Internal Server Error ...
最近在用godday空间的时候 遇到这个问题 更新的时候出现Internal Server Error ...错误在多方求证织梦dedecms用栏目交叉时arclist标签不能调出相关文章的解决方法
打开include/taglib/arclist.lib.php文件从数据库可以看出当栏目为不交叉时cross的值为0当栏目为自动获取同名栏目时cross的值为1当栏目为手动指定ID时cross的值为2
留言与评论 (共有 条评论) |