ListPageClass.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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. $link=db_connect();
  8. $empire=new mysqlquery();
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"class");
  20. $page=(int)$_GET['page'];
  21. $page=RepPIntvar($page);
  22. $start=0;
  23. $line=25;//每页显示条数
  24. $page_line=12;//每页显示链接数
  25. $offset=$page*$line;//总偏移量
  26. $add="";
  27. $search="";
  28. $search.=$ecms_hashur['ehref'];
  29. //搜索
  30. if($_GET['sear'])
  31. {
  32. $search.="&sear=1";
  33. //关键字
  34. $keyboard=RepPostVar2($_GET['keyboard']);
  35. if($keyboard)
  36. {
  37. $show=RepPostStr($_GET['show'],1);
  38. if($show==1)
  39. {
  40. $add=" and (classname like '%$keyboard%')";
  41. }
  42. elseif($show==2)
  43. {
  44. $add=" and (intro like '%$keyboard%')";
  45. }
  46. elseif($show==3)
  47. {
  48. $add=" and (bname like '%$keyboard%')";
  49. }
  50. elseif($show==4)
  51. {
  52. $add=" and (classid='$keyboard')";
  53. }
  54. elseif($show==6)
  55. {
  56. $add=" and (bclassid='$keyboard')";
  57. }
  58. elseif($show==5)
  59. {
  60. $add=" and (classpath like '%$keyboard%')";
  61. }
  62. else
  63. {
  64. $add=" and (classname like '%$keyboard%' or intro like '%$keyboard%' or bname like '%$keyboard%' or classpath like '%$keyboard%' or classid='$keyboard')";
  65. }
  66. $search.="&keyboard=$keyboard&show=$show";
  67. }
  68. //条件
  69. $scond=(int)$_GET['scond'];
  70. if($scond)
  71. {
  72. if($scond==1)
  73. {
  74. $add.=" and islast=1";
  75. }
  76. elseif($scond==2)
  77. {
  78. $add.=" and islast=0";
  79. }
  80. elseif($scond==3)
  81. {
  82. $add.=" and islist=1 and islast=0";
  83. }
  84. elseif($scond==4)
  85. {
  86. $add.=" and islist=0 and islast=0";
  87. }
  88. elseif($scond==11)
  89. {
  90. $add.=" and islist=2 and islast=0";
  91. }
  92. elseif($scond==12)
  93. {
  94. $add.=" and islist=3 and islast=0";
  95. }
  96. elseif($scond==5)
  97. {
  98. $add.=" and islast=1 and openadd=1";
  99. }
  100. elseif($scond==6)
  101. {
  102. $add.=" and islast=1 and openpl=1";
  103. }
  104. elseif($scond==7)
  105. {
  106. $add.=" and listdt=1";
  107. }
  108. elseif($scond==8)
  109. {
  110. $add.=" and showdt=1";
  111. }
  112. elseif($scond==9)
  113. {
  114. $add.=" and showclass=1";
  115. }
  116. elseif($scond==10)
  117. {
  118. $add.=" and showdt=2";
  119. }
  120. $search.="&scond=$scond";
  121. }
  122. //模型
  123. $modid=(int)$_GET['modid'];
  124. if($modid)
  125. {
  126. $add.=" and modid=$modid";
  127. $search.="&modid=$modid";
  128. }
  129. }
  130. if($add)
  131. {
  132. $add=" where".substr($add,4,strlen($add));
  133. }
  134. //系统模型
  135. $modselect="";
  136. $msql=$empire->query("select mid,mname from {$dbtbpre}enewsmod where usemod=0 order by myorder,mid");
  137. while($mr=$empire->fetch($msql))
  138. {
  139. $select="";
  140. if($mr[mid]==$modid)
  141. {
  142. $select=" selected";
  143. }
  144. $modselect.="<option value='".$mr[mid]."'".$select.">".$mr[mname]."</option>";
  145. }
  146. $totalquery="select count(*) as total from {$dbtbpre}enewsclass".$add;
  147. $query="select * from {$dbtbpre}enewsclass".$add;
  148. $num=$empire->gettotal($totalquery);//取得总条数
  149. //排序
  150. $myorder=(int)$_GET['myorder'];
  151. if($myorder==1)
  152. {
  153. $doorder="myorder";
  154. }
  155. else
  156. {
  157. $doorder="classid";
  158. }
  159. $orderby=(int)$_GET['orderby'];
  160. if($orderby==1)
  161. {
  162. $doorderby="";
  163. $ordername="降序";
  164. $neworderby=0;
  165. }
  166. else
  167. {
  168. $doorderby=" desc";
  169. $ordername="升序";
  170. $neworderby=1;
  171. }
  172. $orderidlink="<a href='ListPageClass.php?myorder=0&orderby=$neworderby".$search."' title='点击按 栏目ID ".$ordername."排列'><u>ID</u></a>";
  173. $ordertwolink="<a href='ListPageClass.php?myorder=1&orderby=$neworderby".$search."' title='点击按 栏目顺序 ".$ordername."排列'><u>顺序</u></a>";
  174. $search.="&myorder=$myorder&orderby=$orderby";
  175. $query=$query." order by ".$doorder.$doorderby." limit $offset,$line";
  176. $sql=$empire->query($query);
  177. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  178. ?>
  179. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  180. <html>
  181. <head>
  182. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  183. <link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  184. <title>管理栏目</title>
  185. </head>
  186. <body>
  187. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  188. <tr>
  189. <td width="18%">位置: <a href="ListPageClass.php<?=$ecms_hashur['whehref']?>">管理栏目</a></td>
  190. <td width="82%"> <div align="right" class="emenubutton">
  191. <input type="button" name="Submit6" value="增加栏目" onclick="self.location.href='AddClass.php?enews=AddClass&from=1<?=$ecms_hashur['ehref']?>'">
  192. <input type="button" name="Submit" value="刷新首页" onclick="self.location.href='ecmschtml.php?enews=ReIndex<?=$ecms_hashur['href']?>'">
  193. <input type="button" name="Submit2" value="刷新所有栏目页" onclick="window.open('ecmschtml.php?enews=ReListHtml_all&from=ListPageClass.php<?=urlencode($ecms_hashur['whehref'])?><?=$ecms_hashur['href']?>','','');">
  194. <input type="button" name="Submit3" value="刷新所有信息页面" onclick="window.open('ReHtml/DoRehtml.php?enews=ReNewsHtml&start=0&from=ListPageClass.php<?=urlencode($ecms_hashur['whehref'])?><?=$ecms_hashur['href']?>','','');">
  195. <input type="button" name="Submit4" value="刷新所有JS调用" onclick="window.open('ecmschtml.php?enews=ReAllNewsJs&from=ListPageClass.php<?=urlencode($ecms_hashur['whehref'])?><?=$ecms_hashur['href']?>','','');">
  196. </div></td>
  197. </tr>
  198. </table>
  199. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  200. <form name="searchclass" method="GET" action="ListPageClass.php">
  201. <?=$ecms_hashur['eform']?>
  202. <tr>
  203. <td height="32"><div align="right">搜索:
  204. <input name="keyboard" type="text" id="keyboard" value="<?=$keyboard?>">
  205. <select name="show" id="show">
  206. <option value="0"<?=$show==0?' selected':''?>>不限字段</option>
  207. <option value="1"<?=$show==1?' selected':''?>>栏目名</option>
  208. <option value="2"<?=$show==2?' selected':''?>>栏目简介</option>
  209. <option value="3"<?=$show==3?' selected':''?>>栏目别名</option>
  210. <option value="4"<?=$show==4?' selected':''?>>栏目ID</option>
  211. <option value="6"<?=$show==6?' selected':''?>>父栏目ID</option>
  212. <option value="5"<?=$show==5?' selected':''?>>栏目目录</option>
  213. </select>
  214. <select name="scond" id="scond">
  215. <option value="0"<?=$scond==0?' selected':''?>>不限条件</option>
  216. <option value="1"<?=$scond==1?' selected':''?>>终极栏目</option>
  217. <option value="2"<?=$scond==2?' selected':''?>>大栏目</option>
  218. <option value="3"<?=$scond==3?' selected':''?>>列表式大栏目</option>
  219. <option value="4"<?=$scond==4?' selected':''?>>封面式大栏目</option>
  220. <option value="12"<?=$scond==12?' selected':''?>>绑定信息式大栏目</option>
  221. <option value="11"<?=$scond==11?' selected':''?>>页面内容式大栏目</option>
  222. <option value="5"<?=$scond==5?' selected':''?>>未开放投稿的栏目</option>
  223. <option value="6"<?=$scond==6?' selected':''?>>未开放评论的栏目</option>
  224. <option value="7"<?=$scond==7?' selected':''?>>动态列表的栏目</option>
  225. <option value="8"<?=$scond==8?' selected':''?>>动态生成内容的栏目</option>
  226. <option value="10"<?=$scond==10?' selected':''?>>动态内容页面的栏目</option>
  227. <option value="9"<?=$scond==9?' selected':''?>>不显示到导航的栏目</option>
  228. </select>
  229. <select name="modid" id="modid">
  230. <option value="0">不限模型</option>
  231. <?=$modselect?>
  232. </select>
  233. <input type="submit" name="Submit8" value="显示">
  234. <input name="sear" type="hidden" id="sear" value="1">
  235. <input name="myorder" type="hidden" id="myorder" value="<?=$myorder?>">
  236. <input name="orderby" type="hidden" id="orderby" value="<?=$orderby?>">
  237. </div></td>
  238. </tr>
  239. </form>
  240. </table>
  241. <br>
  242. <table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
  243. <form name=editorder method=post action=ecmsclass.php onsubmit="return confirm('确认要操作?');">
  244. <?=$ecms_hashur['form']?>
  245. <tr class="header">
  246. <td width="5%"><div align="center">
  247. <?=$ordertwolink?>
  248. </div></td>
  249. <td width="5%"><div align="center"></div></td>
  250. <td width="5%" height="25"> <div align="center">
  251. <?=$orderidlink?>
  252. </div></td>
  253. <td width="36%" height="25">栏目名</td>
  254. <td width="6%" height="25"> <div align="center">访问</div></td>
  255. <td width="14%" height="25">栏目管理</td>
  256. <td width="29%" height="25">操作</td>
  257. </tr>
  258. <?
  259. while($r=$empire->fetch($sql))
  260. {
  261. $docinfo="";
  262. $classinfotype='';
  263. $classurl=sys_ReturnBqClassUrl($r);
  264. if($r[islast]==1)
  265. {
  266. $img="<a href='AddNews.php?enews=AddNews&classid=".$r[classid].$ecms_hashur['ehref']."' target=_blank title='增加信息'><img src='../data/images/txt.gif' border=0></a>";
  267. $renewshtml=" <a href='ReHtml/DoRehtml.php?enews=ReNewsHtml&from=ListPageClass.php".urlencode($ecms_hashur['whehref'])."&classid=".$r[classid]."&tbname[]=".$r[tbname].$ecms_hashur['href']."'>".$fun_r['news']."</a> ";
  268. $docinfo=" <a href='ecmsinfo.php?enews=InfoToDoc&ecmsdoc=1&docfrom=ListPageClass.php".urlencode($ecms_hashur['whehref'])."&classid=".$r[classid].$ecms_hashur['href']."' onclick=\"return confirm('确认归档?');\">归档</a>";
  269. $classinfotype=" <a href='#e' onclick=window.open('ClassInfoType.php?classid=".$r[classid].$ecms_hashur['ehref']."');>分类</a>";
  270. }
  271. else
  272. {
  273. $img="<img src='../data/images/dir.gif'>";
  274. $renewshtml=" <a href='ReHtml/DoRehtml.php?enews=ReNewsHtml&from=ListPageClass.php".urlencode($ecms_hashur['whehref'])."&classid=".$r[classid]."&tbname[]=".$r[tbname].$ecms_hashur['href']."'>".$fun_r['news']."</a> ";
  275. }
  276. //外部栏目
  277. $classname=$r[classname];
  278. if($r[wburl])
  279. {
  280. $classname="<font color='#666666'>".$classname."&nbsp;(外部)</font>";
  281. }
  282. //上级栏目
  283. $bclassname='';
  284. if($r[bclassid])
  285. {
  286. $bcr=$empire->fetch1("select classid,classname from {$dbtbpre}enewsclass where classid='$r[bclassid]'");
  287. $bclassname=$bcr[classname].'&nbsp;>&nbsp;';
  288. }
  289. ?>
  290. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  291. <td><div align="center">
  292. <input type=text name=myorder[] value="<?=$r[myorder]?>" size=2>
  293. <input type=hidden name=classid[] value="<?=$r[classid]?>">
  294. </div></td>
  295. <td><div align="center"><?=$img?></div></td>
  296. <td height="25"><div align="center"><?=$r[classid]?></div></td>
  297. <td height="25"><?="<input type=checkbox name=reclassid[] value='".$r[classid]."'>&nbsp;".$bclassname."<a href='".$classurl."' target=_blank><b>".$classname."</b></a>";?></td>
  298. <td height="25"><div align="center"><?=$r[onclick]?></div></td>
  299. <td height="25"><?="<a href='AddClass.php?classid=".$r[classid]."&enews=EditClass&from=1".$ecms_hashur['ehref']."'>修改</a> <a href='AddClass.php?classid=".$r[classid]."&enews=AddClass&docopy=1&from=1".$ecms_hashur['ehref']."'>复制</a> <a href='ecmsclass.php?classid=".$r[classid]."&enews=DelClass&from=1".$ecms_hashur['href']."' onclick=\"return confirm('".$fun_r['CheckDelClass']."');\">删除</a>"?></td>
  300. <td height="25"><?="<a href='enews.php?enews=ReListHtml&from=ListPageClass.php".urlencode($ecms_hashur['whehref'])."&classid=".$r[classid].$ecms_hashur['href']."'>刷新</a>".$renewshtml."<a href='ecmschtml.php?enews=ReSingleJs&doing=0&classid=".$r[classid].$ecms_hashur['href']."'>JS</a> <a href='#ecms' onclick=window.open('view/ClassUrl.php?classid=".$r[classid].$ecms_hashur['ehref']."','','width=500,height=250');>调用</a>".$classinfotype.$docinfo;?>
  301. </td>
  302. </tr>
  303. <?
  304. }
  305. ?>
  306. <tr bgcolor="#ffffff">
  307. <td height="25" colspan="7"> <div align="right">
  308. <input type="submit" name="Submit5" value="修改栏目顺序" onClick="document.editorder.enews.value='EditClassOrder';document.editorder.action='ecmsclass.php';">
  309. <input name="enews" type="hidden" id="enews" value="EditClassOrder">
  310. &nbsp;&nbsp;
  311. <input type="submit" name="Submit7" value="刷新栏目页面" onClick="document.editorder.enews.value='GoReListHtmlMoreA';document.editorder.action='ecmschtml.php';"">
  312. &nbsp;&nbsp;
  313. <input type="submit" name="Submit72" value="终极栏目属性转换" onClick="document.editorder.enews.value='ChangeClassIslast';document.editorder.action='ecmsclass.php';"">
  314. </div></td>
  315. </tr>
  316. <tr bgcolor="#ffffff">
  317. <td height="25" colspan="7">&nbsp;&nbsp;
  318. <?=$returnpage?>
  319. </td>
  320. </tr>
  321. <tr bgcolor="#FFFFFF">
  322. <td height="65" colspan="7"><strong>终极栏目属性转换说明(只能选择单个栏目):</strong><br>
  323. 如果你选择的是<font color="#FF0000">非终极栏目</font>,则转为<font color="#FF0000">终极栏目</font><font color="#666666">(此栏目不能有子栏目)</font><br>
  324. 如果你选择的是<font color="#FF0000">终极栏目</font>,则转为<font color="#FF0000">非终极栏目</font><font color="#666666">(请先把当前栏目的数据转移,否则会出现冗余数据)<br>
  325. </font><strong>修改栏目顺序:顺序值越小越前面</strong></td>
  326. </tr>
  327. <input name="from" type="hidden" value="ListPageClass.php<?=$ecms_hashur['whehref']?>">
  328. <input name="gore" type="hidden" value="0">
  329. </form>
  330. </table>
  331. </body>
  332. </html>
  333. <?
  334. db_close();
  335. $empire=null;
  336. ?>