帝国cms定时审核并更新的方法

 比如你网站采集了成千上万篇文章,不可能一下子全部放出来的,所以为了模拟人工发布,那么就需要定时审核发布文章内容,本文内容核心解决了更加个性化的逼真模拟人工更新网站内容。

  第一:首先要满足你的表中有未审核的数据

  第二:到http://bbs.phome.net/showthread-31-196160-0.html 下载定时更新插件

      第三:在插件的文件夹中创建checked.php 内容如下:

<?php
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
require "../".LoadLang("pub/fun.php");
require("../../class/delpath.php");
require("../../class/copypath.php");
require("../../class/t_functions.php");
require("../../data/dbcache/class.php");
require("../../data/dbcache/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//更新标准表开始
$update1=$empire->query("select * from {$dbtbpre}ecms_biaozhun_index  where checked=0  order by id  ASC limit 80"); //随机取信息请用order by rand()
$rowCounter = 0; 
while($r1=$empire->fetch($update1)){
     $rowCounter++; // 增加行计数器  
     $id=$r1[id];
     $classid=$r1[classid];
     $baseTime = time(); // 当前时间  
     $increment = 180; // 每次递增的秒数(可以调整)  
     $infouptime = $baseTime + ($increment * $rowCounter); // 上线时间  
     $pubid=ReturnInfoPubid($classid,$id);
     $copyids='';
     $num1=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsinfovote where pubid='$pubid'");
     $nihoam1=$empire->query("update {$dbtbpre}ecms_biaozhun_check set newstime='$infouptime' where id='$id'");
     if($num1)        //修改
     {
     $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');");
     }
}
//更新标准表结束
?>

其中注意你的表名

宝塔中设置如下图

http://baidu.com/e/extend/DoTimeRepage/checked.php

继续增加/e/extend/DoTimeRepage/

定时审核教程结束

  • 11
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郑叔敲代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值