新闻资讯
-
2022/07/26
Web3.0:用户主导的全新网络生态。 Web3(也被称为Web 3.0,又写为web3)是关于万维网发展的一个概念,主要与基于区块链的去...
-
2022/06/24
百度编辑器ueditor在PHP7下多图上传名字重复,PbootCMS在V1.3.8已经修复,现在记录如下,方便有类似情况的网友参考: 1、修改...
-
2022/06/24
系统简介: 本集成环境为nginx+php,支持sqlite数据库、支持PbootCMS伪静态! 下载地址: 链接: https://pan.baidu.com/s/1qs...
-
2022/06/24
随着互联网及web应用技术的快速发展,如今的网站建设已经发生了很大变化,不再像过去那样一个980px网站即可完成,如今什么响...
-
2022/06/24
在网站内部优化中,扁平化的目录结构对于一个网站来讲是非常有意义的。我们经常看到一些网站结构混乱,搞的你都不知道哪里是...
-
2022/06/24
PbootCMS已经内置支持自定义内容地址错误情况下错误页面的自定义功能,只需要在站点根目录下定义404.html文件即可,效果如下图
-
2022/06/24
PbootCMS已经非常灵活的支持多层级URL地址模式,自定义包含如下情况: 1、栏目自定义:只需要在栏目的URL名称中进行定义即可...
织梦网站后台增加复制文档功能
发布时间:2020/11/05 网站资讯 浏览次数:2287
打开后台目录(/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”> 移动 </a>
当前行的下方添加
<a href="javascript:;" onClick="copyArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>);" class="coolbg"> 复制 </a>
云风网络是集昆山网站制作,昆山网页设计,昆山网站推广于一体的昆山网络公司,业务涵盖:昆山手机网站制作,昆山网站设计,昆山网络建设,昆山做网站,昆山网站建设,电话:13912673321
上一篇: 企业开发微信公众号有什么好处?
下一篇: 谷歌浏览器如何长截图