manager.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:7k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ include file="../../../inc/inc.jsp" %>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="cn.js.fan.db.Conn"%>
  5. <%@ page import="cn.js.fan.util.*"%>
  6. <%@ page import="com.redmoon.forum.miniplugin.home.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  9. <html><head>
  10. <meta http-equiv="pragma" content="no-cache">
  11. <LINK href="../../../admin/default.css" type=text/css rel=stylesheet>
  12. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>插件管理</title>
  15. <script language="JavaScript">
  16. <!--
  17. //-->
  18. </script>
  19. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  20. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  21. <%
  22. if (!privilege.isUserPrivValid(request, "forum.plugin"))
  23. {
  24. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  25. return;
  26. }
  27. HomeDb hd = new HomeDb();
  28. String op = ParamUtil.get(request, "op");
  29. if (op.equals("setHot")) {
  30. String hot = ParamUtil.get(request, "hot");
  31. hd.setHot(hot);
  32. if (hd.save())
  33. out.print(StrUtil.Alert("操作成功!"));
  34. else
  35. out.print(StrUtil.Alert("操作失败!"));
  36. }
  37. if (op.equals("setRecommandBoard")) {
  38. String recommandBoard = ParamUtil.get(request, "recommandBoard");
  39. hd.setRecommandBoard(recommandBoard);
  40. if (hd.save())
  41. out.print(StrUtil.Alert("操作成功!"));
  42. else
  43. out.print(StrUtil.Alert("操作失败!"));
  44. }
  45. if (op.equals("setRecommandMsg")) {
  46. String recommandMsg = ParamUtil.get(request, "recommandMsg");
  47. hd.setRecommandMsg(recommandMsg);
  48. if (hd.save())
  49. out.print(StrUtil.Alert("操作成功!"));
  50. else
  51. out.print(StrUtil.Alert("操作失败!"));
  52. }
  53. %>
  54. <table width='100%' cellpadding='0' cellspacing='0' >
  55.   <tr>
  56.     <td class="head">管理首页</td>
  57.   </tr>
  58. </table>
  59. <br>
  60. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  61.   <tr> 
  62.     <td height=20 align="left" class="thead">管理</td>
  63.   </tr>
  64.   <tr> 
  65.     <td valign="top"><br>
  66.       <table width="98%" align="center">
  67.   <form id=form1 name=form1 action="?op=setHot" method=post>
  68.         <tr>
  69.           <td width="88%" height="22"><strong>热点话题</strong>&nbsp;( 编号之间用,分隔 ) <br>
  70.               <input type=text value="<%=StrUtil.getNullString(hd.getHot())%>" name="hot" style='border:1pt solid #636563;font-size:9pt' size=80>
  71.             <br></td>
  72.           <td width="12%"><input name="submit" type="submit" style="border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;" value=" 确 定 ">
  73.             &nbsp;&nbsp;&nbsp;</td>
  74.         </tr>
  75.         <tr>
  76.           <td height="22" colspan="2"><%
  77. int[] v = hd.getHotIds();
  78. int hotlen = v.length;
  79. if (hotlen==0)
  80. out.print("无热点话题!");
  81. else {
  82. MsgDb md = new MsgDb();
  83. for (int k=0; k<hotlen; k++) {
  84. md = md.getMsgDb(v[k]);
  85. if (md.isLoaded()) {
  86. String color = StrUtil.getNullString(md.getColor());
  87. if (color.equals("")) {%>
  88.   <%=md.getId()%>:&nbsp;<a href="../../../showtopic.jsp?rootid=<%=md.getId()%>"><%=md.getTitle()%></a><BR>
  89. <%}else{%>
  90.   <%=md.getId()%>:&nbsp;<a href="../../../showtopic.jsp?rootid=<%=md.getId()%>"><font color="<%=color%>"><%=md.getTitle()%></font></a><BR>
  91. <%}%>
  92. <% }
  93. else
  94. out.print("<font color=red>编号:" + v[k] + "的贴子不存在</red><BR>");
  95. }
  96. }%> </td>
  97.         </tr></form>
  98.       </table>
  99.       <br>
  100.       <table width="98%" align="center">
  101.         <form id=form1 name=form1 action="?op=setRecommandBoard" method=post>
  102.           <tr>
  103.             <td width="88%" height="22"><strong>社区纵横</strong>&nbsp;&nbsp;( 编号之间用,分隔 ) <br>
  104.                 <input type=text value="<%=StrUtil.getNullString(hd.getRecommandBoard())%>" name="recommandBoard" style='border:1pt solid #636563;font-size:9pt' size=80>
  105.             <br></td>
  106.             <td width="12%"><input name="submit2" type="submit" style="border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;" value=" 确 定 ">
  107.             &nbsp;&nbsp;&nbsp;</td>
  108.           </tr>
  109.           <tr>
  110.             <td height="22" colspan="2"><%
  111. String[] vr = hd.getRecommandBoards();
  112. int rblen = vr.length;
  113. if (rblen==0)
  114. out.print("无推荐版块!");
  115. else {
  116. Directory dir = new Directory();
  117. Leaf lf = null;
  118. for (int k=0; k<rblen; k++) {
  119. lf = dir.getLeaf(vr[k]);
  120. if (lf!=null && lf.isLoaded()) {%>
  121. <%=lf.getCode()%>:&nbsp;<%=lf.getName()%><BR>
  122. <%}
  123. else
  124. out.print("<font color=red>编码:" + vr[k] + "的版块不存在</red><BR>");
  125. }
  126. }%>            </td>
  127.           </tr>
  128.         </form>
  129.       </table>
  130.       <br>
  131.       <table width="98%" align="center">
  132.         <form id=form1 name=form1 action="?op=setRecommandMsg" method=post>
  133.           <tr>
  134.             <td width="88%" height="22"><strong>社区推荐</strong>&nbsp;&nbsp;( 编号之间用,分隔 ) <br>
  135.               <input type=text value="<%=StrUtil.getNullString(hd.getRecommandMsg())%>" name="recommandMsg" style='border:1pt solid #636563;font-size:9pt' size=80>
  136.             <br></td>
  137.             <td width="12%"><input name="submit3" type="submit" style="border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;" value=" 确 定 ">
  138.             &nbsp;&nbsp;&nbsp;</td>
  139.           </tr>
  140.           <tr>
  141.             <td height="22" colspan="2"><%
  142. int[] mv = hd.getRecommandMsgs();
  143. int mlen = mv.length;
  144. if (mlen==0)
  145. out.print("无推荐话题!");
  146. else {
  147. MsgDb md = new MsgDb();
  148. for (int k=0; k<mlen; k++) {
  149. md = md.getMsgDb(mv[k]);
  150. if (md.isLoaded()) {
  151. String color = StrUtil.getNullString(md.getColor());
  152. if (color.equals("")) {%>
  153.                 <%=md.getId()%>:&nbsp;<a href="../../../showtopic.jsp?rootid=<%=md.getId()%>"><%=md.getTitle()%></a><BR>
  154.                 <%}else{%>
  155.                 <%=md.getId()%>:&nbsp;<a href="../../../showtopic.jsp?rootid=<%=md.getId()%>"><font color="<%=color%>"><%=md.getTitle()%></font></a><BR>
  156.                 <%}%>
  157.                 <% }
  158. else
  159. out.print("<font color=red>编号:" + v[k] + "的贴子不存在</red><BR>");
  160. }
  161. }%>            </td>
  162.           </tr>
  163.         </form>
  164.       </table>
  165.       <br>
  166.     <br>
  167.     <br></td>
  168.   </tr>
  169. </table>
  170. </td> </tr>             
  171.       </table>                                        
  172.        </td>                                        
  173.      </tr>                                        
  174.  </table>                                        
  175.                                
  176. </body>                                        
  177. </html>                            
  178.