ListInfoClass.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../class/connect.php");
  4. require("../class/db_sql.php");
  5. require("../class/functions.php");
  6. require LoadLang("pub/fun.php");
  7. require("../data/dbcache/class.php");
  8. $link=db_connect();
  9. $empire=new mysqlquery();
  10. //验证用户
  11. $lur=is_login();
  12. $logininid=$lur['userid'];
  13. $loginin=$lur['username'];
  14. $loginrnd=$lur['rnd'];
  15. $loginlevel=$lur['groupid'];
  16. $loginadminstyleid=$lur['adminstyleid'];
  17. //ehash
  18. $ecms_hashur=hReturnEcmsHashStrAll();
  19. //验证权限
  20. CheckLevel($logininid,$loginin,$classid,"cj");
  21. //返回节点多列表
  22. function ReturnInfoUrl($r){
  23. if($r[infourl1])
  24. {
  25. if(empty($r['urlbs']))
  26. {
  27. $r['urlbs']=1;
  28. }
  29. for($i=$r[urlstart];$i<=$r[urlend];$i++)
  30. {
  31. $page=$i*$r['urlbs'];
  32. //补零
  33. if($r['urlbl'])
  34. {
  35. $page=AddNumZero($page,$r[urlend]);
  36. }
  37. $dourl=str_replace("[page]",$page,$r[infourl1]);
  38. //倒序
  39. if($r['urldx'])
  40. {
  41. $a="";
  42. if($i<>$r[urlend])
  43. {
  44. $a="\r\n";
  45. }
  46. $url=$a.$dourl.$url;
  47. }
  48. else
  49. {
  50. if($i<>$r[urlstart])
  51. {
  52. $a="\r\n";
  53. }
  54. $url.=$a.$dourl;
  55. }
  56. }
  57. }
  58. if($r[infourl])
  59. {
  60. if($url)
  61. {
  62. $url=$r[infourl]."\r\n".$url;
  63. }
  64. else
  65. {
  66. $url=$r[infourl];
  67. }
  68. }
  69. if(empty($url))
  70. {printerror("EmptyInfourl","history.go(-1)");}
  71. return $url;
  72. }
  73. //增加节点
  74. function AddInfoClass($bclassid,$newsclassid,$add,$ztid,$userid,$username){
  75. global $empire,$class_r,$dbtbpre;
  76. if(!$add[classname])
  77. {printerror("EmptyInfoTitleSuccess","history.go(-1)");}
  78. //操作权限
  79. CheckLevel($userid,$username,$classid,"cj");
  80. //选择栏目
  81. if($newsclassid)
  82. {
  83. if(!$class_r[$newsclassid][islast])
  84. {
  85. printerror("CjClassidMustLast","history.go(-1)");
  86. }
  87. //返回采集页面地址
  88. $add[infourl]=ReturnInfoUrl($add);
  89. //取得采集字段
  90. $mr=$empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='".$class_r[$newsclassid][modid]."'");
  91. $ret_r=ReturnAddCj($add,$mr[cj],0);
  92. }
  93. $lasttime=time();
  94. if(empty($add[startday]))
  95. {$add[startday]=date("Y-m-d");}
  96. if(empty($add[endday]))
  97. {$add[endday]="2099-12-31";}
  98. if(empty($add[relistnum]))
  99. {$add[relistnum]=1;}
  100. if(empty($add[renum]))
  101. {$add[renum]=2;}
  102. if(empty($add[insertnum]))
  103. {$add[insertnum]=10;}
  104. //处理变量
  105. $bclassid=(int)$bclassid;
  106. $newsclassid=(int)$newsclassid;
  107. $add[num]=(int)$add[num];
  108. $add[copyimg]=(int)$add[copyimg];
  109. $add[renum]=(int)$add[renum];
  110. $add[titlelen]=(int)$add[titlelen];
  111. $add[retitlewriter]=(int)$add[retitlewriter];
  112. $add[smalltextlen]=(int)$add[smalltextlen];
  113. $add[relistnum]=(int)$add[relistnum];
  114. $add[keynum]=(int)$add[keynum];
  115. $add[insertnum]=(int)$add[insertnum];
  116. $add[copyflash]=(int)$add[copyflash];
  117. $mr[tid]=(int)$mr[tid];
  118. $add[pagetype]=(int)$add[pagetype];
  119. $add[mark]=(int)$add[mark];
  120. $add[enpagecode]=(int)$add[enpagecode];
  121. $add[recjtheurl]=(int)$add[recjtheurl];
  122. $add[hiddenload]=(int)$add[hiddenload];
  123. $add[justloadin]=(int)$add[justloadin];
  124. $add[justloadcheck]=(int)$add[justloadcheck];
  125. $add[delloadinfo]=(int)$add[delloadinfo];
  126. $add[getfirstpic]=(int)$add[getfirstpic];
  127. $add[getfirstspic]=(int)$add[getfirstspic];
  128. $add[getfirstspicw]=(int)$add[getfirstspicw];
  129. $add[getfirstspich]=(int)$add[getfirstspich];
  130. $add[doaddtextpage]=(int)$add[doaddtextpage];
  131. $add[infourlispage]=(int)$add[infourlispage];
  132. $keeptime=(int)$add['keeptime'];
  133. $newstextisnull=(int)$add['newstextisnull'];
  134. $loadkeeptime=(int)$add['loadkeeptime'];
  135. $add['classname']=eDoRepPostComStr($add['classname']);
  136. $add['startday']=hRepPostStr($add['startday'],1);
  137. $add['endday']=hRepPostStr($add['endday'],1);
  138. $add['save_titlepicl']=hRepPostStr2($add['save_titlepicl']);
  139. $mr['tbname']=hRepPostStr2($mr['tbname']);
  140. $add['repf']='';
  141. if($_POST['repf'])
  142. {
  143. $add['repf']=$_POST['repf'];
  144. $add['repf']=','.hRepPostStr($add['repf'],1).',';
  145. }
  146. $add['repadf']='';
  147. if($_POST['repadf'])
  148. {
  149. $add['repadf']=$_POST['repadf'];
  150. $add['repadf']=','.hRepPostStr($add['repadf'],1).',';
  151. }
  152. $add['isnullf']='';
  153. if($_POST['isnullf'])
  154. {
  155. $add['isnullf']=$_POST['isnullf'];
  156. $add['isnullf']=','.hRepPostStr($add['isnullf'],1).',';
  157. }
  158. //写入主表
  159. $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]');");
  160. $classid=$empire->lastid();
  161. if($newsclassid)
  162. {
  163. //写入副表
  164. $usql=$empire->query("insert into {$dbtbpre}ecms_infoclass_".$mr[tbname]."(classid".$ret_r[0].") values($classid".$ret_r[1].");");
  165. }
  166. if($sql)
  167. {
  168. //操作日志
  169. insert_dolog("classid=".$classid."<br>classname=".$add[classname]);
  170. printerror("AddInfoClassSuccess","AddInfoClass.php?enews=AddInfoClass&newsclassid=$newsclassid&from=".ehtmlspecialchars($_POST[from]).hReturnEcmsHashStrHref2(0));
  171. }
  172. else
  173. {printerror("DbError","history.go(-1)");}
  174. }
  175. //修改节点
  176. function EditInfoClass($bclassid,$newsclassid,$add,$ztid,$userid,$username){
  177. global $empire,$class_r,$dbtbpre;
  178. if(!$add[classid]||!$add[classname])
  179. {printerror("EmptyInfoTitleSuccess","history.go(-1)");}
  180. //操作权限
  181. CheckLevel($userid,$username,$classid,"cj");
  182. //父节点与原节点一样
  183. if($add[classid]==$bclassid)
  184. {printerror("OldInfoidNotSingle","history.go(-1)");}
  185. //选择栏目
  186. if($newsclassid)
  187. {
  188. if(!$class_r[$newsclassid][islast])
  189. {
  190. printerror("CjClassidMustLast","history.go(-1)");
  191. }
  192. //返回采集页面地址
  193. $add[infourl]=ReturnInfoUrl($add);
  194. //取得采集字段
  195. $mr=$empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='".$class_r[$newsclassid][modid]."'");
  196. }
  197. if(empty($add[startday]))
  198. {$add[startday]=date("Y-m-d");}
  199. if(empty($add[endday]))
  200. {$add[endday]="2099-12-31";}
  201. if(empty($add[relistnum]))
  202. {$add[relistnum]=1;}
  203. if(empty($add[renum]))
  204. {$add[renum]=2;}
  205. if(empty($add[insertnum]))
  206. {$add[insertnum]=10;}
  207. //处理变量
  208. $add[classid]=(int)$add[classid];
  209. $bclassid=(int)$bclassid;
  210. $newsclassid=(int)$newsclassid;
  211. $add[num]=(int)$add[num];
  212. $add[copyimg]=(int)$add[copyimg];
  213. $add[renum]=(int)$add[renum];
  214. $add[titlelen]=(int)$add[titlelen];
  215. $add[retitlewriter]=(int)$add[retitlewriter];
  216. $add[smalltextlen]=(int)$add[smalltextlen];
  217. $add[relistnum]=(int)$add[relistnum];
  218. $add[keynum]=(int)$add[keynum];
  219. $add[insertnum]=(int)$add[insertnum];
  220. $add[copyflash]=(int)$add[copyflash];
  221. $mr[tid]=(int)$mr[tid];
  222. $add[pagetype]=(int)$add[pagetype];
  223. $add[mark]=(int)$add[mark];
  224. $add[enpagecode]=(int)$add[enpagecode];
  225. $add[recjtheurl]=(int)$add[recjtheurl];
  226. $add[hiddenload]=(int)$add[hiddenload];
  227. $add[justloadin]=(int)$add[justloadin];
  228. $add[justloadcheck]=(int)$add[justloadcheck];
  229. $add[delloadinfo]=(int)$add[delloadinfo];
  230. $add[getfirstpic]=(int)$add[getfirstpic];
  231. $add[getfirstspic]=(int)$add[getfirstspic];
  232. $add[getfirstspicw]=(int)$add[getfirstspicw];
  233. $add[getfirstspich]=(int)$add[getfirstspich];
  234. $add[doaddtextpage]=(int)$add[doaddtextpage];
  235. $add[infourlispage]=(int)$add[infourlispage];
  236. $keeptime=(int)$add['keeptime'];
  237. $newstextisnull=(int)$add['newstextisnull'];
  238. $loadkeeptime=(int)$add['loadkeeptime'];
  239. $add['classname']=eDoRepPostComStr($add['classname']);
  240. $add['startday']=hRepPostStr($add['startday'],1);
  241. $add['endday']=hRepPostStr($add['endday'],1);
  242. $add['save_titlepicl']=hRepPostStr2($add['save_titlepicl']);
  243. $mr['tbname']=hRepPostStr2($mr['tbname']);
  244. $add['repf']='';
  245. if($_POST['repf'])
  246. {
  247. $add['repf']=$_POST['repf'];
  248. $add['repf']=','.hRepPostStr($add['repf'],1).',';
  249. }
  250. $add['repadf']='';
  251. if($_POST['repadf'])
  252. {
  253. $add['repadf']=$_POST['repadf'];
  254. $add['repadf']=','.hRepPostStr($add['repadf'],1).',';
  255. }
  256. $add['isnullf']='';
  257. if($_POST['isnullf'])
  258. {
  259. $add['isnullf']=$_POST['isnullf'];
  260. $add['isnullf']=','.hRepPostStr($add['isnullf'],1).',';
  261. }
  262. //主表
  263. $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]'");
  264. if($newsclassid)
  265. {
  266. //是否已有记录
  267. $havenum=$empire->num("select count(*) as total from {$dbtbpre}ecms_infoclass_".$mr[tbname]." where classid='$add[classid]' limit 1");
  268. //原本是父栏目
  269. if(empty($add[oldnewsclassid])&&!$havenum)
  270. {
  271. $ret_r=ReturnAddCj($add,$mr[cj],0);
  272. //写入副表
  273. $usql=$empire->query("insert into {$dbtbpre}ecms_infoclass_".$mr[tbname]."(classid".$ret_r[0].") values($add[classid]".$ret_r[1].");");
  274. }
  275. else
  276. {
  277. $ret_r=ReturnAddCj($add,$mr[cj],1);
  278. //副表
  279. $usql=$empire->query("update {$dbtbpre}ecms_infoclass_".$mr[tbname]." set classid='$add[classid]'".$ret_r[0]." where classid='$add[classid]'");
  280. }
  281. }
  282. //来源
  283. if($_POST['from'])
  284. {
  285. $returnurl="ListPageInfoClass.php";
  286. }
  287. else
  288. {
  289. $returnurl="ListInfoClass.php";
  290. }
  291. if($sql)
  292. {
  293. //操作日志
  294. insert_dolog("classid=".$add[classid]."<br>classname=".$add[classname]);
  295. printerror("EditInfoClassSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
  296. }
  297. else
  298. {printerror("DbError","history.go(-1)");}
  299. }
  300. //删除采集节点
  301. function DelInfoClass($classid,$userid,$username){
  302. global $empire,$dbtbpre;
  303. $classid=(int)$classid;
  304. if(empty($classid))
  305. {printerror("NotDelInfoid","history.go(-1)");}
  306. //操作权限
  307. CheckLevel($userid,$username,$classid,"cj");
  308. $r=$empire->fetch1("select classname,tid,tbname,newsclassid from {$dbtbpre}enewsinfoclass where classid='$classid'");
  309. $del=$empire->query("delete from {$dbtbpre}enewsinfoclass where classid='$classid'");
  310. if($r[newsclassid])
  311. {
  312. $del2=$empire->query("delete from {$dbtbpre}ecms_infoclass_".$r[tbname]." where classid='$classid'");
  313. $del1=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$classid'");
  314. }
  315. //删除子节点
  316. DelInfoClass1($classid);
  317. //来源
  318. if($_GET['from'])
  319. {
  320. $returnurl="ListPageInfoClass.php";
  321. }
  322. else
  323. {
  324. $returnurl="ListInfoClass.php";
  325. }
  326. if($del)
  327. {
  328. //操作日志
  329. insert_dolog("classid=".$classid."<br>classname=".$r[classname]);
  330. printerror("DelInfoClassSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
  331. }
  332. else
  333. {printerror("DbError","history.go(-1)");}
  334. }
  335. //递归删除节点
  336. function DelInfoClass1($classid){
  337. global $empire,$dbtbpre;
  338. if(empty($classid))
  339. {
  340. return "";
  341. }
  342. $sql=$empire->query("select classid,tid,tbname,newsclassid from {$dbtbpre}enewsinfoclass where bclassid='$classid'");
  343. while($r=$empire->fetch($sql))
  344. {
  345. $del=$empire->query("delete from {$dbtbpre}enewsinfoclass where classid='$r[classid]'");
  346. if($r[newsclassid])
  347. {
  348. $del1=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$r[classid]'");
  349. $del2=$empire->query("delete from {$dbtbpre}ecms_infoclass_".$r[tbname]." where classid='$r[classid]'");
  350. }
  351. DelInfoClass1($r[classid]);
  352. }
  353. }
  354. //设置伸缩
  355. function SetDisplayInfoClass($open){
  356. $time=time()+365*24*3600;
  357. $set=esetcookie("displayinfoclass",$open,$time,1);
  358. echo"<script>self.location.href='ListInfoClass.php".hReturnEcmsHashStrHref2(1)."';</script>";
  359. exit();
  360. }
  361. //显示无限级节点[管理节点时]
  362. function ShowClass_ListInfoClass($bclassid,$exp){
  363. global $empire,$class_r,$fun_r,$dbtbpre,$ecms_hashur;
  364. //缩
  365. if(getcvar('displayinfoclass',1))
  366. {
  367. $display=" style=display:none";
  368. }
  369. if(empty($bclassid))
  370. {
  371. $bclassid=0;
  372. $exp="";
  373. }
  374. else
  375. {$exp="&nbsp;&nbsp;&nbsp;".$exp;}
  376. $sql=$empire->query("select * from {$dbtbpre}enewsinfoclass where bclassid='$bclassid' order by classid desc");
  377. $returnstr="";
  378. while($r=$empire->fetch($sql))
  379. {
  380. //采集页面
  381. $pager=explode("\r\n",$r[infourl]);
  382. $infourl=eDoRepPostComStr($pager[0],1);
  383. $divonclick="";
  384. $start_tbody="";
  385. $end_tbody="";
  386. $img="../data/images/dir.gif";
  387. if(empty($r[bclassid]))
  388. {
  389. $bgcolor="#DBEAF5";
  390. $divonclick=" language=JScript onMouseUp='turnit(classdiv".$r[classid].");' style='CURSOR: hand' title='open'";
  391. $start_tbody="<tbody id='classdiv".$r[classid]."'".$display.">";
  392. $end_tbody="</tbody>";
  393. }
  394. else
  395. {$bgcolor="#ffffff";}
  396. if($r[newsclassid])
  397. {
  398. $lastcjtime=!$r['lasttime']?'从未采集':date("Y-m-d H:i:s",$r['lasttime']);
  399. $cj="<a href='DoCj.php?enews=CjUrl&classid[]=".$r[classid].$ecms_hashur['href']."' title='最后采集时间:".$lastcjtime."' target=_blank><u>".$fun_r['StartCj']."</u></a>";
  400. $emptydb="&nbsp;[<a href=ListInfoClass.php?enews=EmptyCj&classid=$r[classid]".$ecms_hashur['href']." onclick=\"return confirm('".$fun_r['CheckEmptyCjRecord']."');\">".$fun_r['EmptyCjRecord']."</a>]";
  401. $loadoutcj="&nbsp;[<a href=ecmscj.php?enews=LoadOutCj&classid=$r[classid]".$ecms_hashur['href']." onclick=\"return confirm('确认要导出?');\">导出</a>]";
  402. $checkbox="<input type=checkbox name=classid[] value=$r[classid]>";
  403. }
  404. else
  405. {
  406. $cj=$fun_r['StartCj'];
  407. $emptydb="";
  408. $loadoutcj="";
  409. $checkbox="";
  410. }
  411. //栏目链接
  412. $getcurlr['classid']=$r[newsclassid];
  413. $classurl=sys_ReturnBqClassname($getcurlr,9);
  414. $returnstr.="<tr bgcolor=".$bgcolor.">
  415. <td height=25 align='center'>".$checkbox."</td>
  416. <td height=25".$divonclick.">".$exp."<img src=".$img." width=19 height=15></td>
  417. <td height=25><div align=center>".$cj."</div></td>
  418. <td height=25><a href='".$infourl."' target=_blank>".$r[classname]."</a></td>
  419. <td height=25><div align=center><a href=ecmscj.php?enews=ViewCjList&classid=".$r[classid].$ecms_hashur['href']." target=_blank>".$fun_r['view']."</a></div></td>
  420. <td height=25><div align=center><a href='".$classurl."' target=_blank>".$class_r[$r[newsclassid]][classname]."</a></div></td>
  421. <td height=25><div align=center><a href=CheckCj.php?classid=".$r[classid].$ecms_hashur['ehref'].">".$fun_r['CheckCj']."</a></div></td>
  422. <td height=25><div align=center>[<a href=AddInfoClass.php?enews=AddInfoClass&docopy=1&classid=".$r[classid]."&newsclassid=".$r[newsclassid].$ecms_hashur['ehref'].">".$fun_r['Copy']."</a>]&nbsp;[<a href=AddInfoClass.php?enews=EditInfoClass&classid=".$r[classid].$ecms_hashur['ehref'].">".$fun_r['edit']."</a>]&nbsp;[<a href=ListInfoClass.php?enews=DelInfoClass&classid=".$r[classid].$ecms_hashur['href']." onclick=\"return confirm('".$fun_r['CheckDelCj']."');\">".$fun_r['del']."</a>]".$emptydb.$loadoutcj."</div></td>
  423. </tr>";
  424. //取得子节点
  425. $returnstr.=$start_tbody.ShowClass_ListInfoClass($r[classid],$exp).$end_tbody;
  426. }
  427. return $returnstr;
  428. }
  429. //清空采集记录
  430. function EmptyCj($classid,$userid,$username){
  431. global $empire,$dbtbpre;
  432. $classid=(int)$classid;
  433. if(empty($classid))
  434. {printerror("NotEmptyCjClassid","history.go(-1)");}
  435. //操作权限
  436. CheckLevel($userid,$username,$classid,"cj");
  437. $r=$empire->fetch1("select classid,classname,tbname from {$dbtbpre}enewsinfoclass where classid='$classid'");
  438. if(!$r[classid])
  439. {
  440. printerror("ErrorUrl","history.go(-1)");
  441. }
  442. $sql=$empire->query("delete from {$dbtbpre}ecms_infotmp_".$r[tbname]." where classid='$classid' and checked=1");
  443. //来源
  444. if($_GET['from'])
  445. {
  446. $returnurl="ListPageInfoClass.php";
  447. }
  448. else
  449. {
  450. $returnurl="ListInfoClass.php";
  451. }
  452. if($sql)
  453. {
  454. //操作日志
  455. insert_dolog("classid=".$classid."<br>classname=".$r[classname]);
  456. printerror("EmptyCjSuccess",$returnurl.hReturnEcmsHashStrHref2(1));
  457. }
  458. else
  459. {
  460. printerror("DbError","history.go(-1)");
  461. }
  462. }
  463. $enews=$_POST['enews'];
  464. if(empty($enews))
  465. {$enews=$_GET['enews'];}
  466. if($enews)
  467. {
  468. hCheckEcmsRHash();
  469. }
  470. //增加节点
  471. if($enews=="AddInfoClass")
  472. {
  473. $bclassid=$_POST[bclassid];
  474. $newsclassid=$_POST[newsclassid];
  475. $add=$_POST[add];
  476. $ztid=$_POST['ztid'];
  477. $add['pagerepad']=$_POST['pagerepad'];
  478. $add['repad']=$_POST['repad'];
  479. AddInfoClass($bclassid,$newsclassid,$add,$ztid,$logininid,$loginin);
  480. }
  481. //修改节点
  482. elseif($enews=="EditInfoClass")
  483. {
  484. $bclassid=$_POST[bclassid];
  485. $newsclassid=$_POST[newsclassid];
  486. $add=$_POST[add];
  487. $ztid=$_POST['ztid'];
  488. $add['pagerepad']=$_POST['pagerepad'];
  489. $add['repad']=$_POST['repad'];
  490. EditInfoClass($bclassid,$newsclassid,$add,$ztid,$logininid,$loginin);
  491. }
  492. //删除节点
  493. elseif($enews=="DelInfoClass")
  494. {
  495. $classid=$_GET[classid];
  496. DelInfoClass($classid,$logininid,$loginin);
  497. }
  498. //清空采集记录
  499. elseif($enews=="EmptyCj")
  500. {
  501. $classid=$_GET['classid'];
  502. EmptyCj($classid,$logininid,$loginin);
  503. }
  504. //展开
  505. if($_GET['doopen'])
  506. {
  507. $open=(int)$_GET['open'];
  508. SetDisplayInfoClass($open);
  509. }
  510. //图标
  511. if(getcvar('displayinfoclass',1))
  512. {
  513. $img="<a href='ListInfoClass.php?doopen=1&open=0".$ecms_hashur['ehref']."' title='展开'><img src='../data/images/displaynoadd.gif' width='15' height='15' border='0'></a>";
  514. }
  515. else
  516. {
  517. $img="<a href='ListInfoClass.php?doopen=1&open=1".$ecms_hashur['ehref']."' title='收缩'><img src='../data/images/displayadd.gif' width='15' height='15' border='0'></a>";
  518. }
  519. ?>
  520. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  521. <html>
  522. <head>
  523. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  524. <title>管理节点</title>
  525. <link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  526. <script>
  527. function CheckAll(form)
  528. {
  529. for (var i=0;i<form.elements.length;i++)
  530. {
  531. var e = form.elements[i];
  532. if (e.name != 'chkall')
  533. e.checked = form.chkall.checked;
  534. }
  535. }
  536. function turnit(ss)
  537. {
  538. if (ss.style.display=="")
  539. ss.style.display="none";
  540. else
  541. ss.style.display="";
  542. }
  543. var newWindow = null
  544. </script>
  545. </head>
  546. <body>
  547. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
  548. <tr>
  549. <td width="50%">位置:采集 &gt; <a href="ListInfoClass.php<?=$ecms_hashur['whehref']?>">管理节点</a></td>
  550. <td><div align="right" class="emenubutton">
  551. <input type="button" name="Submit5" value="增加节点" onclick="self.location.href='AddInfoC.php<?=$ecms_hashur['whehref']?>';">
  552. &nbsp;&nbsp;
  553. <input type="button" name="Submit52" value="导入采集规则" onclick="self.location.href='cj/LoadInCj.php<?=$ecms_hashur['whehref']?>';">
  554. &nbsp;&nbsp;
  555. <input type="button" name="Submit6" value="数据更新中心" onclick="window.open('ReHtml/ChangeData.php<?=$ecms_hashur['whehref']?>#ReIfInfoHtml');">
  556. </div></td>
  557. </tr>
  558. </table>
  559. <form name=form1 method=get action="DoCj.php" onsubmit="return confirm('确认要采集?');" target=_blank>
  560. <table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
  561. <?=$ecms_hashur['form']?>
  562. <input type=hidden name=enews value=DoCj>
  563. <tr class="header">
  564. <td width="3%"><div align="center"></div></td>
  565. <td width="8%" height="25"><div align="center"><?=$img?></div></td>
  566. <td width="8%" height="25"> <div align="center">采集</div></td>
  567. <td width="27%" height="25"> <div align="center">节点(点击访问采集页)</div></td>
  568. <td width="6%" height="25"> <div align="center">预览</div></td>
  569. <td width="16%" height="25"> <div align="center">绑定栏目</div></td>
  570. <td width="9%" height="25"> <div align="center">审核采集</div></td>
  571. <td width="24%" height="25">
  572. <div align="center">操作</div></td>
  573. </tr>
  574. <?
  575. echo ShowClass_ListInfoClass(0,'');
  576. ?>
  577. </table>
  578. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  579. <tr>
  580. <td><input type=checkbox name=chkall value=on onClick=CheckAll(this.form)>
  581. 选中全部
  582. &nbsp;&nbsp;<input type="submit" name="Submit" value="批量采集节点"></td>
  583. </tr>
  584. </table>
  585. </form>
  586. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  587. <tr>
  588. <td><font color="#666666">备注:弹出采集窗口,请按住&quot;Shift&quot;+点击”开始采集&quot;</font></td>
  589. </tr>
  590. </table>
  591. </body>
  592. </html>
  593. <?
  594. db_close();
  595. $empire=null;
  596. ?>