给织梦添加复制文档的功能步骤如下:
一、打开templets下的content_list.htm
找到 这一行:
<a href="javascript:;" onClick="moveArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>)" class="coolbg"> 移动 </a>
在这一行的下方添加:
<a href="javascript:;" onClick="copyArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>);" class="coolbg"> 复制 </a>
二、打开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 = "<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="images/button_ok.gif" width="60" height="22" class="np" border="0" style="cursor:pointer" />
<img src="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 `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();
}
}
温馨提示
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请后台提交工单处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请后台提交工单!
【免责声明】:
本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。
【关于转载】:
本站尊重互联网版权体系,本站部分图片、文章大部分转载于互联网、所有内容不代表本站观点、不对文章中的任何观点负责、转载的目的只用于给网民提供信息阅读,无任何商业用途,所有内容版权归原作者所有
如本站(文章、内容、图片、视频)任何资料有侵权,先说声抱歉;麻烦您请联系请后台提交工单,我们会立即删除、维护您的权益。非常感谢您的理解。
【附】:
二○○二年一月一日《计算机软件保护条例》第十七条规定:为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬!鉴于此,也希望大家按此说明研究软件!
注:本站资源来自网络转载,版权归原作者和公司所有,如果有侵犯到您的权益,请第一时间联系我们处理!
-----------------------------------------------------------------------------------------------------------
【版权声明】:
一、本站致力于为源码爱好者提供国内外软件开发技术和软件共享,着力为用户提供优资资源。
二、本站提供的源码下载文件为网络共享资源,请于下载后的24小时内删除。如需体验更多乐趣,还请支持正版。
三、如有内容侵犯您的版权或其他利益的,请编辑邮件并加以说明发送到站长邮箱。站长会进行审查之后,情况属实的会在三个工作日内为您删除。
-----------------------------------------------------------------------------------------------------------
源码村资源网 » 给织梦添加复制文档的功能