1、打开 api/count.php 文件,在PHP语句结束代码 ?> 前,加入以下代码:
//add CMS集中营 www.cmsjzy.cn 定时发布审核功能
$urlobj = pc_base::load_app_class('url', 'content');
$html = pc_base::load_app_class('html', 'content');
$modelid = $modelid ? $modelid : intval($_GET['modelid']);
$content_db = $content_db ? $content_db : pc_base::load_model('content_model');
$content_db->set_model($modelid);
$where = ' status = 1 and inputtime <= '.SYS_TIME;
$r = $content_db->count($where);
if( !empty($r) ){ //执行update操作
$ids = $content_db->select($where, 'id,catid', $r, '', '', 'id');
foreach($ids AS $kid=>$v){
$catid = $v['catid'];
$id = $kid;
$r = $content_db->get_content($catid,$id);
$urls = $urlobj->show($id, 0, $catid, $r['inputtime'], $r['prefix'],$r,'add');
if($urls['content_ishtml']) $html->show($urls[1],$urls['data'],0);
$html->index();
$html->create_relation_html($catid);
}
$content_db->update( array('status'=>99),$where );
}
//end CMS集中营 www.cmsjzy.cn
这样,我们借统计代码在更新的时候,让需要审核的文章在预定的时间点通过发布。
2、在文章页面的模板里边添加统计代码:
<script language="Javascript" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20480%20640'%3E%3C/svg%3E" loading='lazy' data-lazy-src="http://1.com/skin/default/image/nopic.gif">
默认的模板里边已经默认添加了这句统计代码,检查下,这样文章在被浏览的时候,触发这个JS,就会执行第一步添加的通过审核代码。
//add CMS集中营 www.cmsjzy.cn 定时发布审核功能
$urlobj = pc_base::load_app_class('url', 'content');
$html = pc_base::load_app_class('html', 'content');
$modelid = $modelid ? $modelid : intval($_GET['modelid']);
$content_db = $content_db ? $content_db : pc_base::load_model('content_model');
$content_db->set_model($modelid);
$where = ' status = 1 and inputtime <= '.SYS_TIME;
$r = $content_db->count($where);
if( !empty($r) ){ //执行update操作
$ids = $content_db->select($where, 'id,catid', $r, '', '', 'id');
foreach($ids AS $kid=>$v){
$catid = $v['catid'];
$id = $kid;
$r = $content_db->get_content($catid,$id);
$urls = $urlobj->show($id, 0, $catid, $r['inputtime'], $r['prefix'],$r,'add');
if($urls['content_ishtml']) $html->show($urls[1],$urls['data'],0);
$html->index();
$html->create_relation_html($catid);
}
$content_db->update( array('status'=>99),$where );
}
//end CMS集中营 www.cmsjzy.cn
这样,我们借统计代码在更新的时候,让需要审核的文章在预定的时间点通过发布。
2、在文章页面的模板里边添加统计代码:
<script language="Javascript" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20480%20640'%3E%3C/svg%3E" loading='lazy' data-lazy-src="http://1.com/skin/default/image/nopic.gif">
默认的模板里边已经默认添加了这句统计代码,检查下,这样文章在被浏览的时候,触发这个JS,就会执行第一步添加的通过审核代码。
热门信息
阅读 (175)
1 phpcms v9 数据表结构(三)阅读 (170)
2 phpcms v9 数据表结构(八)阅读 (151)
3 PHPSSO配置阅读 (148)
4 phpcms v9缩略图裁剪后出现黑边的解决方法阅读 (142)
5 phpcms v9开启、关闭在线编辑模板的方法