topic.jsp

来自「雷霆论坛是用J2EE技术开发的功能强大、扩展性强、易于定制」· JSP 代码 · 共 158 行

JSP
158
字号
<!--topic.jsp-->
<%@page language="java" contentType="text/html; charset=GB2312" import="lightningboard.util.*,lightningboard.bean.*,java.util.Iterator"%>
<%@include file="header.inc"%>


<jsp:useBean id="topicBean" scope="request" class="lightningboard.bean.TopicBean"/>


<!--bar-->
<table width="750" align="center" border="0" cellspacing="1" cellpadding="5" bgcolor="#bbbbbb">
	<tr>
		<td bgcolor="#F3F3F3" >
			<b><IMG SRC="img/lb.gif" WIDTH="16" HEIGHT="16" BORDER=0 valign="middle">&nbsp;<A HREF="home.do">HOME</A>&nbsp;&gt;&nbsp;<A HREF="forum.do?f_id=<%=topicBean.getF_id()%>"><%=topicBean.getF_name()%></A>&nbsp;&gt;&nbsp;<%=StringUtil.escapeHTMLTags(topicBean.getT_name())%></b>
		</td>
	</tr>
</table>

<BR>
<!--forum info bar -->
<table width="750" align="center" border="0" cellspacing="1" cellpadding="5">
	<tr>
		<td>
				&nbsp;&nbsp;<%=topicBean.getF_info()%>&nbsp;<%=topicBean.getF_topics()%>/<%=topicBean.getF_messages()%>&nbsp;(Moderator:<A HREF="user.do?u_id=<%=topicBean.getF_u_id()%>"><%=topicBean.getU_name()%></A>)
		</td>
	</tr>
</table>

<!--post bar -->
<table width="750" align="center" border="0" cellspacing="1" cellpadding="5">
	<tr>
		<td>
				&nbsp;&nbsp;<A HREF="post.do?f_id=<%=topicBean.getF_id()%>"><IMG SRC="img/post.gif" WIDTH="110" HEIGHT="26" BORDER=0 ALT="post"></A>
				&nbsp;&nbsp;<A HREF="post.do?t_id=<%=topicBean.getT_id()%>&reply=true"><IMG SRC="img/reply.gif" WIDTH="98" HEIGHT="22" BORDER=0 ALT="reply"></A>
		</td>
	</tr>
</table>

<!--messages-->
<table width="750" align="center" border="0" cellspacing="1" cellpadding="5" bgcolor="#bbbbbb">
	<tr bgcolor="#1665b4">
		<td width="25%"  colspan="2">
			<%  if (topicBean.getT_order()>0&&topicBean.getT_locked()>0){%>
				<IMG SRC="img/lockedSticky.gif" WIDTH="16" HEIGHT="16" BORDER=0 >
			<% }else if (topicBean.getT_order()>0){%>
				<IMG SRC="img/sticky.gif" WIDTH="16" HEIGHT="16" BORDER=0 >
			<% }else if (topicBean.getT_locked()>0){%>
				<IMG SRC="img/locked.gif" WIDTH="16" HEIGHT="16" BORDER=0 >
			<%}else{%>
				<%if (topicBean.getT_replies()>20){%>
					<IMG SRC="img/hotTopic.gif" WIDTH="16" HEIGHT="16" BORDER=0 >
				<%}else{%>
					<IMG SRC="img/topic.gif" WIDTH="16" HEIGHT="16" BORDER=0 >
				<%}%>
			<%}%>
			&nbsp;<font color="#FFFFFF">Subject:&nbsp;<%=StringUtil.escapeHTMLTags(topicBean.getT_name())%>  (Replies:<%=topicBean.getT_replies()%>)</font>
		</td>
	</tr>
<!--loop begin-->
<%
int i=1;
String[] bgcolors={"#d9e4f9","#F3F3F3"};
Iterator messages=topicBean.getMessages().iterator(); 
while(messages.hasNext()){
	Message message=(Message)messages.next();
	i=1-i;
%>	
	<tr>
		<td width="25%" bgcolor="<%=bgcolors[i]%>" valign="top" cellpadding="5">
			<BR>
			&nbsp;&nbsp;<A HREF="user.do?u_id=<%=message.getM_u_id()%>"><%=StringUtil.escapeHTMLTags(message.getU_name())%></A><BR>
			&nbsp;&nbsp;<%=message.getR_name()%><BR>
			&nbsp;&nbsp;<img name="avatar" src="img/avatars/<%=message.getU_avatar_id()%>.gif"  width=36 height=36 border=0 ><BR>
			
			From: <%=StringUtil.escapeHTMLTags(message.getU_address())%><BR>
			Posts: <%=message.getU_post()%><BR>
			Register at: <%=DateTimeUtil.shortFmt(message.getU_regtime())%><BR>
			<BR>

		</td>							
		<td width="80%" bgcolor="<%=bgcolors[i]%>" wordwrap="true" valign="top">

			&nbsp;&nbsp;<img src="img/icons/<%=message.getM_iconid()%>.gif" width=15 height=15 border="0">
			&nbsp;<%=DateTimeUtil.shortFmt(message.getM_time())%>
			<!-- <%=message.getM_id()%> -->
			<HR size="1">
			<P>
			<%=StringUtil.dspHtml(message.getM_content())%>
			</P>
			------------------------------------------------------------------<BR>
			<%=StringUtil.dspHtml(message.getU_sign())%>

		</td>		
	</tr>
<%
}
%>
<!--loop end-->
	<TR>
		<TD colspan="2" bgcolor="#F3F3F3">
			<!--split page-->
			<%
				int start=topicBean.getStart();
				int range=topicBean.getRange();
				int count=topicBean.getCount();
			%>
			<TABLE width="100%" border="0"  cellpadding="0" cellspacing="0">
			<TR>
				<TD width="20%">
				<%if(start>range){%><A HREF="topic.do?t_id=<%=topicBean.getT_id()%>&start=<%=start-range%>">PREV</A><%}else{%>PREV<%}%>
				</TD>
				<TD align="center">
				Topcis:&nbsp;<%=count%>&nbsp;&nbsp;RPP:&nbsp;<%=range%>&nbsp;&nbsp;Start:&nbsp;<%=start%>
				</TD>
				<TD width="20%" ALIGN="right">
				<%if(start+range<=count){%><A HREF="topic.do?t_id=<%=topicBean.getT_id()%>&start=<%=start+range%>">NEXT</A><%}else{%>NEXT<%}%>
				</TD>
			</TR>
			</TABLE>
		</TD>
	</TR>

</table>

<BR>

<table width="750" align="center" border="0" cellspacing="1" cellpadding="5">
	<form method="post" action="forum.do">

	<tr>
		<td>
		 <IMG SRC="img/topic.gif" WIDTH="16" HEIGHT="16" BORDER=0 >&nbsp;Topic&nbsp;&nbsp;<IMG SRC="img/hotTopic.gif" WIDTH="16" HEIGHT="16" BORDER=0 >&nbsp;Hot Topic (More than 20 replies)<BR>
      <IMG SRC="img/sticky.gif" WIDTH="16" HEIGHT="16" BORDER=0 >&nbsp;Sticky Topic&nbsp;&nbsp;<IMG SRC="img/locked.gif" WIDTH="16" HEIGHT="16" BORDER=0 >&nbsp;Locked Topic<BR>
	  <IMG SRC="img/lockedSticky.gif" WIDTH="16" HEIGHT="16" BORDER=0 >&nbsp;Locked Sticky Topic  
		</td>
		<td align="right" valign="top">
		Forum Jump:
		<select name="f_id">
		<% 
			java.util.Map forumMap=(java.util.Map)topicBean.getForumMap(); 
			java.util.Set forunSet=forumMap.entrySet();
			for (Iterator it = forunSet.iterator(); it.hasNext();) {
				java.util.Map.Entry me = (java.util.Map.Entry)it.next();
				String f_idJ=(String)me.getKey();
				int f_idJump=StringUtil.parseInt(f_idJ);
				String f_nameJump=(String)me.getValue();
		%>
			<option value="<%=f_idJump%>" <%if (f_idJump==topicBean.getF_id()){out.print("selected");}%>><%=f_nameJump%></option>
		<%}%>
		</select> 
		<input type="submit" value="GO">
	</td>	
	</tr>
		</form>
</table>

<div align="center"><FONT SIZE="1pt" COLOR="#bbbbbb"> <%=request.getAttribute("processTime")%> ms</FONT></div>

<%@include file="footer.inc"%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?