TypechoJoeTheme

Dcr163的博客

统计

phpcms栏目文章添加取消审核+通过审核

2019-03-26
/
0 评论
/
951 阅读
/
正在检测是否收录...
03/26

phpcms栏目文章添加取消审核+通过审核,和工作流的审核不一样有所区别。在使用PHPCMS的时候发现文章列表没有取消审核通过的状态,在使用中可能碰到需要某篇文章给取消显示,就是所谓的“删除”,但是过几天或一个月又想恢复这个在phpcms发现没有这个小功能。所以自己在使用中增加了这个小小的“取消通过”的功能,废话不多说,直接上流程:

phpcms栏目文章添加取消审核+通过审核,和工作流的审核不一样有所区别
一、修改文件: /phpcms/modules/content/templates/content_list.tpl.php
	把		|
	替换成(大概17行)		|不通过列表|

	
	在		

	下方新增
        
        
        
        
            
        	

    在
    	function confirm_delete(){
			if(confirm(' L('selected')));?>')) $('#myform').submit();
		}
	下方新增
		//弹窗
		function confirm_changeStatus(){
			if(confirm('确定要取消通过吗?')) $('#myform').submit();
		}	

二、修改文件:/phpcms/modules/content/content.php
	在
		if(isset($_GET['reject'])) $status = 0;
	下方新增(大概66左右)
		if(isset($_GET['change_status']) && intval($_GET['change_status'])==1 ) $status = 0; //xj 190326 普通栏目取消审核列表

	新增方法:
	    /**
	     * dcr 190326 批量取消通过文章
	     */
	    public function change_status() {
	        if(isset($_GET['dosubmit'])) {
	            $catid = intval($_GET['catid']);
	            $status = 0; //文章状态不通过
	            if(!$catid) showmessage(L('missing_part_parameters'));
	            $modelid = $this->categorys[$catid]['modelid'];
	            $this->db->set_model($modelid);
	            if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
	            $idStr = implode(',', array_keys(array_flip($_POST['ids'])) ); //转换成字符串
	            $this->db->update(array('status'=>$status),"id IN ($idStr)");
	            showmessage(L('operation_success'));
	        } else {
	            showmessage(L('operation_failure'));
	        }
	    }
	    /**
	     * dcr 190326 普通过审内容
	     */
	    public function pass_change() {
	        $catid = intval($_GET['catid']);
	        if(!$catid) showmessage(L('missing_part_parameters'));
	        if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
	        $category = $this->categorys[$catid];
	        $setting = string2array($category['setting']);
	        $modelid = $this->categorys[$catid]['modelid'];
	        $this->db->set_model($modelid);
	        $html = pc_base::load_app_class('html', 'content');
	        $this->url = pc_base::load_app_class('url', 'content');
	        if (isset($_POST['ids']) && !empty($_POST['ids'])) {
	            if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
	            $idStr = implode(',', array_keys(array_flip($_POST['ids'])) ); //转换成字符串
	            $this->db->update(array('status'=>99),"id IN ($idStr)");
	            showmessage(L('operation_success'));
	        }else{
	            showmessage('Hei HeiKe',HTTP_REFERER);
	        }
	    }	

			




按照上面的修改方式即可实现把指定文章给“删除”,之后还可以还原的功能。

朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

https://dcr163.cn/397.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. William Tardent
    2024-02-27
  2. Maryann Hamer
    2024-02-27
  3. Sanora Pantano
    2024-02-24
  4. aa
    2024-02-21
  5. Kassie Baum
    2024-01-28

标签云