$r[urlend])
{
$a="\r\n";
}
$url=$a.$dourl.$url;
}
else
{
if($i<>$r[urlstart])
{
$a="\r\n";
}
$url.=$a.$dourl;
}
}
}
if($r[infourl])
{
if($url)
{
$url=$r[infourl]."\r\n".$url;
}
else
{
$url=$r[infourl];
}
}
if(empty($url))
{printerror("EmptyInfourl","history.go(-1)");}
return $url;
}
//增加节点
function AddInfoClass($bclassid,$newsclassid,$add,$ztid,$userid,$username){
global $empire,$class_r,$dbtbpre;
if(!$add[classname])
{printerror("EmptyInfoTitleSuccess","history.go(-1)");}
//操作权限
CheckLevel($userid,$username,$classid,"cj");
//选择栏目
if($newsclassid)
{
if(!$class_r[$newsclassid][islast])
{
printerror("CjClassidMustLast","history.go(-1)");
}
//返回采集页面地址
$add[infourl]=ReturnInfoUrl($add);
//取得采集字段
$mr=$empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='".$class_r[$newsclassid][modid]."'");
$ret_r=ReturnAddCj($add,$mr[cj],0);
}
$lasttime=time();
if(empty($add[startday]))
{$add[startday]=date("Y-m-d");}
if(empty($add[endday]))
{$add[endday]="2099-12-31";}
if(empty($add[relistnum]))
{$add[relistnum]=1;}
if(empty($add[renum]))
{$add[renum]=2;}
if(empty($add[insertnum]))
{$add[insertnum]=10;}
//处理变量
$bclassid=(int)$bclassid;
$newsclassid=(int)$newsclassid;
$add[num]=(int)$add[num];
$add[copyimg]=(int)$add[copyimg];
$add[renum]=(int)$add[renum];
$add[titlelen]=(int)$add[titlelen];
$add[retitlewriter]=(int)$add[retitlewriter];
$add[smalltextlen]=(int)$add[smalltextlen];
$add[relistnum]=(int)$add[relistnum];
$add[keynum]=(int)$add[keynum];
$add[insertnum]=(int)$add[insertnum];
$add[copyflash]=(int)$add[copyflash];
$mr[tid]=(int)$mr[tid];
$add[pagetype]=(int)$add[pagetype];
$add[mark]=(int)$add[mark];
$add[enpagecode]=(int)$add[enpagecode];
$add[recjtheurl]=(int)$add[recjtheurl];
$add[hiddenload]=(int)$add[hiddenload];
$add[justloadin]=(int)$add[justloadin];
$add[justloadcheck]=(int)$add[justloadcheck];
$add[delloadinfo]=(int)$add[delloadinfo];
$add[getfirstpic]=(int)$add[getfirstpic];
$add[getfirstspic]=(int)$add[getfirstspic];
$add[getfirstspicw]=(int)$add[getfirstspicw];
$add[getfirstspich]=(int)$add[getfirstspich];
$add[doaddtextpage]=(int)$add[doaddtextpage];
$add[infourlispage]=(int)$add[infourlispage];
$keeptime=(int)$add['keeptime'];
$newstextisnull=(int)$add['newstextisnull'];
$loadkeeptime=(int)$add['loadkeeptime'];
$add['classname']=eDoRepPostComStr($add['classname']);
$add['startday']=hRepPostStr($add['startday'],1);
$add['endday']=hRepPostStr($add['endday'],1);
$add['save_titlepicl']=hRepPostStr2($add['save_titlepicl']);
$mr['tbname']=hRepPostStr2($mr['tbname']);
$add['repf']='';
if($_POST['repf'])
{
$add['repf']=$_POST['repf'];
$add['repf']=','.hRepPostStr($add['repf'],1).',';
}
$add['repadf']='';
if($_POST['repadf'])
{
$add['repadf']=$_POST['repadf'];
$add['repadf']=','.hRepPostStr($add['repadf'],1).',';
}
$add['isnullf']='';
if($_POST['isnullf'])
{
$add['isnullf']=$_POST['isnullf'];
$add['isnullf']=','.hRepPostStr($add['isnullf'],1).',';
}
//写入主表
$sql=$empire->query("insert into {$dbtbpre}enewsinfoclass(bclassid,classname,infourl,newsclassid,startday,endday,bz,num,copyimg,renum,keyboard,oldword,newword,titlelen,retitlewriter,smalltextlen,zz_smallurl,zz_newsurl,httpurl,repad,imgurl,relistnum,zz_titlepicl,z_titlepicl,qz_titlepicl,save_titlepicl,keynum,insertnum,copyflash,tid,tbname,pagetype,smallpagezz,pagezz,smallpageallzz,pageallzz,mark,enpagecode,recjtheurl,hiddenload,justloadin,justloadcheck,delloadinfo,pagerepad,getfirstpic,oldpagerep,newpagerep,keeptime,lasttime,newstextisnull,getfirstspic,getfirstspicw,getfirstspich,doaddtextpage,infourlispage,repf,repadf,loadkeeptime,isnullf) values($bclassid,'".eaddslashes($add[classname])."','".eaddslashes2($add[infourl])."',$newsclassid,'$add[startday]','$add[endday]','".eaddslashes2($add[bz])."',$add[num],$add[copyimg],$add[renum],'".eaddslashes2($add[keyboard])."','".eaddslashes2($add[oldword])."','".eaddslashes2($add[newword])."',$add[titlelen],$add[retitlewriter],$add[smalltextlen],'".eaddslashes2($add[zz_smallurl])."','".eaddslashes2($add[zz_newsurl])."','".eaddslashes2($add[httpurl])."','".eaddslashes2($add[repad])."','".eaddslashes2($add[imgurl])."',$add[relistnum],'".eaddslashes2($add[zz_titlepicl])."','".eaddslashes2($add[z_titlepicl])."','".eaddslashes2($add[qz_titlepicl])."','$add[save_titlepicl]',$add[keynum],$add[insertnum],$add[copyflash],$mr[tid],'$mr[tbname]',$add[pagetype],'".eaddslashes2($add[smallpagezz])."','".eaddslashes2($add[pagezz])."','".eaddslashes2($add[smallpageallzz])."','".eaddslashes2($add[pageallzz])."',$add[mark],$add[enpagecode],$add[recjtheurl],$add[hiddenload],$add[justloadin],$add[justloadcheck],$add[delloadinfo],'".eaddslashes2($add[pagerepad])."',$add[getfirstpic],'".eaddslashes2($add[oldpagerep])."','".eaddslashes2($add[newpagerep])."',$keeptime,$lasttime,$newstextisnull,$add[getfirstspic],$add[getfirstspicw],$add[getfirstspich],$add[doaddtextpage],$add[infourlispage],'$add[repf]','$add[repadf]','$loadkeeptime','$add[isnullf]');");
$classid=$empire->lastid();
if($newsclassid)
{
//写入副表
$usql=$empire->query("insert into {$dbtbpre}ecms_infoclass_".$mr[tbname]."(classid".$ret_r[0].") values($classid".$ret_r[1].");");
}
if($sql)
{
//操作日志
insert_dolog("classid=".$classid."
classname=".$add[classname]);
printerror("AddInfoClassSuccess","AddInfoClass.php?enews=AddInfoClass&newsclassid=$newsclassid&from=".ehtmlspecialchars($_POST[from]).hReturnEcmsHashStrHref2(0));
}
else
{printerror("DbError","history.go(-1)");}
}
//修改节点
function EditInfoClass($bclassid,$newsclassid,$add,$ztid,$userid,$username){
global $empire,$class_r,$dbtbpre;
if(!$add[classid]||!$add[classname])
{printerror("EmptyInfoTitleSuccess","history.go(-1)");}
//操作权限
CheckLevel($userid,$username,$classid,"cj");
//父节点与原节点一样
if($add[classid]==$bclassid)
{printerror("OldInfoidNotSingle","history.go(-1)");}
//选择栏目
if($newsclassid)
{
if(!$class_r[$newsclassid][islast])
{
printerror("CjClassidMustLast","history.go(-1)");
}
//返回采集页面地址
$add[infourl]=ReturnInfoUrl($add);
//取得采集字段
$mr=$empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='".$class_r[$newsclassid][modid]."'");
}
if(empty($add[startday]))
{$add[startday]=date("Y-m-d");}
if(empty($add[endday]))
{$add[endday]="2099-12-31";}
if(empty($add[relistnum]))
{$add[relistnum]=1;}
if(empty($add[renum]))
{$add[renum]=2;}
if(empty($add[insertnum]))
{$add[insertnum]=10;}
//处理变量
$add[classid]=(int)$add[classid];
$bclassid=(int)$bclassid;
$newsclassid=(int)$newsclassid;
$add[num]=(int)$add[num];
$add[copyimg]=(int)$add[copyimg];
$add[renum]=(int)$add[renum];
$add[titlelen]=(int)$add[titlelen];
$add[retitlewriter]=(int)$add[retitlewriter];
$add[smalltextlen]=(int)$add[smalltextlen];
$add[relistnum]=(int)$add[relistnum];
$add[keynum]=(int)$add[keynum];
$add[insertnum]=(int)$add[insertnum];
$add[copyflash]=(int)$add[copyflash];
$mr[tid]=(int)$mr[tid];
$add[pagetype]=(int)$add[pagetype];
$add[mark]=(int)$add[mark];
$add[enpagecode]=(int)$add[enpagecode];
$add[recjtheurl]=(int)$add[recjtheurl];
$add[hiddenload]=(int)$add[hiddenload];
$add[justloadin]=(int)$add[justloadin];
$add[justloadcheck]=(int)$add[justloadcheck];
$add[delloadinfo]=(int)$add[delloadinfo];
$add[getfirstpic]=(int)$add[getfirstpic];
$add[getfirstspic]=(int)$add[getfirstspic];
$add[getfirstspicw]=(int)$add[getfirstspicw];
$add[getfirstspich]=(int)$add[getfirstspich];
$add[doaddtextpage]=(int)$add[doaddtextpage];
$add[infourlispage]=(int)$add[infourlispage];
$keeptime=(int)$add['keeptime'];
$newstextisnull=(int)$add['newstextisnull'];
$loadkeeptime=(int)$add['loadkeeptime'];
$add['classname']=eDoRepPostComStr($add['classname']);
$add['startday']=hRepPostStr($add['startday'],1);
$add['endday']=hRepPostStr($add['endday'],1);
$add['save_titlepicl']=hRepPostStr2($add['save_titlepicl']);
$mr['tbname']=hRepPostStr2($mr['tbname']);
$add['repf']='';
if($_POST['repf'])
{
$add['repf']=$_POST['repf'];
$add['repf']=','.hRepPostStr($add['repf'],1).',';
}
$add['repadf']='';
if($_POST['repadf'])
{
$add['repadf']=$_POST['repadf'];
$add['repadf']=','.hRepPostStr($add['repadf'],1).',';
}
$add['isnullf']='';
if($_POST['isnullf'])
{
$add['isnullf']=$_POST['isnullf'];
$add['isnullf']=','.hRepPostStr($add['isnullf'],1).',';
}
//主表
$sql=$empire->query("update {$dbtbpre}enewsinfoclass set bclassid=$bclassid,classname='".eaddslashes($add[classname])."',infourl='".eaddslashes2($add[infourl])."',newsclassid=$newsclassid,startday='$add[startday]',endday='$add[endday]',bz='".eaddslashes2($add[bz])."',num=$add[num],copyimg=$add[copyimg],renum=$add[renum],keyboard='".eaddslashes2($add[keyboard])."',oldword='".eaddslashes2($add[oldword])."',newword='".eaddslashes2($add[newword])."',titlelen=$add[titlelen],retitlewriter=$add[retitlewriter],smalltextlen=$add[smalltextlen],zz_smallurl='".eaddslashes2($add[zz_smallurl])."',zz_newsurl='".eaddslashes2($add[zz_newsurl])."',httpurl='".eaddslashes2($add[httpurl])."',repad='".eaddslashes2($add[repad])."',imgurl='".eaddslashes2($add[imgurl])."',relistnum=$add[relistnum],zz_titlepicl='".eaddslashes2($add[zz_titlepicl])."',z_titlepicl='".eaddslashes2($add[z_titlepicl])."',qz_titlepicl='".eaddslashes2($add[qz_titlepicl])."',save_titlepicl='$add[save_titlepicl]',keynum=$add[keynum],insertnum=$add[insertnum],copyflash=$add[copyflash],tid=$mr[tid],tbname='$mr[tbname]',pagetype=$add[pagetype],smallpagezz='".eaddslashes2($add[smallpagezz])."',pagezz='".eaddslashes2($add[pagezz])."',smallpageallzz='".eaddslashes2($add[smallpageallzz])."',pageallzz='".eaddslashes2($add[pageallzz])."',mark=$add[mark],enpagecode=$add[enpagecode],recjtheurl=$add[recjtheurl],hiddenload=$add[hiddenload],justloadin=$add[justloadin],justloadcheck=$add[justloadcheck],delloadinfo=$add[delloadinfo],pagerepad='".eaddslashes2($add[pagerepad])."',getfirstpic=$add[getfirstpic],oldpagerep='".eaddslashes2($add[oldpagerep])."',newpagerep='".eaddslashes2($add[newpagerep])."',keeptime='$keeptime',newstextisnull=$newstextisnull,getfirstspic=$add[getfirstspic],getfirstspicw=$add[getfirstspicw],getfirstspich=$add[getfirstspich],doaddtextpage=$add[doaddtextpage],infourlispage=$add[infourlispage],repf='$add[repf]',repadf='$add[repadf]',loadkeeptime='$loadkeeptime',isnullf='$add[isnullf]' where classid='$add[classid]'");
if($newsclassid)
{
//是否已有记录
$havenum=$empire->num("select count(*) as total from {$dbtbpre}ecms_infoclass_".$mr[tbname]." where classid='$add[classid]' limit 1");
//原本是父栏目
if(empty($add[oldnewsclassid])&&!$havenum)
{
$ret_r=ReturnAddCj($add,$mr[cj],0);
//写入副表
$usql=$empire->query("insert into {$dbtbpre}ecms_infoclass_".$mr[tbname]."(classid".$ret_r[0].") values($add[classid]".$ret_r[1].");");
}
else
{
$ret_r=ReturnAddCj($add,$mr[cj],1);
//副表
$usql=$empire->query("update {$dbtbpre}ecms_infoclass_".$mr[tbname]." set classid='$add[classid]'".$ret_r[0]." where classid='$add[classid]'");
}
}
//来源
if($_POST['from'])
{
$returnurl="ListPageInfoClass.php";
}
else
{
$returnurl="ListInfoClass.php";
}
if($sql)
{
//操作日志
insert_dolog("classid=".$add[classid]."
classname=".$add[classname]);
printerror("EditInfoClassSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
}
else
{printerror("DbError","history.go(-1)");}
}
//删除采集节点
function DelInfoClass($classid,$userid,$username){
global $empire,$dbtbpre;
$classid=(int)$classid;
if(empty($classid))
{printerror("NotDelInfoid","history.go(-1)");}
//操作权限
CheckLevel($userid,$username,$classid,"cj");
$r=$empire->fetch1("select classname,tid,tbname,newsclassid from {$dbtbpre}enewsinfoclass where classid='$classid'");
$del=$empire->query("delete from {$dbtbpre}enewsinfoclass where classid='$classid'");
if($r[newsclassid])
{
$del2=$empire->query("delete from {$dbtbpre}ecms_infoclass_".$r[tbname]." where classid='$classid'");
$del1=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$classid'");
}
//删除子节点
DelInfoClass1($classid);
//来源
if($_GET['from'])
{
$returnurl="ListPageInfoClass.php";
}
else
{
$returnurl="ListInfoClass.php";
}
if($del)
{
//操作日志
insert_dolog("classid=".$classid."
classname=".$r[classname]);
printerror("DelInfoClassSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
}
else
{printerror("DbError","history.go(-1)");}
}
//递归删除节点
function DelInfoClass1($classid){
global $empire,$dbtbpre;
if(empty($classid))
{
return "";
}
$sql=$empire->query("select classid,tid,tbname,newsclassid from {$dbtbpre}enewsinfoclass where bclassid='$classid'");
while($r=$empire->fetch($sql))
{
$del=$empire->query("delete from {$dbtbpre}enewsinfoclass where classid='$r[classid]'");
if($r[newsclassid])
{
$del1=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$r[classid]'");
$del2=$empire->query("delete from {$dbtbpre}ecms_infoclass_".$r[tbname]." where classid='$r[classid]'");
}
DelInfoClass1($r[classid]);
}
}
//设置伸缩
function SetDisplayInfoClass($open){
$time=time()+365*24*3600;
$set=esetcookie("displayinfoclass",$open,$time,1);
echo"";
exit();
}
//显示无限级节点[管理节点时]
function ShowClass_ListInfoClass($bclassid,$exp){
global $empire,$class_r,$fun_r,$dbtbpre,$ecms_hashur;
//缩
if(getcvar('displayinfoclass',1))
{
$display=" style=display:none";
}
if(empty($bclassid))
{
$bclassid=0;
$exp="";
}
else
{$exp=" ".$exp;}
$sql=$empire->query("select * from {$dbtbpre}enewsinfoclass where bclassid='$bclassid' order by classid desc");
$returnstr="";
while($r=$empire->fetch($sql))
{
//采集页面
$pager=explode("\r\n",$r[infourl]);
$infourl=eDoRepPostComStr($pager[0],1);
$divonclick="";
$start_tbody="";
$end_tbody="";
$img="../data/images/dir.gif";
if(empty($r[bclassid]))
{
$bgcolor="#DBEAF5";
$divonclick=" language=JScript onMouseUp='turnit(classdiv".$r[classid].");' style='CURSOR: hand' title='open'";
$start_tbody="
";
$end_tbody="";
}
else
{$bgcolor="#ffffff";}
if($r[newsclassid])
{
$lastcjtime=!$r['lasttime']?'从未采集':date("Y-m-d H:i:s",$r['lasttime']);
$cj="".$fun_r['StartCj']."";
$emptydb=" [".$fun_r['EmptyCjRecord']."]";
$loadoutcj=" [导出]";
$checkbox="";
}
else
{
$cj=$fun_r['StartCj'];
$emptydb="";
$loadoutcj="";
$checkbox="";
}
//栏目链接
$getcurlr['classid']=$r[newsclassid];
$classurl=sys_ReturnBqClassname($getcurlr,9);
$returnstr.="
".$checkbox." |
".$exp." |
".$cj." |
".$r[classname]." |
|
|
|
|
";
//取得子节点
$returnstr.=$start_tbody.ShowClass_ListInfoClass($r[classid],$exp).$end_tbody;
}
return $returnstr;
}
//清空采集记录
function EmptyCj($classid,$userid,$username){
global $empire,$dbtbpre;
$classid=(int)$classid;
if(empty($classid))
{printerror("NotEmptyCjClassid","history.go(-1)");}
//操作权限
CheckLevel($userid,$username,$classid,"cj");
$r=$empire->fetch1("select classid,classname,tbname from {$dbtbpre}enewsinfoclass where classid='$classid'");
if(!$r[classid])
{
printerror("ErrorUrl","history.go(-1)");
}
$sql=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$classid' and checked=1");
//来源
if($_GET['from'])
{
$returnurl="ListPageInfoClass.php";
}
else
{
$returnurl="ListInfoClass.php";
}
if($sql)
{
//操作日志
insert_dolog("classid=".$classid."
classname=".$r[classname]);
printerror("EmptyCjSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
}
else
{
printerror("DbError","history.go(-1)");
}
}
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
hCheckEcmsRHash();
}
//增加节点
if($enews=="AddInfoClass")
{
$bclassid=$_POST[bclassid];
$newsclassid=$_POST[newsclassid];
$add=$_POST[add];
$ztid=$_POST['ztid'];
$add['pagerepad']=$_POST['pagerepad'];
$add['repad']=$_POST['repad'];
AddInfoClass($bclassid,$newsclassid,$add,$ztid,$logininid,$loginin);
}
//修改节点
elseif($enews=="EditInfoClass")
{
$bclassid=$_POST[bclassid];
$newsclassid=$_POST[newsclassid];
$add=$_POST[add];
$ztid=$_POST['ztid'];
$add['pagerepad']=$_POST['pagerepad'];
$add['repad']=$_POST['repad'];
EditInfoClass($bclassid,$newsclassid,$add,$ztid,$logininid,$loginin);
}
//删除节点
elseif($enews=="DelInfoClass")
{
$classid=$_GET[classid];
DelInfoClass($classid,$logininid,$loginin);
}
//清空采集记录
elseif($enews=="EmptyCj")
{
$classid=$_GET['classid'];
EmptyCj($classid,$logininid,$loginin);
}
//展开
if($_GET['doopen'])
{
$open=(int)$_GET['open'];
SetDisplayInfoClass($open);
}
//图标
if(getcvar('displayinfoclass',1))
{
$img="
";
}
else
{
$img="
";
}
?>
管理节点
备注:弹出采集窗口,请按住"Shift"+点击”开始采集" |
db_close();
$empire=null;
?>