query("insert into ".GetDoTemptb("enewssearchtemp",$gid)."(tempname,temptext,subnews,isdefault,listvar,rownum,modid,showdate,subtitle,classid,docode) values('$add[tempname]','".eaddslashes2($add[temptext])."',$add[subnews],0,'".eaddslashes2($add[listvar])."',$add[rownum],$add[modid],'".eaddslashes($add[showdate])."',$add[subtitle],$classid,'$docode');"); $tempid=$empire->lastid(); //备份模板 AddEBakTemp('searchtemp',$gid,$tempid,$add[tempname],$add[temptext],$add[subnews],0,$add[listvar],$add[rownum],$add[modid],$add[showdate],$add[subtitle],$classid,$docode,$userid,$username); if($sql) { //操作日志 insert_dolog("tempid=".$tempid."
tempname=".$add[tempname]."&gid=$gid"); printerror("AddMSearchTempSuccess","AddSearchtemp.php?enews=AddMSearchtemp&gid=$gid".hReturnEcmsHashStrHref2(0)); } else { printerror("DbError","history.go(-1)"); } } //修改搜索模板 function EditMSearchtemp($add,$userid,$username){ global $empire,$dbtbpre; $add[tempid]=(int)$add[tempid]; if(!$add[tempname]||!$add[temptext]||!$add[listvar]||!$add[modid]||!$add[tempid]) {printerror("EmptySearchTempname","history.go(-1)");} //操作权限 CheckLevel($userid,$username,$classid,"template"); $classid=(int)$add['classid']; $add[tempname]=hRepPostStr($add[tempname],1); $add[temptext]=RepPhpAspJspcode($add[temptext]); $add[listvar]=RepPhpAspJspcode($add[listvar]); if($add['autorownum']) { $add[rownum]=substr_count($add[temptext],'