网站资讯 news
您现在的位置:首页 > 网站资讯 > 织梦网站后台增加复制文档功能
NEWS

新闻资讯

  • 织梦网站后台增加复制文档功能
    2020/09/05

    打开后台目录(/dede)下archives_do.php约430行下添加: 1 /*----------------------------- 2 //复制文档 3 ----------------...

  • 谷歌浏览器如何长截图
    2020/07/04

    很多人不知道google浏览器如何截图,今天小编就来教大家。 方法/步骤: 1,打开“谷歌浏览器”,右键单击网页空白处,然后点击“...

  • 谷歌浏览器怎么翻译网页?
    2020/07/01

    正常情况下,你的浏览器会自动提示您是否要翻译网页。 但是如果没有自动弹出,我们应该怎么样去打开这个chrome自带的网页翻译...

  • dedecms5.7发布文章提示“标题不能为空”的解决方法
    2020/06/15

    本文实例讲述了dedecms5.7后台发布文章提示“标题不能为空”的解决方法。分享给大家供大家参考。具体分析如下: 有人发现在使用...

  • WordPress 5.4发布:界面更简洁
    2020/04/15

    4月1日 消息:WordPress官方宣布,WordPress 5. 4 正式版于 3 月 31 日正式面向公众发布,这是其2020 年度的第一个主要版本,...

  • 【云风网络】复工延期通知
    2020/02/09

      尊敬的客户:由于新冠疫情原因!我公司复工延期,具体时间另行通知!期间只提供应急处理,带来不便敬请谅解!

  • 2020寒假结束昆山市开学时间可能会推迟…
    2020/01/29

    苏州关于加强新型冠状病毒感染的肺炎疫情防控工作的通告(第3号) 2020-01-26 21:32 为维护公众生命安全和身体健康,落实江苏...

织梦网站后台增加复制文档功能

发布时间:2020/09/05 网站资讯 浏览次数:287

打开后台目录(/dede)下archives_do.php约430行下添加:

  1 /*-----------------------------
  2 //复制文档
  3 ------------------------------*/
  4 elseif ($dopost == 'copyArchives') {
  5     CheckPurview('sys_ArcBatch');
  6     if (empty($totype)) {
  7         require_once(DEDEINC . '/typelink.class.php');
  8         if (!empty($aid) && empty($qstr)) $qstr = $aid;
  9  
 10         AjaxHead();
 11         $channelid = empty($channelid) ? 0 : $channelid;
 12         $tl = new TypeLink($aid);
 13         $typeOptions = $tl->GetOptionArray(0, $admin_catalogs, $channelid);
 14         $typeOptions = "<select name='totype' style='width:90%'>
 15         <option value='0'>请选择复制到的位置...</option>\r\n
 16         $typeOptions
 17         </select>";
 18  
 19         //输出AJAX可移动窗体
 20         $divname = 'copyArchives';
 21         echo "<div class='title' onmousemove=\"DropMoveHand('{$divname}', 225);\" onmousedown=\"DropStartHand();\" onmouseup=\"DropStopHand();\">\r\n";
 22         echo "    <div class='titLeft'>复制文档</div>\r\n";
 23         echo "    <div class='titRight'><img src='images/ico-close.gif' style='cursor:pointer;' onclick='HideObj(\"{$divname}\");ChangeFullDiv(\"hide\");' alt='关闭' title='关闭' /></div>\r\n";
 24         echo "</div>\r\n";
 25         echo "<form name='quickeditform' action='archives_do.php' method='post'>\r\n";
 26         echo "<input type='hidden' name='dopost' value='{$dopost}' />\r\n";
 27         echo "<input type='hidden' name='qstr' value='{$qstr}' />\r\n";
 28         echo "<table width='100%' style='margin-top:6px;z-index:9000;'>\r\n";
 29         ?>
 30         <tr height='28'>
 31             <td width="80" class='bline'> 目标栏目:</td>
 32             <td class='bline'>
 33                 <?php echo $typeOptions; ?>
 34             </td>
 35         </tr>
 36         <tr height='32'>
 37             <td width="80" class='bline'> 文档ID:</td>
 38             <td class='bline'>
 39                 <input type='text' name='tmpids' value="<?php echo $qstr; ?>" style='width:310px;overflow:hidden;'/>
 40                 <br/>
 41                 复制到的目标栏目必须和选定的文档频道类型一致,否则程序会自动勿略不符合的文档。
 42             </td>
 43         </tr>
 44         <tr height='32'>
 45             <td colspan='2' align='center' style='padding-top:12px'>
 46                 <input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" class="np"
 47                        border="0" style="cursor:pointer"/>
 48                   
 49                 <img src="images/button_back.gif" width="60" height="22" border="0"
 50                      onclick='HideObj("<?php echo $divname; ?>");ChangeFullDiv("hide");' style="cursor:pointer"/>
 51             </td>
 52             </td>
 53         </tr>
 54         </table>
 55         </form>
 56         <?php
 57         //AJAX窗体结束
 58     } else {
 59         $totype = preg_replace("#[^0-9]#", '', $totype);
 60         $typeInfos = $dsql->GetOne("SELECT tp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE tp.id='$totype' ");
 61         $idtype = "id";
 62         if (!is_array($typeInfos)) {
 63             ShowMsg('参数错误!', '-1');
 64             exit();
 65         }
 66         if ($typeInfos['ispart'] != 0) {
 67             ShowMsg('文档保存的栏目必须为最终列表栏目!', '-1');
 68             exit();
 69         }
 70         if (empty($typeInfos['addtable'])) {
 71             $typeInfos['maintable'] = '`#@__archives`';
 72         }
 73         //增加单表模型判断
 74         if ($typeInfos['issystem'] == -1) {
 75             $typeInfos['maintable'] = $typeInfos['addtable'];
 76             $idtype = "aid";
 77         }
 78         $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr));
 79         $arc = '';
 80         $j = 0;
 81         $okids = array();
 82         $dsql->SetQuery("SELECT {$idtype},typeid FROM `{$typeInfos['maintable']}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos['channeltype']}' ");
 83         $dsql->Execute();
 84         while ($row = $dsql->GetArray()) {
 85             if ($row['typeid'] != $totype) {
 86                 
 87                 $dsql->ExecuteNoneQuery("insert into `#@__arctiny` (typeid,typeid2,arcrank,channel,senddate,sortrank,mid) select typeid,typeid2,arcrank,channel,senddate,sortrank,mid from `#@__arctiny` where id='{$row[$idtype]}'");
 88                 
 89                 $xid = $dsql->GetLastID();
 90                 
 91                 $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]}' ");
 92                 
 93                 $dsql->ExecuteNoneQuery("insert into `{$typeInfos['addtable']}`(aid,typeid,body,redirecturl,templet,userip) select case when aid>'0' then '$xid'  else '' end,$totype,body,redirecturl,templet,userip from `{$typeInfos['addtable']}` WHERE aid='{$row[$idtype]}' ");
 94                 
 95                 $okids[] = $row[$idtype];
 96                 $j++;
 97             }
 98         }
 99  
100         
101     UpDateCatCache();
102     $sql = " TRUNCATE TABLE `#@__arctiny`";
103     $dsql->ExecuteNoneQuery($sql);
104     
105     //导入普通模型微数据
106     $sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)  
107             SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `#@__archives` ";
108     $dsql->ExecuteNoneQuery($sql);
109     
110     //导入单表模型微数据
111     $dsql->SetQuery("SELECT id,addtable FROM `#@__channeltype` WHERE id < -1 ");
112     $dsql->Execute();
113     $doarray = array();
114     while($row = $dsql->GetArray())
115     {
116         $tb = str_replace('#@__', $cfg_dbprefix, $row['addtable']);
117         if(empty($tb) || isset($doarray[$tb]) )
118         {
119             continue;
120         }
121         else
122         {
123             $sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)  
124                     SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb` ";
125             $rs = $dsql->executenonequery($sql);
126             $doarray[$tb]  = 1;
127         }
128     }
129         //更新HTML
130         foreach ($okids as $aid) {
131             $arc = new Archives($aid);
132             $arc->MakeHtml();
133         }
134         ShowMsg("成功复制 $j 个文档!", $ENV_GOBACK_URL);
135         exit();
136     }
137 }

 

打开dede/js/list.js 搜索 function moveArc(e, obj, cid)下约35行添加

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

 

打开dede/js/list.js 搜索  function ShowMenu(evt,obj,aid,atitle)里面的

new ContextItem(“推荐文档”,function(){ adArc(aid); }),的下面添加

new ContextItem("复制(<u>C</u>)",function(){ copyToClipboard(atitle); }),

 

打开dede/templets下的content_list.htm找到

<a href=”javascript:;” onClick=”moveArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>)” class=”layui-btn layui-btn-small”>&nbsp;移动&nbsp;</a>

当前行的下方添加

<a href="javascript:;" onClick="copyArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>);" class="coolbg"> 复制 </a>

 

云风网络是集昆山网站制作,昆山网页设计,昆山网站推广于一体的昆山网络公司,业务涵盖:昆山手机网站制作,昆山网站设计,昆山网络建设,昆山做网站,昆山网站建设,电话:13912673321

点击这里给我发消息 技术咨询
回到顶部