帝国cms自动审核
时间:2024年03月29日
/来源:网络
/编辑:佚名
帝国cms自动审核插件代码
复制代码
<?php
//使用密码控制
if(empty($_GET['pwd']) || $_GET['pwd'] != '脚本运行密码,请自行修改'){
die('cao!');
}
define ( 'EmpireCMSAdmin', '1' );
require ("../class/connect.php");
require ("../class/db_sql.php");
require ("../class/functions.php");
require ("../class/t_functions.php");
require ("../data/dbcache/class.php");
require ("../data/dbcache/MemberLevel.php");
$link = db_connect ();
$empire = new mysqlquery ();
$enews = $_POST ['enews'];
if (empty ( $enews )) {
$enews = $_GET ['enews'];
}
//参数
$news_table = "news"; //新闻表
$news_num = 1; //每次审核条数
/**
*使用时间控制审核的栏目,下面的代码因为栏目太多,每天分三个时段更新
*实验证明这个效果是不好的,收录只有早上的那次
*
$hours = date ( 'H' );
switch($hours){
//频道和列表
case '8': $where = "bclassid = 0 or classid between 33 and 86";
break;
case '13': $where = "bclassid = 0 or classid between 87 and 139";
break;
case '22': $where = "bclassid = 0 or classid between 140 and 192";
break;
default: $where = "classid='10000'";
}
*/
$where = '1'; //审核新闻模型全部栏目
$class_list = $empire->query ( "SELECT classid,islast from {$dbtbpre}enewsclass where $where" );
$class = array ();
$pclass = array ();
while ( $r = $empire->fetch ( $class_list ) ) {
if ($r ['islast'] == '0') {
array_push ( $pclass, $r ['classid'] ); // 非终极栏目不可以发不信息,所以不参与信息审核
} else {
array_push ( $class, $r ['classid'] );
}
}
foreach ( $class as $key => $val ) {
ecmscheck ( $val, $news_table, $news_num ); // 审核
}
// 刷新非终极栏目
foreach ( $pclass as $key => $value ) {
echo '上级栏目'.$value.'已经更新<hr/>';
ReListHtml ( $value, 1 );
}
ReIndex(); //刷新首页
/**
*
* @param $classid
* @param $table
* @param $num
*/
function ecmscheck($classid, $table, $num) {
global $empire, $class_r, $dbtbpre;
$time = time ();
// 每周一审核的设置为推荐
$isgood = '0';
$day = strftime ( "%A" );
if ($day == 'Monday') {
$isgood = '1';
}
$res = $empire->query ( "select id from {$dbtbpre}ecms_" . $table . "_check where classid =" . $classid . " ORDER BY `truetime` ASC LIMIT {$num}" );
while ( $r = $empire->fetch ( $res ) ) {
$data [] = $r ['id'];
}
CheckNews_auto ( $classid, $data );
}
/**
* 审核信息
* @param $classid
* @param $id
*/
function CheckNews_auto($classid, $id) {
global $empire, $class_r, $dbtbpre, $emod_r, $adddatar;
$classid = ( int ) $classid;
$count = count ( $id );
$time = time();
//每周一审核的设置为推荐
$isgood = strftime('%A') == 'Monday'?1:0;
for($i = 0; $i < $count; $i ++) {
$infoid = ( int ) $id [$i];
$infor = $empire->fetch1 ( "select * from {$dbtbpre}ecms_" . $class_r [$classid] [tbname] . "_check where id='$infoid' limit 1" );
//$picurl = empty($infor['titlepic'])?'/images/smallpic/'.rand(1,300).'.jpg':$infor['titlepic']; //为了网站能好看点设置一个1-300的随机图片
$res = $empire->query("update {$dbtbpre}ecms_".$class_r[$classid][tbname]."_check set truetime='$time',newstime='$time',lastdotime='$time',isgood='$isgood' where id='$infoid' limit 1");
$sql = $empire->query ( "update {$dbtbpre}ecms_" . $class_r [$classid] [tbname] . "_index set checked=1,truetime='$time',newstime='$time',lastdotime='$time' where id='$infoid'" );
// 未审核表转换
MoveCheckInfoData ( $class_r [$classid] [tbname], 0, $infor ['stb'], "id='$infoid'" );
// 更新栏目信息数
AddClassInfos ( $infor ['classid'], '', '+1' );
// 刷新信息
GetHtml ( $infor ['classid'], $infor ['id'], $infor, 0 );
echo '信息 '.$infor ['id'].' 内容页已经更新<hr/>';
// 刷新列表
ReListHtml ( $infor ['classid'], 1 );
echo '终极栏目 '.$infor ['classid'].' 已经更新<hr/>';
}
}
//刷新首页
function ReIndex(){
$indextemp=GetIndextemp();//取得模板
NewsBq($classid,$indextemp,1,0);
echo '首页已经刷新';
}
复制代码
复制代码
<?php
//使用密码控制
if(empty($_GET['pwd']) || $_GET['pwd'] != '脚本运行密码,请自行修改'){
die('cao!');
}
define ( 'EmpireCMSAdmin', '1' );
require ("../class/connect.php");
require ("../class/db_sql.php");
require ("../class/functions.php");
require ("../class/t_functions.php");
require ("../data/dbcache/class.php");
require ("../data/dbcache/MemberLevel.php");
$link = db_connect ();
$empire = new mysqlquery ();
$enews = $_POST ['enews'];
if (empty ( $enews )) {
$enews = $_GET ['enews'];
}
//参数
$news_table = "news"; //新闻表
$news_num = 1; //每次审核条数
/**
*使用时间控制审核的栏目,下面的代码因为栏目太多,每天分三个时段更新
*实验证明这个效果是不好的,收录只有早上的那次
*
$hours = date ( 'H' );
switch($hours){
//频道和列表
case '8': $where = "bclassid = 0 or classid between 33 and 86";
break;
case '13': $where = "bclassid = 0 or classid between 87 and 139";
break;
case '22': $where = "bclassid = 0 or classid between 140 and 192";
break;
default: $where = "classid='10000'";
}
*/
$where = '1'; //审核新闻模型全部栏目
$class_list = $empire->query ( "SELECT classid,islast from {$dbtbpre}enewsclass where $where" );
$class = array ();
$pclass = array ();
while ( $r = $empire->fetch ( $class_list ) ) {
if ($r ['islast'] == '0') {
array_push ( $pclass, $r ['classid'] ); // 非终极栏目不可以发不信息,所以不参与信息审核
} else {
array_push ( $class, $r ['classid'] );
}
}
foreach ( $class as $key => $val ) {
ecmscheck ( $val, $news_table, $news_num ); // 审核
}
// 刷新非终极栏目
foreach ( $pclass as $key => $value ) {
echo '上级栏目'.$value.'已经更新<hr/>';
ReListHtml ( $value, 1 );
}
ReIndex(); //刷新首页
/**
*
* @param $classid
* @param $table
* @param $num
*/
function ecmscheck($classid, $table, $num) {
global $empire, $class_r, $dbtbpre;
$time = time ();
// 每周一审核的设置为推荐
$isgood = '0';
$day = strftime ( "%A" );
if ($day == 'Monday') {
$isgood = '1';
}
$res = $empire->query ( "select id from {$dbtbpre}ecms_" . $table . "_check where classid =" . $classid . " ORDER BY `truetime` ASC LIMIT {$num}" );
while ( $r = $empire->fetch ( $res ) ) {
$data [] = $r ['id'];
}
CheckNews_auto ( $classid, $data );
}
/**
* 审核信息
* @param $classid
* @param $id
*/
function CheckNews_auto($classid, $id) {
global $empire, $class_r, $dbtbpre, $emod_r, $adddatar;
$classid = ( int ) $classid;
$count = count ( $id );
$time = time();
//每周一审核的设置为推荐
$isgood = strftime('%A') == 'Monday'?1:0;
for($i = 0; $i < $count; $i ++) {
$infoid = ( int ) $id [$i];
$infor = $empire->fetch1 ( "select * from {$dbtbpre}ecms_" . $class_r [$classid] [tbname] . "_check where id='$infoid' limit 1" );
//$picurl = empty($infor['titlepic'])?'/images/smallpic/'.rand(1,300).'.jpg':$infor['titlepic']; //为了网站能好看点设置一个1-300的随机图片
$res = $empire->query("update {$dbtbpre}ecms_".$class_r[$classid][tbname]."_check set truetime='$time',newstime='$time',lastdotime='$time',isgood='$isgood' where id='$infoid' limit 1");
$sql = $empire->query ( "update {$dbtbpre}ecms_" . $class_r [$classid] [tbname] . "_index set checked=1,truetime='$time',newstime='$time',lastdotime='$time' where id='$infoid'" );
// 未审核表转换
MoveCheckInfoData ( $class_r [$classid] [tbname], 0, $infor ['stb'], "id='$infoid'" );
// 更新栏目信息数
AddClassInfos ( $infor ['classid'], '', '+1' );
// 刷新信息
GetHtml ( $infor ['classid'], $infor ['id'], $infor, 0 );
echo '信息 '.$infor ['id'].' 内容页已经更新<hr/>';
// 刷新列表
ReListHtml ( $infor ['classid'], 1 );
echo '终极栏目 '.$infor ['classid'].' 已经更新<hr/>';
}
}
//刷新首页
function ReIndex(){
$indextemp=GetIndextemp();//取得模板
NewsBq($classid,$indextemp,1,0);
echo '首页已经刷新';
}
复制代码
新闻资讯 更多
- 【帝国cms教程】帝国CMS模板变量$GLOBALS[navclassid]用法分析04-03
- 【帝国cms教程】鲜为人知帝国CMS内容页调用上一篇和下一篇的精华方法汇总04-03
- 【帝国cms教程】怎么快速找出帝国CMS数据库配置文件路径及迁移网站后修改技巧!04-03
- 【帝国cms教程】帝国CMS模板$GLOBALS[navclassid]用法详解04-03
- 【帝国cms教程】帝国cms 7.5版列表页分页样式修改笔记04-02
- 【帝国cms教程】解决帝国CMS搜索页面模板不支持灵动标签和万能标签的方法04-02
- 【帝国cms教程】帝国CMS只备份栏目和模板的方法04-02
- 【帝国cms教程】帝国CMS怎样删除清空数据库记录?04-02
热门文章
- 178Moban源码谈谈免费源码与收费源码的区别
- 2帝国CMS忘记后台登陆用户名、密码、认证码的解决方法
- 3帝国CMS(EmpireCMS) v7.5后台任意代码执行漏洞及具体修复方法
- 4帝国CMS和WordPress 哪个好?哪个适合建站?
- 5如何解决Discuz的密码错误次数过多请15分钟后登陆的问题
- 6帝国cms灵动标签取得内容和栏目链接地址
- 7emlog pro 注册码“开心”教程(如果有一天,emlog官方版 或者 emlog免费版 跑路了,那用户怎么办?)
- 8织梦CMS在nginx下设置伪静态方法(附nginx伪静态规则)
- 9帝国cms后台登录出现”您还未登录”怎么解决?
- 10帝国cms7.5忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法