文档ID: |
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();
}
}
☉免责声明:本站所有模板均来自用户分享和网络收集,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解! pbootcms模板网 » 给织梦添加复制文档的功能
|