二、增加前台定时执行刷新任务插件(官方有)
三、后台栏目>增加自定义页面名称随意
自定义页面内容如下:
<?php
$sql=$empire->query("select * from {$dbtbpre}ecms_".$class_r[1][tbname]."_index where checked=0 order by id limit 10"); //随机取信息请用order by rand()
while($r=$empire->fetch($sql)){
$id=$r[id];
$classid=$r[classid];
$infouptime=time()+rand(300,600); //上线时间 当前时间+300-600是秒自己换算 默认是(300,600)
$pubid=ReturnInfoPubid($classid,$id);
$copyids='';
$num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsinfovote where pubid='$pubid'");
$nihoam=$empire->query("update {$dbtbpre}ecms_".$class_r[1][tbname]."_check set newstime='$infouptime' where id='$id'");
if($num) //修改
{
$empire->query("update {$dbtbpre}enewsinfovote set copyids='$copyids',infouptime='$infouptime' where pubid='$pubid' limit 1");
}
else //增加
{
$intime=$empire->query("insert into {$dbtbpre}enewsinfovote(pubid,id,classid,infouptime,copyids) values ('$pubid','$id','$classid','$infouptime','$copyids');");
}
}
?>
四、添加计划任务->管理定时刷新任务(刷新添加的自定义页面)
注意:前台定时执行刷新任务需要用户访问页面才可以执行。