DEDE 在后台添加栏目文档的批量复制功能
修改文件dede/templets/content_batch_up.htm
修改头部脚本函数ShowHideMove()
function ShowHideMove()
{
var selBox = document.getElementByIdx_x('moveradio');
var selBox2 = document.getElementByIdx_x('copyradio');//edited by adan;090508
var obj = document.getElementByIdx_x('moveField');
if(selBox.checked||selBox2.checked) obj.style.display = "block";//edited by adan;090508
else obj.style.display = "none";
}
添加复制栏目按钮
查找
<input name="action" type="radio" class="np" value="move" id="moveradio" onClick="ShowHideMove()" />
移动文档
后面添加
<input name="action" type="radio" class="np" value="copy" id="copyradio" onClick="ShowHideMove()" /><!--added by adan;090508-->
复制栏目文档
修改文件dede/content_batch_action.PHP
首先删除文件最后的两段代码
//删除空标题内容
else if($action=='delnulltitle')
{
$dsql->SetQuery("Select id From dede_archives where trim(title)='' ");
$dsql->Execute('x');
$tdd = 0;
while($row = $dsql->GetObject('x'))
{
if(DelArc($row->id))
{
$tdd++;
}
}
ShowMsg("成功删除 $tdd 条记录!","JavaScript:;");
exit();
}
//修正缩略图错误
else if($action=='modddpic')
{
$dsql->ExecuteNoneQuery("Update dede_archives set litpic='' where trim(litpic)='litpic' ");
ShowMsg("成功修正缩略图错误!","javascript:;");
exit();
}
上面2段代码,官方人员竟然把上面2段代码搞重复了,先汗一个!
然后在最后添加下面代码
//start 添加复制栏目文章功能 added by adan;090508
else if($action=='copy')
{
if(empty($typeid))
{
ShowMsg('该操作必须指定栏目!','javascript:;');
exit();
}
$typeold = $dsql->GetOne("Select * From `dede_arctype` where id='$typeid'; ");
$typenew = $dsql->GetOne("Select * From `dede_arctype` where id='$newtypeid'; ");
if(!is_array($typenew))
{
$dsql->Close();
ShowMsg("无法检测复制到的新栏目的信息,不能完成操作!","javascript:;");
exit();
}
if($typenew['ispart']!=0)
{
$dsql->Close();
ShowMsg("你不能把数据复制到非最终列表的栏目!","javascript:;");
exit();
}
if($typenew['channeltype']!=$typeold['channeltype'])
{
$dsql->Close();
ShowMsg("不能把数据复制到内容类型不同的栏目!","javascript:;");
exit();
}
$gwhere .= " And channel='".$typenew['channeltype']."' And title like '%$keyword%'";
$ch = $dsql->GetOne("Select addtable From `dede_channeltype` where id={$typenew['channeltype']} ");
$addtable = $ch['addtable'];
$dsql->SetQuery("Select * From `dede_archives` where typeid='$typeid'");
$dsql->Execute('c');
$tdd = 0;
while($row = $dsql->GetObject('c'))
{
$senddate = time();
$sortrank = AddDay($senddate,0);//第二个参数是排序值,参考article_add.php
$ID = $row->id;
$typeid = $newtypeid;//$newtypeid
$sortrank = $row->sortrank;
$flag = $row->flag;
$ismake = $row->ismake;
$channelid = $row->channel;
$arcrank = $row->arcrank;
$click = $row->click;
$money = $row->money;
$title = addslashes($row->title);//需要添加addslashes()转换; adan;090508
$shorttitle = $row->shorttitle;
$color = $row->color;
$writer = $row->writer;
$source = $row->source;
$litpic = $row->litpic;
$pubdate = $row->pubdate;
$adminid = $cuserLogin->getUserID();
$notpost = $row->notpost;
$description = addslashes($row->description);//需要添加addslashes()转换; adan;090508
$keywords = $row->keywords;
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
//生成文档ID
$arcID = GetIndexKey($arcrank,$typeid,$sortrank,$channelid,$senddate,$adminid);
if(empty($arcID))
{
ShowMsg("无法获得主键,因此无法进行后续操作!","-1");
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ(984818011)进行交流。
- 织梦dede首页列表页获取文章对应的tag标签
- 织梦dede导航栏目顶级和二级判断二级输出不同url
- 织梦dede标签array runphp静态生成乱码BUG解决方法
- 织梦dede如何禁止会员发布文章内容带超链接
- 织梦ajax跨域提交自定义表单和跨域验证码问题
- 织梦CMS MIP文章内容页图片适配百度MIP规范
- 织梦CMS时间格式实现XX秒前、XX分钟前、XX天前
- 织梦DedeCMS更新系统缓存增加清理沉余缓存的功能
- 织梦CMS让channelartlist标签支持currentstyle属性的
- 织梦dede自带编辑器替换百度ueditor编辑器
- 织梦DEDECMS整站动态化或整站静态化设置方法
- 织梦dede 模板路径templets目录都有什么?