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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="java.util.Date"%>
  3. <%@ page import="cn.js.fan.web.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="com.redmoon.forum.*"%>
  6. <%@ page import="cn.js.fan.module.pvg.*" %>
  7. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  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. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  12. <meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT">
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title><lt:Label res="res.label.forum.admin.forum_m" key="filter_info"/></title>
  15. <link rel="stylesheet" href="../../common.css">
  16. <script language="JavaScript">
  17. <!--
  18. function openWin(url,width,height)
  19. {
  20. var newwin = window.open(url,"_blank","scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,top=50,left=120,width="+width+",height="+height);
  21. }
  22. function openSelTopicWin() {
  23. openWin("../topic_m.jsp?action=sel", 640, 480);
  24. }
  25. function delNotice(id) {
  26. var ntc = form1.notices.value;
  27. var ary = ntc.split(",");
  28. var ary2 = new Array();
  29. var k = 0;
  30. for (var i=0; i<ary.length; i++) {
  31. if (ary[i]==id) {
  32. continue;
  33. }
  34. else {
  35. ary2[k] = ary[i];
  36. k++;
  37. }
  38. }
  39. ntc = "";
  40. for (i=0; i<ary2.length; i++) {
  41. if (ntc=="")
  42. ntc += ary2[i];
  43. else
  44. ntc += "," + ary2[i];
  45. }
  46. form1.notices.value = ntc;
  47. form1.submit();
  48. }
  49. function selTopic(ids) {
  50. // 检查在notices中是否已包含了ids中的id,避免重复加入
  51. var ary = ids.split(",");
  52. var ntc = form1.notices.value;
  53. var ary2 = ntc.split(",");
  54. for (var i=0; i<ary.length; i++) {
  55. var founded = false;
  56. for (var j=0; j<ary2.length; j++) {
  57. if (ary[i]==ary2[j]) {
  58. founded = true;
  59. break;
  60. }
  61. }
  62. if (!founded) {
  63. if (ntc=="")
  64. ntc += ary[i];
  65. else
  66. ntc += "," + ary[i];
  67. }
  68. }
  69. form1.notices.value = ntc;
  70. }
  71. function up(id) {
  72. var ntc = form1.notices.value;
  73. var ary = ntc.split(",");
  74. for (var i=0; i<ary.length; i++) {
  75. if (ary[i]==id) {
  76. // 往上移动的节点不是第一个节点
  77. if (i!=0) {
  78. var tmp = ary[i-1];
  79. ary[i-1] = ary[i];
  80. ary[i] = tmp;
  81. }
  82. else
  83. return;
  84. break;
  85. }
  86. }
  87. ntc = "";
  88. for (i=0; i<ary.length; i++) {
  89. if (ntc=="")
  90. ntc += ary[i];
  91. else
  92. ntc += "," + ary[i];
  93. }
  94. form1.notices.value = ntc;
  95. form1.submit();
  96. }
  97. function down(id) {
  98. var ntc = form1.notices.value;
  99. var ary = ntc.split(",");
  100. for (var i=0; i<ary.length; i++) {
  101. if (ary[i]==id) {
  102. // 往上移动的节点不是第一个节点
  103. if (i!=ary.length-1) {
  104. var tmp = ary[i+1];
  105. ary[i+1] = ary[i];
  106. ary[i] = tmp;
  107. }
  108. else
  109. return;
  110. break;
  111. }
  112. }
  113. ntc = "";
  114. for (i=0; i<ary.length; i++) {
  115. if (ntc=="")
  116. ntc += ary[i];
  117. else
  118. ntc += "," + ary[i];
  119. }
  120. form1.notices.value = ntc;
  121. form1.submit();
  122. }
  123. //-->
  124. </script>
  125. <LINK href="default.css" type=text/css rel=stylesheet>
  126. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  127. <%
  128. ForumDb fd = new ForumDb();
  129. fd = fd.getForumDb();
  130. String op = ParamUtil.get(request, "op");
  131. if (op.equals("setStatus")) {
  132. int status = ParamUtil.getInt(request, "status");
  133. String reason = ParamUtil.get(request, "reason");
  134. fd.setStatus(status);
  135. fd.setReason(reason);
  136. if (fd.save())
  137. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  138. else
  139. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
  140. }
  141. fd = ForumDb.getInstance();
  142. %>
  143. <table width='100%' cellpadding='0' cellspacing='0' >
  144.   <tr>
  145.     <td class="head"><lt:Label res="res.label.forum.admin.forum_m" key="status"/></td>
  146.   </tr>
  147. </table>
  148. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  149. <%
  150. if (!privilege.isMasterLogin(request))
  151. {
  152. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  153. return;
  154. }%>
  155. <br>
  156. <TABLE class="frame_gray" cellSpacing=0 cellPadding=0 width="95%" align=center>
  157.   <TBODY>
  158.     <TR>
  159.       <TD valign="top" bgcolor="#FFFBFF" class="thead">&nbsp;</TD>
  160.     </TR>
  161.     <TR>
  162.       <TD height=200 valign="top" bgcolor="#FFFBFF"><br>
  163.         <br>
  164.         <table width="60%" border='0' align="center" cellpadding='0' cellspacing='0' class="tableframe_gray">
  165.           <tr >
  166.             <td width="100%" class="stable">        
  167.           <tr>
  168.             <FORM METHOD=POST ACTION="?op=setStatus" name="form5" onSubmit="return form5_onsubmit()">
  169.               <td height="23" colspan=3 align="center" class="stable"><table width="100%">
  170.                   <tr>
  171.                     <td width="43%" height="26">
  172.                       <lt:Label res="res.label.forum.admin.forum_m" key="status"/>
  173.                       <select name="status">
  174.                             <option value="<%=ForumDb.STATUS_NORMAL%>">
  175.                               <lt:Label res="res.label.forum.admin.forum_m" key="start"/>
  176.                         </option>
  177.                             <option value="<%=ForumDb.STATUS_STOP%>">
  178.                               <lt:Label res="res.label.forum.admin.forum_m" key="stop"/>
  179.                         </option>
  180.                       </select>
  181.                           <script>
  182. form5.status.value = "<%=fd.getStatus()%>"
  183. </script>
  184.                           <textarea id="reason" name="reason" style="display:none"><%=fd.getReason().replaceAll(""","'")%></textarea></td></tr>
  185.                   <tr>
  186.                     <td height="22"><%
  187. String rpath = request.getContextPath();
  188. %>
  189.                         <link rel="stylesheet" href="<%=rpath%>/editor/edit.css">
  190.                         <script src="<%=rpath%>/editor/DhtmlEdit.js"></script>
  191.                         <script src="<%=rpath%>/editor/editjs.jsp"></script>
  192.                         <script src="<%=rpath%>/editor/editor_s.jsp"></script>
  193.                         <script>
  194. setHtml(form5.reason);
  195.                           </script></td>
  196.                   </tr>
  197.                   <tr>
  198.                     <td height="22" align="center"><input name="submit2" type="submit" value="<lt:Label key="ok"/>"></td>
  199.                   </tr>
  200.               </table></td>
  201.             </FORM>
  202.           </tr>
  203.         </TABLE>
  204.       <br>
  205.       <br>
  206.       <br></TD>
  207.     </TR>
  208.   </TBODY>
  209. </TABLE>
  210. <br>
  211. </td>
  212. </tr>
  213. </table>
  214. </td>
  215. </tr>
  216. </table>
  217. </body>  
  218. <script>
  219. function form5_onsubmit() {
  220. form5.reason.value = getHtml();
  221. if (form5.reason.value.length>3000) {
  222. alert("<lt:Label res="res.label.forum.admin.forum_m" key="too_long"/>" + 3000);
  223. return false;
  224. }
  225. }
  226. </script>                                      
  227. </html>                            
  228.