同款下载

如何给织梦添加复制文档的功能?


给织梦添加复制文档的功能步骤如下:

一、打开templets下的content_list.htm

    找到 这一行:

12321156121232

 

在这一行的下方添加:


    复制 

二、打开dede/js/list.js

找到moveArc这个函数


function moveArc(e, obj, cid){
    var qstr=getCheckboxItem();
    if(qstr=='')
    {
        alert('必须选择一个或多个文档!');
        return;
    }
    LoadQuickDiv(e, 'archives_do.php?dopost=moveArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'moveArchives', '450px', '180px');
    ChangeFullDiv('show');
}

然后在下方添加copyArc这个函数


function copyArc(e, obj, cid){
    var qstr=getCheckboxItem();
    if(qstr=='')
    {
        alert('必须选择一个或多个文档!');
        return;
    }
    LoadQuickDiv(e, 'archives_do.php?dopost=copyArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'copyArchives', '450px', '180px');
    ChangeFullDiv('show');
}

三、打开 dede/archives_do.php找到


else if($dopost=='moveArchives')
{

这句代码 然后在这个大括弧结尾处 也就是在433行左右添加如下代码:

/*-----------------------------
function copyArchives(){ }
------------------------------*/

else if($dopost=='copyArchives')
{
    CheckPurview('sys_ArcBatch');
    if(empty($totype))
    {
        require_once(DEDEINC.'/typelink.class.php');
        if( !empty($aid) && empty($qstr) ) $qstr = $aid;

        AjaxHead();
        $channelid = empty($channelid) ? 0 : $channelid;
        $tl = new TypeLink($aid);
        $typeOptions = $tl->GetOptionArray(0, $admin_catalogs, $channelid);
        $typeOptions = "";
        
        //输出AJAX可移动窗体
        $divname = 'copyArchives';
        echo "
\r\n";         echo "   
复制文档
\r\n";         echo "   
ico close - 如何给织梦添加复制文档的功能?
\r\n";         echo "
\r\n";         echo "
\r\n”;
        echo “\r\n”;
        echo “\r\n”;
        echo “\r\n”;
?>

   
   
   
   
   

 目标栏目:    
   
 文档ID:                  
          
        GetOne(“SELECT tp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystem FROM `me_arctype` tp LEFT JOIN `me_channeltype` ch on ch.id=tp.channeltype WHERE tp.id=’$totype’ “);
        $idtype = “id”;
        if(!is_array($typeInfos))
        {
            ShowMsg(‘参数错误!’,’-1′);
            exit();
        }
        if($typeInfos[‘ispart’]!=0)
        {
            ShowMsg(‘文档保存的栏目必须为最终列表栏目!’,’-1′);
            exit();
        }
        if(empty($typeInfos[‘addtable’]))
        {
            $typeInfos[‘maintable’] = ‘me_archives’;
        }
        //增加单表模型判断
        if($typeInfos[‘issystem’] == -1)
        {
            $typeInfos[‘maintable’] = $typeInfos[‘addtable’];
            $idtype = “aid”;
        }
        $arcids = preg_replace(“#[^0-9,]#”, ”, preg_replace(“#`#”, ‘,’, $qstr));
        $arc = ”;
        $j = 0;
        $okids = array();
        $dsql->SetQuery(“SELECT {$idtype},typeid FROM `{$typeInfos[‘maintable’]}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos[‘channeltype’]}’ “);
        $dsql->Execute();
        while($row = $dsql->GetArray())
        {
            if($row[‘typeid’]!=$totype)
            {
$dsql->ExecuteNoneQuery(“insert into me_arctiny (typeid,typeid2,arcrank,channel,senddate,sortrank,mid) select typeid,typeid2,arcrank,channel,senddate,sortrank,mid from me_arctiny where id='{$row[$idtype]}'”);
$xid = $dsql->GetLastID();  
                $dsql->ExecuteNoneQuery(“insert into `{$typeInfos[‘maintable’]}`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weight) select case when id>’0′ then ‘$xid’  else ” end, case when typeid>’0′ then ‘$totype’  else ” end,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords ,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weight from `{$typeInfos[‘maintable’]}` WHERE id='{$row[$idtype]}’ “);
                $dsql->ExecuteNoneQuery(“insert into `{$typeInfos[‘addtable’]}`(aid,typeid,body,redirecturl,templet,userip,bigpic) select case when aid>’0′ then ‘$xid’  else ” end,$totype,body,redirecturl,templet,userip,bigpic from `{$typeInfos[‘addtable’]}` WHERE aid='{$row[$idtype]}’ “);
                $okids[] = $row[$idtype];
                $j++;
            }
        }
        //更新HTML
        foreach($okids as $aid)
        {
            $arc = new Archives($aid);
            $arc->MakeHtml();
        }
        ShowMsg(“成功复制 $j 个文档!”, $ENV_GOBACK_URL);
        exit();
    }
}

原文链接:https://img.zhanbaozhan.com/50609–>
下载说明:

1、本站资源都是白菜价出售,同样的东西,我们不卖几百,也不卖几十,甚至才卖几块钱,一个永久会员能下载全站100%源码了,所以单独购买也好,会员也好均不提供相关技术服务。

2、如果源码下载地址失效请/联系站长QQ进行补发。

3、本站所有资源仅用于学习及研究使用,请必须在24小时内删除所下载资源,切勿用于商业用途,否则由此引发的法律纠纷及连带责任本站和发布者概不承担。资源除标明原创外均来自网络整理,版权归原作者或本站特约原创作者所有,如侵犯到您权益请联系本站删除!

4、本站站内提供的所有可下载资源(软件等等)本站保证未做任何负面改动(不包含修复bug和完善功能等正面优化或二次开发);但本网站不能保证资源的准确性、安全性和完整性,用户下载后自行斟酌,我们以交流学习为目的,并不是所有的源码都100%无错或无bug;同时本站用户必须明白,【源码源码ui网】对提供下载的软件等不拥有任何权利(本站原创和特约原创作者除外),其版权归该资源的合法拥有者所有。

5、请您认真阅读上述内容,购买即以为着您同意上述内容。

互保站 » 如何给织梦添加复制文档的功能?

发表回复