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

 /*-----------------------------
//复制文档
------------------------------*/
elseif ($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 = "<select name='totype' style='width:90%'>
<option value='0'>请选择复制到的位置...</option>\r\n
$typeOptions
</select>"; //输出AJAX可移动窗体
$divname = 'copyArchives';
echo "<div class='title' onmousemove=\"DropMoveHand('{$divname}', 225);\" onmousedown=\"DropStartHand();\" onmouseup=\"DropStopHand();\">\r\n";
echo " <div class='titLeft'>复制文档</div>\r\n";
echo " <div class='titRight'><img src='images/ico-close.gif' style='cursor:pointer;' onclick='HideObj(\"{$divname}\");ChangeFullDiv(\"hide\");' alt='关闭' title='关闭' /></div>\r\n";
echo "</div>\r\n";
echo "<form name='quickeditform' action='archives_do.php' method='post'>\r\n";
echo "<input type='hidden' name='dopost' value='{$dopost}' />\r\n";
echo "<input type='hidden' name='qstr' value='{$qstr}' />\r\n";
echo "<table width='100%' style='margin-top:6px;z-index:9000;'>\r\n";
?>
<tr height='28'>
<td width="80" class='bline'> 目标栏目:</td>
<td class='bline'>
<?php echo $typeOptions; ?>
</td>
</tr>
<tr height='32'>
<td width="80" class='bline'> 文档ID:</td>
<td class='bline'>
<input type='text' name='tmpids' value="<?php echo $qstr; ?>" style='width:310px;overflow:hidden;'/>
<br/>
复制到的目标栏目必须和选定的文档频道类型一致,否则程序会自动勿略不符合的文档。
</td>
</tr>
<tr height='32'>
<td colspan='2' align='center' style='padding-top:12px'>
<input name="imageField" type="image" src="data:images/button_ok.gif" width="60" height="22" class="np"
border="0" style="cursor:pointer"/>
  
<img src="data:images/button_back.gif" width="60" height="22" border="0"
onclick='HideObj("<?php echo $divname; ?>");ChangeFullDiv("hide");' style="cursor:pointer"/>
</td>
</td>
</tr>
</table>
</form>
<?php
//AJAX窗体结束
} else {
$totype = preg_replace("#[^0-9]#", '', $totype);
$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' ");
$idtype = "id";
if (!is_array($typeInfos)) {
ShowMsg('参数错误!', '-1');
exit();
}
if ($typeInfos['ispart'] != 0) {
ShowMsg('文档保存的栏目必须为最终列表栏目!', '-1');
exit();
}
if (empty($typeInfos['addtable'])) {
$typeInfos['maintable'] = '`#@__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 `#@__arctiny` (typeid,typeid2,arcrank,channel,senddate,sortrank,mid) select typeid,typeid2,arcrank,channel,senddate,sortrank,mid from `#@__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) select case when aid>'0' then '$xid' else '' end,$totype,body,redirecturl,templet,userip from `{$typeInfos['addtable']}` WHERE aid='{$row[$idtype]}' "); $okids[] = $row[$idtype];
$j++;
}
} UpDateCatCache();
$sql = " TRUNCATE TABLE `#@__arctiny`";
$dsql->ExecuteNoneQuery($sql); //导入普通模型微数据
$sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)
SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `#@__archives` ";
$dsql->ExecuteNoneQuery($sql); //导入单表模型微数据
$dsql->SetQuery("SELECT id,addtable FROM `#@__channeltype` WHERE id < -1 ");
$dsql->Execute();
$doarray = array();
while($row = $dsql->GetArray())
{
$tb = str_replace('#@__', $cfg_dbprefix, $row['addtable']);
if(empty($tb) || isset($doarray[$tb]) )
{
continue;
}
else
{
$sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)
SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb` ";
$rs = $dsql->executenonequery($sql);
$doarray[$tb] = 1;
}
}
//更新HTML
foreach ($okids as $aid) {
$arc = new Archives($aid);
$arc->MakeHtml();
}
ShowMsg("成功复制 $j 个文档!", $ENV_GOBACK_URL);
exit();
}
}

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

 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/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>    

转自:织梦CMS增加复制文档功能

织梦CMS增加复制文档功能的更多相关文章

  1. 织梦cms网上复制图片不可用的解决方法

    背景描述: 织梦cms采集图片集时, 需要使用织梦cms提供的"网上复制图片"的功能, 好像我这里这个功能一直不可用, 今天下定决心研究了下源代码并进行了适当修改, 将我的修改提供 ...

  2. 织梦DEDEcms首页调用文档整篇内容

    DedeCMS在首页调用内容页中的整篇文章 织梦程序是一个很强大的程序,也有很多朋友使用织梦程序来做博客,想要像是在博客中一样能在首页中调用一整篇文章,其实在织梦程序中页可以很完美的实现这个功能. 在 ...

  3. 织梦CMS实现多条件筛选功能

    用织梦实现筛选的功能,其实主要就是运用到了织梦的高级搜索功能,然后用ajax去post替换掉本来的结果就可以了. 其实筛选的话,主要有两个问题需要解决,一个是前台的筛选实现,一个是后台根据前台的点击, ...

  4. dedecms织梦后台栏目显示文档数不为0,但点进去之后什么都没有

    曾经通过sql语句直接删除过dede_addonarticle或者dede_archives或者dede_arctiny中的记录,这三个表是有关联的,如果要通过sql语句删除内容,一定要同时将这三个表 ...

  5. 织梦cms PHPcms 帝国cms比较

    现在建网站不需要请程序员从基础的程序开发做起了,有专业的建站工具,CMS是使用最广泛的建站工具.CMS是Content Management System 现在建网站不需要请程序员从基础的程序开发做起 ...

  6. 织梦CMS安装分享插件

    获取百度分享按钮织梦系统插件 点击下载:dedecms 5.* 插件 更新日期:2011.09.05 1.下载百度分享插件的织梦cms版本. 2.使用管理员账号登录您的站点后台管理中心,单击" ...

  7. 让织梦CMS的后台编辑器支持优酷视频

    最近做了一些视频教程传到优酷网站上,但我想引入这些视频教程到我的网站,在发表时我发现织梦CMS自带的编辑器又不直接支持优酷等视频网站的引用.所以为了方便教程的发布,特意在网站搜索到本篇教程,详细讲解如 ...

  8. 如何设置织梦cms自定义表单字段为必填项

    1.编辑器打开\plus\diy.php2.在40行左右找到此行代码:$dede_fields = empty($dede_fields) ? '' : trim($dede_fields);3.在这 ...

  9. 织梦cms、帝国cms、PHPcms优缺点解析

    php才是建站的主流,cms这类程序又是用的最多的,占据主流的cms主要就是织梦,帝国,phpcms这三种的,这三个程序都是开源程序.国内用户众多.   一.从美观性来说(以官方默认模版为准   ph ...

随机推荐

  1. Data Lake Analytics的Geospatial分析函数

    0. 简介 为满足部分客户在云上做Geometry数据的分析需求,阿里云Data Lake Analytics(以下简称:DLA)支持多种格式的地理空间数据处理函数,符合Open Geospatial ...

  2. .NET(C#、VB)APP开发——Smobiler平台控件介绍:SignatureButton控件

    SignatureButton控件 一.          样式一 我们要实现上图中的效果,需要如下的操作: 从工具栏上的"Smobiler Components"拖动一个Sign ...

  3. Alpha阶段Scrum Meeting合集(江山代有才人秃队)

    Day URL 第一天 第1篇Scrum冲刺博客 第二天 第2篇Scrum冲刺博客 第三天 第3篇Scrum冲刺博客 第四天 第4篇Scrum冲刺博客 第五天 第5篇Scrum冲刺博客 第六天 第6篇 ...

  4. 关于linux上postgresql的一些理解

    刚开始接触postgresql,安装后就有一个默认用户postgres,而且在启动postgresql后只能通过切换到linux的postgres用户才能登录数据库进行操作,和Mysql的登录认证居然 ...

  5. python3 变量理解 解释器理解 常量理解 用户交互理解 逻辑运算

    先来条NLP再说...... 九,每人都已经具备使自己快乐的资源 每一个人都有过成功快乐的体验,也即是说有使自己快乐的能力. 人类只用了大脑能力极少部分,提升大脑的运用,很多新的突破便会出现. 运用大 ...

  6. mapbox.gl文字标注算法基本介绍

    Well-placed labels can be the difference between a sloppy map and a beautiful one. Labels need to cl ...

  7. Python写爬虫爬妹子

    最近学完Python,写了几个爬虫练练手,网上的教程有很多,但是有的已经不能爬了,主要是网站经常改,可是爬虫还是有通用的思路的,即下载数据.解析数据.保存数据.下面一一来讲.   1.下载数据 首先打 ...

  8. PHP面向对象特性

    目录 创建对象 成员属性 成员方法 构造方法 析构方法 垃圾回收机制 访问修饰符 魔术方法 对象比较 继承 重载 属性重载 方法重写 属性重写 静态属性 静态方法 多态 类型约束 抽象类 接口 fin ...

  9. Redis集群架构

    Redis集群概述 集群的核心意义只有一个:保证一个节点出现了问题之后,其他的节点可以继续提供服务使用. Redis基础部分讲解过主从配置:对于主从配置可以有两类:一主二从,层级关系.开发者一主二从是 ...

  10. springcloud之config配置中心-Finchley.SR2版

    本篇和大家分享的是springcloud-config配置中心搭建,写到这里突然想起自己曾今开源过基于Redis发布订阅编写的一个配置中心,刚看了git星数有点少哈哈,这里顺势发个连接欢迎大侠们点赞: ...