ListSpInfo.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  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. $editor=1;
  11. //验证用户
  12. $lur=is_login();
  13. $logininid=$lur['userid'];
  14. $loginin=$lur['username'];
  15. $loginrnd=$lur['rnd'];
  16. $loginlevel=$lur['groupid'];
  17. $loginadminstyleid=$lur['adminstyleid'];
  18. //ehash
  19. $ecms_hashur=hReturnEcmsHashStrAll();
  20. //验证权限
  21. function CheckSpInfoLevel($spid){
  22. global $empire,$dbtbpre,$lur;
  23. $spr=$empire->fetch1("select spid,spname,varname,sptype,maxnum,groupid,userclass,username from {$dbtbpre}enewssp where spid='$spid'");
  24. if(!$spr['spid'])
  25. {
  26. printerror('ErrorUrl','');
  27. }
  28. //验证操作权限
  29. CheckDoLevel($lur,$spr[groupid],$spr[userclass],$spr[username]);
  30. return $spr;
  31. }
  32. //增加碎片信息
  33. function AddSpInfo($add,$userid,$username){
  34. global $empire,$dbtbpre;
  35. $spid=(int)$add[spid];
  36. if(!$spid)
  37. {
  38. printerror('ErrorUrl','');
  39. }
  40. //验证
  41. $spr=CheckSpInfoLevel($spid);
  42. if($spr[sptype]==1)//静态碎片
  43. {
  44. $log=AddSpInfo1($spid,$spr,$add);
  45. }
  46. elseif($spr[sptype]==2)//动态碎片
  47. {
  48. $log=AddSpInfo2($spid,$spr,$add);
  49. }
  50. else
  51. {
  52. printerror('ErrorUrl','');
  53. }
  54. //删除多余碎片信息
  55. DelMoreSpInfo($spid,$spr);
  56. //更新附件
  57. UpdateTheFileEditOther(7,$spid,'other');
  58. //操作日志
  59. insert_dolog($log);
  60. printerror("AddSpInfoSuccess","AddSpInfo.php?enews=AddSpInfo&spid=$spid".hReturnEcmsHashStrHref2(0));
  61. }
  62. //导入碎片信息
  63. function LoadInSpInfo($add,$userid,$username){
  64. global $empire,$dbtbpre,$class_r,$emod_r,$etable_r;
  65. $spid=(int)$add[spid];
  66. if(!$spid)
  67. {
  68. printerror('ErrorUrl','');
  69. }
  70. //验证
  71. $spr=CheckSpInfoLevel($spid);
  72. $tbname=RepPostVar($add['tbname']);
  73. $infoids=$add['infoids'];
  74. if(!$tbname||!$infoids)
  75. {
  76. printerror('ErrorUrl','');
  77. }
  78. $tbr=$empire->fetch1("select tbname from {$dbtbpre}enewstable where tbname='$tbname' limit 1");
  79. if(!$tbr['tbname'])
  80. {
  81. printerror('ErrorUrl','');
  82. }
  83. //简介字段
  84. $mid=$etable_r[$tbname]['mid'];
  85. $smalltextf=$emod_r[$mid]['smalltextf'];
  86. $sf='';
  87. if($smalltextf&&$smalltextf<>',')
  88. {
  89. $smr=explode(',',$smalltextf);
  90. $sf=$smr[1];
  91. }
  92. $addf='';
  93. if($sf&&!strstr($emod_r[$mid]['tbdataf'],','.$sf.','))
  94. {
  95. $addf=','.$sf;
  96. }
  97. //导入
  98. $infor=explode(',',$infoids);
  99. $count=count($infor);
  100. for($i=0;$i<$count;$i++)
  101. {
  102. $infoid=(int)$infor[$i];
  103. if(!$infoid)
  104. {
  105. continue;
  106. }
  107. $r=$empire->fetch1("select id,classid,isurl,titleurl,newstime,titlepic,title,stb".$addf." from {$dbtbpre}ecms_".$tbname." where id='$infoid' limit 1");
  108. if(!$r['id'])
  109. {
  110. continue;
  111. }
  112. if($sf&&!$addf)
  113. {
  114. $finfor=$empire->fetch1("select ".$sf." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$infoid' limit 1");
  115. $r['smalltext']=$finfor[$sf];
  116. }
  117. else
  118. {
  119. $r['smalltext']=$r[$sf];
  120. }
  121. $r['newstime']=date("Y-m-d H:i:s",$r['newstime']);
  122. if($spr[sptype]==1)//静态碎片
  123. {
  124. $log=AddSpInfo1($spid,$spr,$r);
  125. }
  126. elseif($spr[sptype]==2)//动态碎片
  127. {
  128. $log=AddSpInfo2($spid,$spr,$r,1);
  129. }
  130. else
  131. {
  132. printerror('ErrorUrl','');
  133. }
  134. }
  135. //删除多余碎片信息
  136. DelMoreSpInfo($spid,$spr);
  137. //操作日志
  138. insert_dolog("tbname=$tbname<br>id=$infoids");
  139. printerror("LoadInSpInfoSuccess","ListSpInfo.php?spid=$spid".hReturnEcmsHashStrHref2(0));
  140. }
  141. //增加静态碎片信息
  142. function AddSpInfo1($spid,$spr,$add){
  143. global $empire,$dbtbpre;
  144. $add['title']=eDoRepPostComStr($add['title'],1);
  145. $add['titlepic']=eDoRepPostComStr($add['titlepic'],1);
  146. $add['titleurl']=eDoRepPostComStr($add['titleurl'],1);
  147. $titlefont=TitleFont($add[titlefont],$add[titlecolor]);
  148. $newstime=$add[newstime]?to_time($add[newstime]):time();
  149. $sql=$empire->query("insert into {$dbtbpre}enewssp_1(spid,title,titlepic,bigpic,titleurl,smalltext,titlefont,newstime,titlepre,titlenext) values('$spid','".eaddslashes2($add[title])."','".eaddslashes2($add[titlepic])."','".eaddslashes2($add[bigpic])."','".eaddslashes2($add[titleurl])."','".eaddslashes2($add[smalltext])."','".eaddslashes2($titlefont)."','$newstime','".eaddslashes2($add[titlepre])."','".eaddslashes2($add[titlenext])."');");
  150. $sid=$empire->lastid();
  151. $log="spid=$spid&sid=$sid&title=$add[title]";
  152. return $log;
  153. }
  154. //增加动态碎片信息
  155. function AddSpInfo2($spid,$spr,$add,$ecms=0){
  156. global $empire,$dbtbpre,$class_r;
  157. $add[classid]=(int)$add[classid];
  158. $add[id]=(int)$add[id];
  159. if(empty($class_r[$add[classid]][tbname]))
  160. {
  161. if($ecms==1)
  162. {
  163. return '';
  164. }
  165. else
  166. {
  167. printerror('HaveNotInfo','');
  168. }
  169. }
  170. $infor=$empire->fetch1("select id,classid,newstime from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]."_index where id='$add[id]'");
  171. if(!$infor[id]||$infor[classid]!=$add[classid])
  172. {
  173. if($ecms==1)
  174. {
  175. return '';
  176. }
  177. else
  178. {
  179. printerror('HaveNotInfo','');
  180. }
  181. }
  182. $newstime=$add[newstime]?to_time($add[newstime]):$infor[newstime];
  183. //是否重复
  184. $rer=$empire->fetch1("select sid from {$dbtbpre}enewssp_2 where spid='$spid' and id='$add[id]' and classid='$add[classid]' limit 1");
  185. if($rer['sid'])
  186. {
  187. if($ecms==1)
  188. {
  189. return '';
  190. }
  191. else
  192. {
  193. printerror('HaveSpInfo','');
  194. }
  195. }
  196. $sql=$empire->query("insert into {$dbtbpre}enewssp_2(spid,classid,id,newstime) values('$spid','$add[classid]','$add[id]','$newstime');");
  197. $sid=$empire->lastid();
  198. $log="spid=$spid&sid=$sid&classid=$add[classid]&id=$add[id]";
  199. return $log;
  200. }
  201. //删除多余碎片信息
  202. function DelMoreSpInfo($spid,$spr){
  203. global $empire,$dbtbpre;
  204. if(!$spr[maxnum]||$spr[sptype]==3)
  205. {
  206. return '';
  207. }
  208. if($spr[sptype]==1)
  209. {
  210. $num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewssp_1 where spid='$spid'");
  211. if($num>$spr[maxnum])
  212. {
  213. $limitnum=$num-$spr[maxnum];
  214. $ids='';
  215. $dh='';
  216. $sql=$empire->query("select sid from {$dbtbpre}enewssp_1 where spid='$spid' order by sid limit ".$limitnum);
  217. while($r=$empire->fetch($sql))
  218. {
  219. $ids.=$dh.$r['sid'];
  220. $dh=',';
  221. }
  222. $empire->query("delete from {$dbtbpre}enewssp_1 where sid in ($ids)");
  223. }
  224. }
  225. elseif($spr[sptype]==2)
  226. {
  227. $num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewssp_2 where spid='$spid'");
  228. if($num>$spr[maxnum])
  229. {
  230. $limitnum=$num-$spr[maxnum];
  231. $ids='';
  232. $dh='';
  233. $sql=$empire->query("select sid from {$dbtbpre}enewssp_2 where spid='$spid' order by sid limit ".$limitnum);
  234. while($r=$empire->fetch($sql))
  235. {
  236. $ids.=$dh.$r['sid'];
  237. $dh=',';
  238. }
  239. $empire->query("delete from {$dbtbpre}enewssp_2 where sid in ($ids)");
  240. }
  241. }
  242. }
  243. //修改碎片信息
  244. function EditSpInfo($add,$userid,$username){
  245. global $empire,$dbtbpre;
  246. $spid=(int)$add[spid];
  247. $sid=(int)$add['sid'];
  248. if(!$spid)
  249. {
  250. printerror('ErrorUrl','');
  251. }
  252. //验证
  253. $spr=CheckSpInfoLevel($spid);
  254. if($spr[sptype]==1)//静态碎片
  255. {
  256. $log=EditSpInfo1($spid,$spr,$sid,$add);
  257. }
  258. elseif($spr[sptype]==2)//动态碎片
  259. {
  260. $log=EditSpInfo2($spid,$spr,$sid,$add);
  261. }
  262. elseif($spr[sptype]==3)//代码碎片
  263. {
  264. $log=EditSpInfo3($spid,$spr,$sid,$add);
  265. }
  266. else
  267. {
  268. printerror('ErrorUrl','');
  269. }
  270. //删除多余碎片信息
  271. DelMoreSpInfo($spid,$spr);
  272. //更新附件
  273. UpdateTheFileEditOther(7,$spid,'other');
  274. //操作日志
  275. insert_dolog($log);
  276. printerror("EditSpInfoSuccess","ListSpInfo.php?spid=$spid".hReturnEcmsHashStrHref2(0));
  277. }
  278. //修改静态碎片信息
  279. function EditSpInfo1($spid,$spr,$sid,$add){
  280. global $empire,$dbtbpre;
  281. if(!$sid)
  282. {
  283. printerror('ErrorUrl','');
  284. }
  285. $checknum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewssp_1 where sid='$sid' and spid='$spid'");
  286. if(!$checknum)
  287. {
  288. printerror('ErrorUrl','');
  289. }
  290. $add['title']=eDoRepPostComStr($add['title'],1);
  291. $add['titlepic']=eDoRepPostComStr($add['titlepic'],1);
  292. $add['titleurl']=eDoRepPostComStr($add['titleurl'],1);
  293. $titlefont=TitleFont($add[titlefont],$add[titlecolor]);
  294. $newstime=$add[newstime]?to_time($add[newstime]):time();
  295. $empire->query("update {$dbtbpre}enewssp_1 set title='".eaddslashes2($add[title])."',titlepic='".eaddslashes2($add[titlepic])."',bigpic='".eaddslashes2($add[bigpic])."',titleurl='".eaddslashes2($add[titleurl])."',smalltext='".eaddslashes2($add[smalltext])."',titlefont='".eaddslashes2($titlefont)."',newstime='$newstime',titlepre='".eaddslashes2($add[titlepre])."',titlenext='".eaddslashes2($add[titlenext])."' where sid='$sid' and spid='$spid'");
  296. $log="spid=$spid&sid=$sid&title=$add[title]";
  297. return $log;
  298. }
  299. //修改动态碎片信息
  300. function EditSpInfo2($spid,$spr,$sid,$add){
  301. global $empire,$dbtbpre,$class_r;
  302. if(!$sid)
  303. {
  304. printerror('ErrorUrl','');
  305. }
  306. $checknum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewssp_2 where sid='$sid' and spid='$spid'");
  307. if(!$checknum)
  308. {
  309. printerror('ErrorUrl','');
  310. }
  311. $add[classid]=(int)$add[classid];
  312. $add[id]=(int)$add[id];
  313. if(empty($class_r[$add[classid]][tbname]))
  314. {
  315. printerror('HaveNotInfo','');
  316. }
  317. $infor=$empire->fetch1("select id,classid,newstime from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]."_index where id='$add[id]'");
  318. if(!$infor[id]||$infor[classid]!=$add[classid])
  319. {
  320. printerror('HaveNotInfo','');
  321. }
  322. $newstime=$add[newstime]?to_time($add[newstime]):$infor[newstime];
  323. //是否重复
  324. $rer=$empire->fetch1("select sid from {$dbtbpre}enewssp_2 where spid='$spid' and id='$add[id]' and classid='$add[classid]' and sid<>$sid limit 1");
  325. if($rer['sid'])
  326. {
  327. printerror('HaveSpInfo','');
  328. }
  329. $empire->query("update {$dbtbpre}enewssp_2 set classid='$add[classid]',id='$add[id]',newstime='$newstime' where sid='$sid' and spid='$spid'");
  330. $log="spid=$spid&sid=$sid&classid=$add[classid]&id=$add[id]";
  331. return $log;
  332. }
  333. //修改代码碎片信息
  334. function EditSpInfo3($spid,$spr,$sid,$add){
  335. global $empire,$dbtbpre;
  336. $r=$empire->fetch1("select sid from {$dbtbpre}enewssp_3 where spid='$spid'");
  337. if($r['sid'])
  338. {
  339. $empire->query("update {$dbtbpre}enewssp_3 set sptext='".eaddslashes2($add[sptext])."' where spid='$spid'");
  340. $sid=$r['sid'];
  341. }
  342. else
  343. {
  344. $empire->query("insert into {$dbtbpre}enewssp_3(spid,sptext) values('$spid','".eaddslashes2($add[sptext])."');");
  345. $sid=$empire->lastid();
  346. }
  347. //备份
  348. EditSpInfo3_bak($spid,$sid,$add[sptext]);
  349. $log="spid=$spid&sid=$sid&sptype=3";
  350. return $log;
  351. }
  352. //备份代码碎片信息
  353. function EditSpInfo3_bak($spid,$sid,$sptext){
  354. global $empire,$dbtbpre,$lur;
  355. $baknum=10; //备份最大数量
  356. $username=$lur[username];
  357. $time=time();
  358. $empire->query("insert into {$dbtbpre}enewssp_3_bak(sid,spid,sptext,lastuser,lasttime) values('$sid','$spid','".eaddslashes2($sptext)."','$username','$time');");
  359. //删除多余备份
  360. $num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewssp_3_bak where sid='$sid'");
  361. if($num>$baknum)
  362. {
  363. $limitnum=$num-$baknum;
  364. $ids='';
  365. $dh='';
  366. $sql=$empire->query("select bid from {$dbtbpre}enewssp_3_bak where sid='$sid' order by bid limit ".$limitnum);
  367. while($r=$empire->fetch($sql))
  368. {
  369. $ids.=$dh.$r[bid];
  370. $dh=',';
  371. }
  372. $empire->query("delete from {$dbtbpre}enewssp_3_bak where bid in ($ids)");
  373. }
  374. }
  375. //还原碎片信息记录
  376. function SpInfoReBak($add,$userid,$username){
  377. global $empire,$dbtbpre;
  378. $spid=(int)$add[spid];
  379. $sid=(int)$add['sid'];
  380. $bid=(int)$add[bid];
  381. if(!$spid||!$sid||!$bid)
  382. {
  383. printerror('ErrorUrl','');
  384. }
  385. //验证
  386. $spr=CheckSpInfoLevel($spid);
  387. if($spr['sptype']!=3)
  388. {
  389. printerror('ErrorUrl','');
  390. }
  391. $br=$empire->fetch1("select bid,sptext from {$dbtbpre}enewssp_3_bak where bid='$bid' and sid='$sid' and spid='$spid'");
  392. if(!$br['bid'])
  393. {
  394. printerror('ErrorUrl','');
  395. }
  396. $sql=$empire->query("update {$dbtbpre}enewssp_3 set sptext='".StripAddsData($br[sptext])."' where sid='$sid'");
  397. if($sql)
  398. {
  399. //操作日志
  400. insert_dolog("spid=".$spid."&spname=".$spr[spname]."<br>sid=$sid&bid=$bid");
  401. echo"<script>opener.ReSpInfoBak();window.close();</script>";
  402. exit();
  403. }
  404. else
  405. {printerror("DbError","history.go(-1)");}
  406. }
  407. //删除碎片信息
  408. function DelSpInfo($add,$userid,$username){
  409. global $empire,$dbtbpre;
  410. $spid=(int)$add[spid];
  411. $sid=(int)$add['sid'];
  412. if(!$spid||!$sid)
  413. {
  414. printerror('ErrorUrl','');
  415. }
  416. //验证
  417. $spr=CheckSpInfoLevel($spid);
  418. if($spr[sptype]==1)//静态碎片
  419. {
  420. $r=$empire->fetch1("select sid,title from {$dbtbpre}enewssp_1 where sid='$sid' and spid='$spid'");
  421. if(!$r['sid'])
  422. {
  423. printerror('ErrorUrl','');
  424. }
  425. $empire->query("delete from {$dbtbpre}enewssp_1 where sid='$sid' and spid='$spid'");
  426. $log="spid=$spid&sid=$sid&title=$r[title]";
  427. }
  428. elseif($spr[sptype]==2)//动态碎片
  429. {
  430. $r=$empire->fetch1("select sid,classid,id from {$dbtbpre}enewssp_2 where sid='$sid' and spid='$spid'");
  431. if(!$r['sid'])
  432. {
  433. printerror('ErrorUrl','');
  434. }
  435. $empire->query("delete from {$dbtbpre}enewssp_2 where sid='$sid' and spid='$spid'");
  436. $log="spid=$spid&sid=$sid&classid=$r[classid]&id=$r[id]";
  437. }
  438. else
  439. {
  440. printerror('ErrorUrl','');
  441. }
  442. //操作日志
  443. insert_dolog($log);
  444. printerror("DelSpInfoSuccess","ListSpInfo.php?spid=$spid".hReturnEcmsHashStrHref2(0));
  445. }
  446. //批量修改碎片发布时间
  447. function EditSpInfoTime($add,$userid,$username){
  448. global $empire,$dbtbpre;
  449. $spid=(int)$add[spid];
  450. $sid=$add['sid'];
  451. $newstime=$add[newstime];
  452. if(!$spid)
  453. {
  454. printerror('ErrorUrl','');
  455. }
  456. $count=count($sid);
  457. if(!$count)
  458. {
  459. printerror('EmptySpInfoTime','');
  460. }
  461. //验证
  462. $spr=CheckSpInfoLevel($spid);
  463. if($spr[sptype]==1)//静态碎片
  464. {
  465. for($i=0;$i<$count;$i++)
  466. {
  467. $dosid=(int)$sid[$i];
  468. $donewstime=$newstime[$i]?to_time($newstime[$i]):time();
  469. $empire->query("update {$dbtbpre}enewssp_1 set newstime='$donewstime' where sid='$dosid' and spid='$spid'");
  470. }
  471. }
  472. elseif($spr[sptype]==2)//动态碎片
  473. {
  474. for($i=0;$i<$count;$i++)
  475. {
  476. $dosid=(int)$sid[$i];
  477. $donewstime=$newstime[$i]?to_time($newstime[$i]):time();
  478. $empire->query("update {$dbtbpre}enewssp_2 set newstime='$donewstime' where sid='$dosid' and spid='$spid'");
  479. }
  480. }
  481. else
  482. {
  483. printerror('ErrorUrl','');
  484. }
  485. //操作日志
  486. insert_dolog("spid=$spid");
  487. printerror("EditSpInfoTimeSuccess","ListSpInfo.php?spid=$spid".hReturnEcmsHashStrHref2(0));
  488. }
  489. $enews=$_POST['enews'];
  490. if(empty($enews))
  491. {$enews=$_GET['enews'];}
  492. if($enews)
  493. {
  494. hCheckEcmsRHash();
  495. }
  496. if($enews=="AddSpInfo")//增加碎片信息
  497. {
  498. AddSpInfo($_POST,$logininid,$loginin);
  499. }
  500. elseif($enews=="EditSpInfo")//修改碎片信息
  501. {
  502. EditSpInfo($_POST,$logininid,$loginin);
  503. }
  504. elseif($enews=="DelSpInfo")//删除碎片信息
  505. {
  506. DelSpInfo($_GET,$logininid,$loginin);
  507. }
  508. elseif($enews=="SpInfoReBak")//还原碎片信息记录
  509. {
  510. SpInfoReBak($_GET,$logininid,$loginin);
  511. }
  512. elseif($enews=="EditSpInfoTime")//批量修改碎片信息时间
  513. {
  514. EditSpInfoTime($_POST,$logininid,$loginin);
  515. }
  516. elseif($enews=="LoadInSpInfo")//批量导入碎片信息
  517. {
  518. LoadInSpInfo($_GET,$logininid,$loginin);
  519. }
  520. $spid=(int)$_GET['spid'];
  521. //碎片
  522. $spr=CheckSpInfoLevel($spid);
  523. //代码碎片
  524. if($spr[sptype]==3)
  525. {
  526. Header("Location:AddSpInfo.php?enews=EditSpInfo&spid=$spid".$ecms_hashur['ehref']);
  527. exit();
  528. }
  529. $page=(int)$_GET['page'];
  530. $page=RepPIntvar($page);
  531. $start=0;
  532. $line=50;//每页显示条数
  533. $page_line=12;//每页显示链接数
  534. $offset=$page*$line;//总偏移量
  535. $search="&spid=$spid".$ecms_hashur['ehref'];
  536. $url="<a href=UpdateSp.php".$ecms_hashur['whehref'].">更新碎片</a>&nbsp;>&nbsp;".$spr[spname]."&nbsp;>&nbsp;管理碎片信息";
  537. ?>
  538. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  539. <html>
  540. <head>
  541. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  542. <title>碎片</title>
  543. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  544. <script>
  545. function ChangeInfoDoAction(tbname,infoids){
  546. if(tbname==''||infoids=='')
  547. {
  548. return false;
  549. }
  550. else
  551. {
  552. self.location.href='../sp/ListSpInfo.php?<?=$ecms_hashur['href']?>&enews=LoadInSpInfo&spid=<?=$spid?>&tbname='+tbname+'&infoids='+infoids;
  553. }
  554. }
  555. </script>
  556. </head>
  557. <body>
  558. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  559. <tr>
  560. <td width="50%">位置:
  561. <?=$url?>
  562. </td>
  563. <td><div align="right" class="emenubutton">
  564. <input type="button" name="Submit5" value="增加碎片信息" onclick="self.location.href='AddSpInfo.php?enews=AddSpInfo&spid=<?=$spid?><?=$ecms_hashur['ehref']?>';">
  565. &nbsp;&nbsp;
  566. <input type="button" name="Submit5" value="批量导入碎片信息" onclick="window.open('../info/ChangeInfo.php?enews=LoadInSpInfo&spid=<?=$spid?><?=$ecms_hashur['ehref']?>');">
  567. </div></td>
  568. </tr>
  569. </table>
  570. <br>
  571. <?php
  572. if($spr[sptype]==1)
  573. {
  574. $query="select spid,sid,title,titlepic,titleurl,titlefont,newstime from {$dbtbpre}enewssp_1 where spid='$spid'";
  575. $totalquery="select count(*) as total from {$dbtbpre}enewssp_1 where spid='$spid'";
  576. $num=$empire->gettotal($totalquery);//取得总条数
  577. $query=$query." order by newstime desc limit $offset,$line";
  578. $sql=$empire->query($query);
  579. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  580. ?>
  581. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  582. <form action="ListSpInfo.php" method="post" name="spform" id="spform" onsubmit="return confirm('确认要修改?');">
  583. <?=$ecms_hashur['form']?>
  584. <tr class="header">
  585. <td width="51%" height="25"><div align="center">标题</div></td>
  586. <td width="30%"><div align="center">发布时间</div></td>
  587. <td width="19%" height="25"><div align="center">操作</div></td>
  588. </tr>
  589. <?
  590. while($r=$empire->fetch($sql))
  591. {
  592. //标题图片
  593. $showtitlepic="";
  594. if($r[titlepic])
  595. {
  596. $showtitlepic="<a href='".$r[titlepic]."' title='预览标题图片' target=_blank><img src='../../data/images/showimg.gif' border=0></a>";
  597. }
  598. //标题
  599. $r[title]=DoTitleFont($r[titlefont],stripSlashes($r[title]));
  600. ?>
  601. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  602. <td height="32">
  603. <?=$showtitlepic?>
  604. <a href='<?=$r[titleurl]?>' target=_blank><?=stripSlashes($r[title])?></a>
  605. </td>
  606. <td><div align="center">
  607. <input name="sid[]" type="hidden" id="sid[]" value="<?=$r['sid']?>">
  608. <input name="newstime[]" type="text" value="<?=date('Y-m-d H:i:s',$r[newstime])?>" size="22">
  609. </div></td>
  610. <td height="25"><div align="center">[<a href="AddSpInfo.php?enews=EditSpInfo&spid=<?=$spid?>&sid=<?=$r['sid']?><?=$ecms_hashur['ehref']?>">修改</a>]
  611. [<a href="ListSpInfo.php?enews=DelSpInfo&spid=<?=$spid?>&sid=<?=$r['sid']?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除?');">删除</a>]</div></td>
  612. </tr>
  613. <?
  614. }
  615. ?>
  616. <tr bgcolor="#FFFFFF">
  617. <td height="25" colspan="3">&nbsp;
  618. <?=$returnpage?>&nbsp;&nbsp;&nbsp;
  619. <input type="hidden" name="enews" value="EditSpInfoTime">
  620. <input name="spid" type="hidden" id="spid" value="<?=$spid?>">
  621. <input type="submit" name="Submit" value="批量修改时间">
  622. <input type="reset" name="Submit2" value="重置"></td>
  623. </tr>
  624. </form>
  625. </table>
  626. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  627. <tr>
  628. <td height="25"><font color="#666666">说明:信息是按发布时间排序,如果要改顺序可以修改发布时间,发布时间设置空则改为当前时间。</font></td>
  629. </tr>
  630. </table>
  631. <?php
  632. }
  633. elseif($spr[sptype]==2)
  634. {
  635. $query="select spid,sid,classid,id,newstime from {$dbtbpre}enewssp_2 where spid='$spid'";
  636. $totalquery="select count(*) as total from {$dbtbpre}enewssp_2 where spid='$spid'";
  637. $num=$empire->gettotal($totalquery);//取得总条数
  638. $query=$query." order by newstime desc limit $offset,$line";
  639. $sql=$empire->query($query);
  640. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  641. ?>
  642. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  643. <form action="ListSpInfo.php" method="post" name="spform" id="spform" onsubmit="return confirm('确认要修改?');">
  644. <?=$ecms_hashur['form']?>
  645. <tr class="header">
  646. <td width="46%" height="25"><div align="center">标题</div></td>
  647. <td width="23%"><div align="center">发布时间</div></td>
  648. <td width="17%"><div align="center">所属栏目</div></td>
  649. <td width="14%" height="25"><div align="center">操作</div></td>
  650. </tr>
  651. <?
  652. while($r=$empire->fetch($sql))
  653. {
  654. if(empty($class_r[$r[classid]][tbname]))
  655. {
  656. continue;
  657. }
  658. //索引表
  659. $index_r=$empire->fetch1("select checked from {$dbtbpre}ecms_".$class_r[$r[classid]][tbname]."_index where id='$r[id]' limit 1");
  660. //返回表
  661. $infotb=ReturnInfoMainTbname($class_r[$r[classid]][tbname],$index_r['checked']);
  662. $infor=$empire->fetch1("select id,classid,isurl,titleurl,isgood,firsttitle,plnum,totaldown,onclick,newstime,titlepic,title from ".$infotb." where id='$r[id]' limit 1");
  663. //标题图片
  664. $showtitlepic="";
  665. if($infor[titlepic])
  666. {
  667. $showtitlepic="<a href='".$infor[titlepic]."' title='预览标题图片' target=_blank><img src='../../data/images/showimg.gif' border=0></a>";
  668. }
  669. //标题
  670. $infor[title]=DoTitleFont($infor[titlefont],stripSlashes($infor[title]));
  671. //标题链接
  672. $titleurl=sys_ReturnBqTitleLink($infor);
  673. //栏目链接
  674. $classurl=sys_ReturnBqClassname($r,9);
  675. ?>
  676. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  677. <td height="32">
  678. <?=$showtitlepic?>
  679. <a href='<?=$titleurl?>' target=_blank><?=stripSlashes($infor[title])?></a> </td>
  680. <td><div align="center">
  681. <input name="sid[]" type="hidden" id="sid[]" value="<?=$r['sid']?>">
  682. <input name="newstime[]" type="text" value="<?=date('Y-m-d H:i:s',$r[newstime])?>" size="22">
  683. </div></td>
  684. <td><div align="center"><a href="<?=$classurl?>" target="_blank"><?=$class_r[$r[classid]][classname]?></a></div></td>
  685. <td height="25"><div align="center">[<a href="AddSpInfo.php?enews=EditSpInfo&spid=<?=$spid?>&sid=<?=$r['sid']?><?=$ecms_hashur['ehref']?>">修改</a>]
  686. [<a href="ListSpInfo.php?enews=DelSpInfo&spid=<?=$spid?>&sid=<?=$r['sid']?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除?');">删除</a>]</div></td>
  687. </tr>
  688. <?
  689. }
  690. ?>
  691. <tr bgcolor="#FFFFFF">
  692. <td height="25" colspan="4">&nbsp;
  693. <?=$returnpage?>&nbsp;&nbsp;&nbsp;
  694. <input type="hidden" name="enews" value="EditSpInfoTime">
  695. <input name="spid" type="hidden" id="spid" value="<?=$spid?>">
  696. <input type="submit" name="Submit" value="批量修改时间">
  697. <input type="reset" name="Submit2" value="重置">
  698. </td>
  699. </tr>
  700. </form>
  701. </table>
  702. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  703. <tr>
  704. <td height="25"><font color="#666666">说明:信息是按发布时间排序,如果要改顺序可以修改发布时间,发布时间设置空则改为当前时间。</font></td>
  705. </tr>
  706. </table>
  707. <?php
  708. }
  709. ?>
  710. </body>
  711. </html>
  712. <?
  713. db_close();
  714. $empire=null;
  715. ?>