admin_board.jsp
上传用户:yuyunping
上传日期:2013-03-21
资源大小:1844k
文件大小:15k
源码类别:

Java书籍

开发平台:

Java

  1. <%@ page contentType="text/html;charset=gb2312"%>
  2. <%@ include file="INC/const.jsp"%>
  3. <%@ page import = "java.util.Vector,
  4. net.acai.forum.admin.*"%>
  5. <%
  6. System.out.println(forumName);
  7. %>
  8. <title><%=forumName%>--管理页面</title>
  9. <link rel="stylesheet" type="text/css" href="forum.css">
  10. <BODY bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
  11. <%
  12. try{
  13. if(session.getAttribute("adminFlag")==null)
  14. throw new Exception("本页面为管理员专用,请<a href=elogin.jsp>登陆管理</a>后进入。");
  15. %>
  16. <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTableBackColor%> align=center>
  17.   <tr>
  18.     <td>
  19.       <table cellpadding=3 cellspacing=1 border=0 width=100%>
  20.         <tr bgcolor='<%=aTableTitleColor%>'>
  21.         <td align=center colspan="2">欢迎<b>
  22. <%=session.getAttribute("adminName")%></b>进入管理页面
  23.         </td>
  24.         </tr>
  25.             <tr bgcolor=<%=tableBodyColor%>>
  26.               
  27.           <td width="20%" valign=top> 
  28.             <%@include file="admin_left.jsp"%>
  29.             </td>
  30.               
  31.           <td width="80%" valign=top> 
  32.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  33.               <tr>
  34.                 <td>1.注意事项: 在下面,您将看到目前所有的论坛分类。您可以编辑论坛分类名或是增加一个新的论坛到这个分类中。 也可以编辑或删除目前存在的论坛。您可以对目前的分类重新进行排列。 
  35.                    <p><font color=<%=alertFontColor%>>2.特别注意</font>:删除论坛同时将删除该论坛下所有帖子!删除分类同时删除下属论坛和其中帖子! 操作时请完整填写表单信息。
  36.                 </td>
  37.               </tr>
  38.               <tr>
  39.               <td>
  40.               <p align=cetner><b><a href=admin_board.jsp>论坛管理</a> | <a href="admin_board.jsp?action=addclass">新建论坛分类</a></p>
  41.               </td>
  42.               <tr>
  43.             </table>
  44. <%
  45.   String action=ParamUtil.getString(request,"action");
  46. if(action==null||action.equals("")){
  47.   response.sendRedirect("admin_board.jsp?action=boardinfo");
  48.   }
  49.   
  50. else if(action.equals("add")){
  51. %>
  52.  <form action ="admin_board.jsp?action=savenew" method=post>
  53. <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  54. <tr bgcolor=<%=aTableTitleColor%>> 
  55. <td width="52%" height=22><b>字段名称:</b> </td>
  56. <td width="48%"><b>变量值:</b> </td>
  57. </tr>
  58. <tr> 
  59. <td width="52%">论坛序号(注意不能和别的论坛序号相同)</td>
  60. <td width="48%"> 
  61. </td>
  62. </tr>
  63. <tr> 
  64. <td width="52%">论坛名</td>
  65. <td width="48%"> 
  66. <input type="text" name="boardtype" size="24">
  67. </td>
  68. </tr>
  69. <tr> 
  70. <td width="52%">所属类别</td>
  71. <td width="48%"> 
  72. <select name=class>
  73. <%
  74. Vector gateWayVector=GateWayFactory.getGateWays();
  75. for( i=0;i<gateWayVector.size();i++){
  76. GateWay gateWay=(GateWay)gateWayVector.get(i);
  77.      int gateWayID=gateWay.getGateWayID();
  78.      String gateWayName=gateWay.getGateWayName();
  79. %>
  80. <option value=<%=gateWayID%> <%if(gateWayID==ParamUtil.getInt(request,"gateWayID",0)){out.println("selected");}%>><%=gateWayName%> 
  81. <%
  82. }
  83. %>
  84. </select>
  85. </td>
  86. </tr>
  87. <tr> 
  88. <td width="52%">版面说明</td>
  89. <td width="48%"> 
  90. <input type="text" name="readme" size="24">
  91. </td>
  92. </tr>
  93. <tr> 
  94. <td width="52%">斑竹(多斑竹添加请用|分隔,如:沙滩小子|wodeail):</td>
  95. <td width="48%"> 
  96. <input type="text" name="boardmaster" size="24">
  97. </td>
  98. </tr>
  99. <tr> 
  100. <td width="52%">锁定版面(0开放,1锁定,2特定用户开放)</td>
  101. <td width="48%"> 
  102. <select name="lockboard">
  103. <option value="0" selected>0 
  104. <option value="1">1 
  105. <option value="2">2 
  106. </select>
  107. </td>
  108. </tr>
  109. <tr> 
  110. <td width="52%">版面表格边框颜色</td>
  111. <td width="48%"> 
  112. <input type="text" name="Tableback" size="24" value="<%=tableBackColor%>">
  113. </td>
  114. </tr>
  115. <tr> 
  116. <td width="52%">版面标题表格颜色</td>
  117. <td width="48%"> 
  118. <input type="text" name="Tabletitle" size="24" value="<%=tableTitleColor%>">
  119. </td>
  120. </tr>
  121. <tr> 
  122. <td width="52%">版面内容表格颜色1</td>
  123. <td width="48%"> 
  124. <input type="text" name="Tablebody" size="24" value="<%=tableBodyColor%>">
  125. </td>
  126. </tr>
  127. <tr> 
  128. <td width="52%">版面内容表格颜色2,颜色1和颜色2在bbs风格中互相穿插排列</td>
  129. <td width="48%"> 
  130. <input type="text" name="aTablebody" size="24" value="#FFFFFF">
  131. </td>
  132. </tr>
  133. <tr> 
  134. <td width="52%">版面标题表格字体颜色</td>
  135. <td width="48%"> 
  136. <input type="text" name="TableFont" size="24" value="<%=tableFontColor%>">
  137. </td>
  138. </tr>
  139. <tr> 
  140. <td width="52%">版面内容表格字体颜色</td>
  141. <td width="48%"> 
  142. <input type="text" name="TableContent" size="24" value="<%=tableContentColor%>">
  143. </td>
  144. </tr>
  145. <tr> 
  146. <td width="52%">提醒语句颜色</td>
  147. <td width="48%"> 
  148. <input type="text" name="AlertFont" size="24" value="<%=alertFontColor%>">
  149. </td>
  150. </tr>
  151. <tr> 
  152. <td width="52%">论坛Logo地址</td>
  153. <td width="48%"> 
  154. <input type="text" name="Logo" size="35" value="<%=forumLogo%>">
  155. </td>
  156. </tr>
  157. <tr> 
  158. <td width="52%">首页显示论坛图片</td>
  159. <td width="48%"> 
  160. <input type="text" name="indexIMG" size="35" value="">
  161. </td>
  162. </tr>
  163. <tr> 
  164. <td width="52%">UBB标签</td>
  165. <td width="48%"> 
  166. <select name="strAllowForumCode">
  167. <option value="0">不使用 
  168. <option value="1" selected>使用 
  169. </select>
  170. </td>
  171. </tr>
  172. <tr> 
  173. <td width="52%">HTML标签</td>
  174. <td width="48%"> 
  175. <select name="strAllowHTML">
  176. <option value="0" selected>不使用 
  177. <option value="1">使用 
  178. </select>
  179. </td>
  180. </tr>
  181. <tr> 
  182. <td width="52%">帖图标签</td>
  183. <td width="48%"> 
  184. <select name="strIMGInPosts">
  185. <option value="0">不使用 
  186. <option value="1" selected>使用 
  187. </select>
  188. </td>
  189. </tr>
  190. <tr> 
  191. <td width="52%">Flash标签</td>
  192. <td width="48%"> 
  193. <select name="strflash">
  194. <option value="0">不使用 
  195. <option value="1" selected>使用 
  196. </select>
  197. </td>
  198. </tr>
  199. <tr> 
  200. <td width="52%">表情标签</td>
  201. <td width="48%"> 
  202. <select name="strIcons">
  203. <option value="0">不使用 
  204. <option value="1" selected>使用 
  205. </select>
  206. </td>
  207. </tr>
  208. <tr bgcolor="<%=aTableTitleColor%>"> 
  209. <td width="52%">&nbsp;</td>
  210. <td width="48%"> 
  211. <input type="submit" name="Submit" value="添加论坛">
  212. </td>
  213. </tr>
  214. </table>
  215. </form>
  216. <%
  217. }
  218. else if(action.equals("edit")){
  219. %>
  220.  <form action ="admin_board.jsp?action=savedit" method=post>           
  221. <%
  222. int editID;
  223. try{
  224. editID=ParamUtil.getInt(request,"editid");
  225. }
  226. catch(Exception e){
  227. throw new Exception("对不起,您没选择,编辑论坛的ID");
  228. }
  229. Forum theForum=ForumFactory.getForum(editID);
  230. if(theForum==null)
  231. throw new Exception("错误的版面");
  232. %>            
  233. <input type='hidden' name=editid value='<%=editID%>'>
  234.             
  235. <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  236. <tr bgcolor=<%=aTableTitleColor%>> 
  237. <td width="52%" height=22><b>字段名称:</b> </td>
  238. <td width="48%"> 
  239. <div align="center"><b>变量值:</b></div>
  240. </td>
  241. </tr>
  242. <tr>
  243. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>论坛ID</B></font></td>
  244. <td width="48%"> 
  245. <input type="text" name="newforumID" size="3"  value = '<%=theForum.getForumID()%>'>
  246. </td>
  247. </tr>
  248. <tr> 
  249. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>论坛名称</B></font></td>
  250. <td width="48%"> 
  251. <input type="text" name="boardtype" size="24"  value = '<%=theForum.getForumType()%>'>
  252. </td>
  253. </tr>
  254. <tr> 
  255. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>所属类别</B></font></td>
  256. <td width="48%"> 
  257. <select name=class>
  258. <%
  259. Vector gateWayVector=GateWayFactory.getGateWays();
  260. for( i=0;i<gateWayVector.size();i++){
  261. GateWay gateWay=(GateWay)gateWayVector.get(i);
  262.      int gateWayID=gateWay.getGateWayID();
  263.      String gateWayName=gateWay.getGateWayName();
  264. %>
  265. <option value=<%=gateWayID%> <%if(theForum.getForumClass()==gateWayID){ out.println("selected");}%>><%=gateWayName%> 
  266. <%
  267. }
  268. %>
  269. </select>
  270. </td>
  271. </tr>
  272. <tr> 
  273. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>版面说明</B></font></td>
  274. <td width="48%"> 
  275. <input type="text" name="readme" size="24" value='<%=theForum.getReadMe()%>'>
  276. </td>
  277. </tr>
  278. <tr> 
  279. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>论坛版主</B><BR>多斑竹添加请用|分隔,如:沙滩小子|wodeail</font></td>
  280. <td width="48%"> 
  281. <input type="text" name="boardmaster" size="24"  value='<%=theForum.getForumMaster()%>'>
  282. </td>
  283. </tr>
  284. <tr> 
  285. <td width="52%" height=24><font color="<%=tableContentColor%>"><B>是否为隐含版面</B><BR>0表示开放,1表示隐含</font></td>
  286. <td width="48%"> 
  287. <select name="lockboard">
  288. <option value="0" <%if (theForum.getLockForum()==0) {%>selected<%}%>>0 
  289. <option value="1" <%if (theForum.getLockForum()==1) {%>selected<%}%>>1 
  290. </select>
  291. </td>
  292. </tr>
  293. <tr> 
  294. <td width="52%">版面表格边框颜色</td>
  295. <td width="48%"> 
  296. <input type="text" name="Tableback" size="24"  value='<%=theForum.getTableBack()%>'>
  297. </td>
  298. </tr>
  299. <tr> 
  300. <td width="52%">版面标题表格颜色</td>
  301. <td width="48%"> 
  302. <input type="text" name="Tabletitle" size="24"  value='<%=theForum.getTableTitle()%>'>
  303. </td>
  304. </tr>
  305. <tr> 
  306. <td width="52%">版面内容表格颜色1</td>
  307. <td width="48%"> 
  308. <input type="text" name="Tablebody" size="24"  value='<%=theForum.getTableBody()%>'>
  309. </td>
  310. </tr>
  311. <tr > 
  312. <td width="52%">版面内容表格颜色2,颜色1和颜色2在bbs风格中互相穿插排列</td>
  313. <td width="48%"> 
  314. <input type="text" name="aTablebody" size="24"  value='<%=theForum.getATableBody()%>'>
  315. </td>
  316. </tr>
  317. <tr> 
  318. <td width="52%">版面标题表格字体颜色</td>
  319. <td width="48%"> 
  320. <input type="text" name="TableFont" size="24"  value='<%=theForum.getTableFont()%>'>
  321. </td>
  322. </tr>
  323. <tr> 
  324. <td width="52%">版面内容表格字体颜色</td>
  325. <td width="48%"> 
  326. <input type="text" name="TableContent" size="24"  value='<%=theForum.getTableContent()%>'>
  327. </td>
  328. </tr>
  329. <tr> 
  330. <td width="52%">提醒语句颜色</td>
  331. <td width="48%"> 
  332. <input type="text" name="AlertFont" size="24"  value='<%=theForum.getAlertFont()%>'>
  333. </td>
  334. </tr>
  335. <tr> 
  336. <td width="52%">论坛Logo地址</td>
  337. <td width="48%"> 
  338. <input type="text" name="Logo" size="35" value="<%=theForum.getForumLogo()%>">
  339. </td>
  340. </tr>
  341. <tr> 
  342. <td width="52%">首页显示论坛图片</td>
  343. <td width="48%">
  344. <input type="text" name="indexIMG" size="35" value="<%=theForum.getIndexIMG()%>">
  345. </td>
  346. </tr>
  347. <tr> 
  348. <td width="52%">UBB标签</td>
  349. <td width="48%"> 
  350. <select name="strAllowForumCode">
  351. <option value="0" <%if (!theForum.getStrAllowForumCode()){%>selected<%}%>>不使用 
  352. <option value="1" <%if (theForum.getStrAllowForumCode()){%>selected<%}%>>使用 
  353. </select>
  354. </td>
  355. </tr>
  356. <tr> 
  357. <td width="52%">HTML标签</td>
  358. <td width="48%"> 
  359. <select name="strAllowHTML">
  360. <option value="0" <%if (!theForum.getStrAllowHTML()){%>selected<%}%>>不使用 
  361. <option value="1" <%if (theForum.getStrAllowHTML()) {%>selected<%}%>>使用 
  362. </select>
  363. </td>
  364. </tr>
  365. <tr> 
  366. <td width="52%">帖图标签</td>
  367. <td width="48%"> 
  368. <select name="strIMGInPosts">
  369. <option value="0" <%if (!theForum.getStrIMGInPosts()) {%>selected<%}%>>不使用 
  370. <option value="1" <%if (theForum.getStrIMGInPosts()) {%>selected<%}%>>使用 
  371. </select>
  372. </td>
  373. </tr>
  374. <tr> 
  375. <td width="52%">Flash标签</td>
  376. <td width="48%"> 
  377. <select name="strflash">
  378. <option value="0" <%if (!theForum.getStrFlash()) {%>selected<%}%>>不使用 
  379. <option value="1" <%if (theForum.getStrFlash()) {%>selected<%}%>>使用 
  380. </select>
  381. </td>
  382. </tr>
  383. <tr> 
  384. <td width="52%">表情标签</td>
  385. <td width="48%"> 
  386. <select name="strIcons">
  387. <option value="0" <%if (!theForum.getStrIcons()){%>selected<%}%>>不使用 
  388. <option value="1" <%if (theForum.getStrIcons()) {%>selected<%}%>>使用 
  389. </select>
  390. </td>
  391. </tr>
  392. <tr bgcolor=<%=aTableTitleColor%>> 
  393. <td width="52%">&nbsp;</td>
  394. <td width="48%"> 
  395. <input type="submit" name="Submit" value="提交">
  396. </td>
  397. </tr>
  398. </table>
  399. </form>
  400. <%
  401. }
  402. else if(action.equals("boardinfo")){
  403.     Vector gateWayVector=GateWayFactory.getGateWays();
  404. for( i=0;i<gateWayVector.size();i++){
  405. GateWay gateWay=(GateWay)gateWayVector.get(i);
  406.      int gateWayID=gateWay.getGateWayID();
  407.      String gateWayName=gateWay.getGateWayName();
  408.    
  409. %>
  410.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  411.               <tr bgcolor="<%=aTableTitleColor%>">
  412.                 <td height="21"><font color="<%=tableContentColor%>"><B><%=gateWayID%>,分类名:<%=gateWayName%></b>    <a href="admin_board.jsp?action=add&gateWayID=<%=gateWayID%>"><font color="<%=tableContentColor%>">新增论坛</font></a> | <a href=admin_board.jsp?action=orders&id=<%=gateWayID%>><font color="<%=tableContentColor%>">分类排序修改</font></a> | <a href=admin_board.jsp?action=del1&id=<%=gateWayID%> onclick="{if(confirm('删除将包括该分类下所有论坛的所有帖子,确定删除吗?')){return true;}return false;}"><font color="<%=tableContentColor%>">删除分类</font></a></font></td>
  413.               </tr>
  414.             </table>
  415. <%
  416.             try{
  417. Vector forumVector=ForumFactory.getForums(gateWayID);
  418. for(int j=0;j<forumVector.size();j++){
  419. Forum theForum=(Forum)forumVector.get(j);
  420.             %>
  421.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  422.               <tr> 
  423.                 <td height="18"><%=theForum.getForumID()%>,论坛名:<%=theForum.getForumType()%></td>
  424.               </tr>
  425.               <tr>
  426.                 <td height="18">论坛简介:<%=theForum.getReadMe()%></td>
  427.               </tr>
  428.               <tr>
  429.                 <td height="15"><a href="admin_board.jsp?action=edit&editid=<%=theForum.getForumID()%>">编辑此论坛</a> | <a href="admin_board.jsp?action=del&boardid=<%=theForum.getForumID()%>">删除此论坛</a></td>
  430.               </tr>
  431.             </table>
  432. <hr color=black height=1 width="70%" align=left>
  433. <%
  434. }
  435. }
  436. catch(Exception e){}
  437. }
  438. %>
  439.           </td>
  440.             </tr>
  441.         </table>      
  442.         </td>
  443.        </tr>
  444. </table>
  445. <%
  446. }
  447. else if(action.equals("savenew")){
  448. ForumAdmin.saveNew(request);
  449. }
  450. else if(action.equals("savedit")){
  451. ForumAdmin.saveEdit(request);
  452. }
  453. else if(action.equals("del")){
  454. ForumAdmin.del(request);
  455. }
  456. else if(action.equals("del1")){
  457. ForumAdmin.dell(request);
  458. }
  459. else if(action.equals("orders")){
  460. %><br>
  461.             <table width="95%" border="0" cellspacing="3" cellpadding="0" align=center>
  462.               <tr> 
  463.                 <td height="22"><b>论坛分类重新排序修改</b><br>
  464. 注意:请在相应论坛分类的排序表单内输入相应的排列序号,注意不能和别的论坛分类有相同的排列序号。
  465. </td>
  466.               </tr>
  467.       <tr>
  468. <td>
  469. <%
  470. GateWay gateWay=GateWayFactory.getGateWay(request);
  471. out.println( "<form action=admin_board.jsp?action=updateorders method=post>");
  472. out.println( "<input type=text name=classname size=25 value="+gateWay.getGateWayName()+">");
  473. out.println( "  <input type=text name=newid size=2 value="+gateWay.getGateWayID()+">");
  474. out.println( "<input type=hidden name=id value="+gateWay.getGateWayID()+">");
  475. out.println( "<input type=submit name=Submit value=修改></form>");
  476. %>
  477. </td>
  478.       </tr>
  479.             </table>
  480. <%
  481. }
  482. else if(action.equals("updateorders")){
  483. ForumAdmin.updateOrders(request);
  484. }
  485. else if(action.equals("addclass")){
  486. %>
  487.             <table width="95%" border="0" cellspacing="3" cellpadding="0" align=center>
  488.               <tr> 
  489.                 <td height="22" bgcolor=<%=aTableTitleColor%>><b>添加新的论坛分类</b><br>
  490. 注意:请完整填写以下表单信息,注意不能和别的论坛分类有相同的排列序号。
  491. </td>
  492.               </tr>
  493. <form action=admin_board.jsp?action=saveclass method=post>
  494.       <tr>
  495. 分类名:<input name=classname type=text size=25>
  496. <input type=submit name=Submit value=添加>
  497. </td>
  498.       </tr>
  499. </form>
  500.     </table>
  501. <%
  502. }
  503. else if(action.equals("saveclass")){
  504. ForumAdmin.saveClass(request);
  505. }
  506. else
  507. throw new Exception("错误非法请求!");
  508. %>
  509. <%
  510. }
  511. catch(Exception e){
  512. e.printStackTrace();
  513. String errMsg=e.getMessage();
  514. %>
  515. <%@include file="INC/error.jsp"%>
  516. <%
  517. }%>
  518. <%@ include file="foot.jsp"%>