DEDE 在后台添加栏目文档的批量复制功能

  ShowMsg(“无法获得主键,因此无法进行后续操作!”,”-1″);

  exit();

  }

  //加入数据表dede_archives的SQL语句

  //———————————-

  $inQuery = “INSERT INTO `dede_archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,

  color,writer,source,litpic,pubdate,senddate,mid,lastpost,scores,goodpost,badpost,notpost,description,keywords,filename)

  VALUES (‘$arcID’,’$typeid’,”,’$sortrank’,’$flag’,’$ismake’,’$channelid’,’$arcrank’,’0′,’$money’,

  ’$title’,’$shorttitle’,’$color’,’$writer’,’$source’,’$litpic’,’$pubdate’,’$senddate’,

  ’$adminid’,’0′,’0′,’0′,’0′,’0′,’$description’,’$keywords’,”);”;

  if(!$dsql->ExecuteNoneQuery($inQuery))

  {

  $gerr = $dsql->GetError();

  $dsql->ExecuteNoneQuery(“Delete From `dede_arctiny` where id=’$arcID'”);

  ShowMsg(“把数据保存到数据库主表 `dede_archives` 时出错,请把相关信息提交给DedeCms官方。”.str_replace(‘”‘,”,$gerr),”javascript:;”);

  exit();

  }

  //保存到附加表

  $cts = $dsql->GetOne(“Select addtable From `dede_channeltype` where id=’$channelid’ “);

  $addtable = trim($cts[‘addtable’]);

  if(empty($addtable))

  {

  $dsql->ExecuteNoneQuery(“Delete From `dede_archives` where id=’$arcID'”);

  $dsql->ExecuteNoneQuery(“Delete From `dede_arctiny` where id=’$arcID'”);

  ShowMsg(“没找到当前模型[{$channelid}]的主表信息,无法完成操作!。”,”javascript:;”);

  exit();

  }

  $useip = GetIP();

  $redirecturl = $addRow[‘redirecturl’];

  $templet = $addRow[‘templet’];

  $addRow = $dsql->GetOne(“Select * from `{$addtable}` where aid=’$ID'”);

  $body = addslashes($addRow[“body”]);

  $query = “INSERT INTO `{$addtable}`(aid,typeid,redirecturl,templet,userip,body) Values(‘$arcID’,’$typeid’,’$redirecturl’,’$templet’,’$useip’,’$body’)”;

  if(!$dsql->ExecuteNoneQuery($query))

  {

  $gerr = $dsql->GetError();

  $dsql->ExecuteNoneQuery(“Delete From `dede_archives` where id=’$arcID'”);

  $dsql->ExecuteNoneQuery(“Delete From `dede_arctiny` where id=’$arcID'”);

  ShowMsg(“把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCms官方。”.str_replace(‘”‘,”,$gerr),”javascript:;”);

  exit();

  }

  else $tdd++;

  }

  if($tdd>0)

  {

  $jumpurl = “makehtml_archives_action.php?endid=$endid&startid=$startid”;

  $jumpurl .= “&typeid=$newtypeid&pagesize=20&seltime=$seltime”;

  $jumpurl .= “&stime=”.urlencode($starttime).”&etime=”.urlencode($endtime);

  ShowMsg(“成功复制了 $tdd 条记录,准备重新生成HTML…”,$jumpurl);

  }

  else ShowMsg(“完成操作,没复制任何数据…”,”javascript:;”);

  exit();

  }

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

Pbootcms模板网 提供优质的模板集合

立即查看 了解详情