日期:2014-05-18 浏览次数:20906 次
<!-- //留言列表页面 --> <%@ page contentType="text/html;charset=gb2312" %> <%@ page isELIgnored="false" %> <%@ page import="ch.*"%> <html> <head> <script language="javascript" src="/messageboard/fckeditor/fckeditor.js"> fuction checkValue() { var f=document.forms["main"]; if(f.title.value.lentgh==0) { alert("请输入留言的标题"); f.title.focus(); return false; } if(f.content.value.length==0) { alert("请输入留言的内容"); f.content.focus(); return false; } return true; } </script> </head> <body bgcolor="#000000" text="#fffaa"> <center> <table border="1" width="600"> <tr> <td colspan="3" align="center">留言列表(<a href="logout">退出</a>)</td> </tr> <tr> <td colspan="3" align="left"><font color="red"> ${msg}</font></td> </tr> </table> <table border="2" width="600"> <% //取得session中的用户信息 UserInfo user=(UserInfo)session.getAttribute("session_userinfo"); //取得留言列表 java.util.Vector articles=(java.util.Vector)request.getAttribute("articles"); //取得回复留言列表 java.util.Vector replys=(java.util.Vector)request.getAttribute("replys"); //逐步显示每一条留言的内容 for(int i=0;i<articles.size();i++) { Article art=(Article)articles.get(i); %> <tr> <td width="15" rowspan="2"> <%=(i+1) %> </td> <td> <%=art.getTitle() %> ( <%=art.getPubdate() %> ) </td> <td> <%=art.getUserID() %> ( <%=art.getHostIP() %> ) <% if(art.getUserID()==user.getUserID()) out.println("<a href=\"articleupdate?articleid="+art.getArticleID()+"\">修改</a> "); if(art.getUserID()==user.getUserID()||user.isAdmin()) out.println("<a href=\"articledelete?articleid="+art.getArticleID()+"\">删除</a>"); if(user.isAdmin()) out.println("<a href=\"articlereply?articleid="+art.getArticleID()+"\">回复</a>"); %> </td> </tr> <tr> <td colspan="2"><%=art.getContent() %></td> </tr> <% for(int j=0;j<replys.size();j++) { Article reply=(Article)replys.get(j); if(reply.getFarticleID()==art.getArticleID()) { %> <tr> <td width="15" rowspan="2"><font color="blue">回<br>复</font></td> <td><%=reply.getTitle() %>(<%=reply.getPu