⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threadmode2.jsp

📁 Struts+Spring+Hibernate开发的BBS,功能很强大很完善
💻 JSP
📖 第 1 页 / 共 2 页
字号:

<%	// check to see if there are any forums
	if (!messages.hasNext()) {
%>
    <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
    <i>这个论坛还没有主题 (你没有权限看到任何主题,请联系管理员).</i>
    </font>

<%	} else {
        // There are messages, so iterate and print them out
        String bgcolor = "";
        int row = 1;
    	while (messages.hasNext()) {
    		ForumMessage message = (ForumMessage)messages.next();
    		boolean isRootMessage = (message.getID() == rootMessage.getID());
    		User author = message.getUser();
            if (row++%2 == 1) {
                bgcolor = JiveGlobals.getJiveProperty("skin.default.tableRowColor1");
            }
            else {
                bgcolor = JiveGlobals.getJiveProperty("skin.default.tableRowColor2");
            }
%>

<a name="<%= message.getID() %>"></a>

<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
 cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
	<td>
    <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
     cellpadding="4" cellspacing="1" border="0" width="100%">
    <tr bgcolor="<%= bgcolor %>">
        <td width="1%" rowspan="2" valign="top">
        <table cellpadding="0" cellspacing="0" border="0" width="140">
        <tr><td>
            <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
            color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<%	    if (author == null) {
            // Check to see if there is an extended property for name & email
            // since the gateway feature imports names and emails as extended
            // props.
            String name = message.getProperty("name");
            String email = message.getProperty("email");
            String nameAndEmail = myEnv.du.getNameAndEmailDisplay(name, email);
            if (nameAndEmail != null) {
%>
            <i>客人: <%= nameAndEmail %></i>
<%          } else { %>
			<i>客人</i>
<%          }
        } else {
            // author != null
            String authorName = author.getName();
%>
			<a href="profile.jsp?user=<%= author.getID() %>" title="<%= (authorName!=null)?authorName:"" %>"
             ><b><%= author.getUsername() %></b></a>
            </font>
			<%
			if (author.getProperty("jiveIcon")!=null){
			   %><br><img src="<%= author.getProperty("jiveIcon") %>" name="icon"> <%
			}
             %>
            <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
            color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
            <br><br>
            <a href="usermessages.jsp?user=<%=author.getID()%>" target=_blank>发表文章: <%= userManager.userMessageCount(author) %></a>
            <br>
            <%  String location = author.getProperty("jiveLocation");
            if (location != null) { %>
            来  自: <%= location %><br>
            <%  } %>
            注册时间: <%= myEnv.shortDateFormatter.format(author.getCreationDate()) %>
            <br><br>
<%      } %>
            </font>
            </td>
        </tr>
        </table>
        </td>
        <td width="97%">
        <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
        color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
        <b><%= message.getSubject() %></b>
        </font>
		</td>
        <td width="1%" nowrap>
        <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
        color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
        发表时间: <%= SkinUtils.formatDate(request,response,pageUser,message.getCreationDate()) %>
        </font>
        </td>

        <td width="1%" nowrap align="center">
            <table cellpadding="2" cellspacing="0" border="0">
            <tr>
                <td><a href="post.jsp?forum=<%= forumID %>&thread=<%= threadID %>&message=<%= message.getID() %>&reply=true"
                     ><img src="images/reply.gif" width="17" height="17" alt="回复此消息" hspace="3" border="0"
                     ></a></td>
                <td>
                <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
                <a href="post.jsp?forum=<%= forumID %>&thread=<%= threadID %>&message=<%= message.getID() %>&reply=true"
                 title="回复此消息">回复</a>
                </font>
                </td>
            </tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="<%= bgcolor %>">
        <td width="99%" colspan="3" valign="top">
        <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
        color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">

<%  if (hilite) {
        String body = message.getBody();
        String[] queryWords = StringUtils.toLowerCaseWordArray(searchWords);
        body = StringUtils.highlightWords(body, queryWords, "<font style='background-color:#ffff00'><b>", "</b></font>");
        if(author!=null && author.getProperty("jiveUserSignature")!=null){
          ForumMessage tMsg = myEnv.getForumFactory().createMessage();
          tMsg.setBody("\n\n__________________\n" + author.getProperty("jiveUserSignature"));
          tMsg = myEnv.getForumFactory().getFilterManager().applyFilters(tMsg);
          body = body + tMsg.getBody();
        }
%>
    <%= body %>
<%  } else {
	//加入过虑后的签名内容
   String tbody = message.getBody();
   if (tbody != null) {
    if(author!=null && author.getProperty("jiveUserSignature")!=null){
      ForumMessage tMsg = myEnv.getForumFactory().createMessage();
      tMsg.setBody("\n\n__________________\n" + author.getProperty("jiveUserSignature"));
      tMsg = myEnv.getForumFactory().getFilterManager().applyFilters(tMsg);
      tbody = tbody + tMsg.getBody();
    }
    }%>
	<%= tbody %>
    <%} %>
	</font>
		<p>
        </td>
    </tr>
    </table>
</td></tr>
</table>
<%  if (isRootMessage && numReplies > 0) { %>
<br>
<%  } %>

<%		} // end of while
	} // end of else
%>

<%  if (numReplies > 0) { %>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
 cellpadding="1" cellspacing="0" border="0" width="100%" align="center">
<tr>
    <td>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.paginatorTableBgColor") %>"
 cellpadding="3" cellspacing="0" border="0" width="100%" align="center">
<tr><td>
    <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.paginatorTextColor") %>">
    这个主题有 <b><%= numReplies %></b> 条回复 / <b><%= numPages %></b> 页

<%	if (numPages > 1) { %>
    [
<%	    if (start > 0) { %>
    <a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= (start-range) %>&msRange=<%= range %>"
     title="Previous page" style="color:<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>;">&laquo;</a>
    |
<%	    }
        int currentPage = (start/range)+1;
    	int lo = currentPage - 3;
    	if (lo <= 0) {
	    	lo = 1;
    	}
	    int hi = currentPage + 5;
    	while (lo < currentPage) {
%>
    <a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= ((lo-1)*range) %>&msRange=<%= range %>"
      style="color:<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>;"><%= lo %></a>&nbsp;
<%          lo++;
	    }
%>
    <b><span style="background-color:#ffffff;color:#000000;"><%= currentPage %></span></b>
<%	    while ((currentPage < hi) && (currentPage<numPages)) { %>
        &nbsp;<a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= ((currentPage)*range) %>&msRange=<%= range %>"
          style="color:<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>;"><%= currentPage+1 %></a>
<%          currentPage++;
	    }
        if (numMessages > (start+range)) {
            int numRemaining = (int)(numMessages-(start+range));
%>
	    |
        <a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= (start+range) %>&msRange=<%= range %>"
         title="Next page" style="color:<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>;">&raquo;</a>
<%      } %>
    ]
<%	} %>
    </font>
    </td>
</tr>
</table>
    </td>
</tr>
</table>

<%  } // end if numReplies > 0 %>

<%  // Reset the forumThread iterator so we can display the next/previous
    // buttons again
    threadIterator = forum.threads();
    threadIterator.setIndex(thread);
%>
<table cellpadding="0" cellspacing="2" border="0" width="100%" align="center">
<tr>
    <td width="1%" nowrap valign="top">
<%  if (threadIterator.hasPrevious()) {
        ForumThread prevThread = (ForumThread)threadIterator.previous();
        // advance the iterator pointer back to the original index
        threadIterator.next();
        String subj = prevThread.getRootMessage().getSubject();
        // Replace any " in the subject
        subj = StringUtils.replace(subj, "\"", "&quot;");
%>
    <a href="thread.jsp?forum=<%= forumID %>&thread=<%= prevThread.getID() %>"
     title="<%= subj %>"><img src="images/prev.gif" width="10" height="10" hspace="2" alt="Topic: <%= subj %>" border="0"></a>
    <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">
    <a href="thread.jsp?forum=<%= forumID %>&thread=<%= prevThread.getID() %>"
     title="Topic: <%= subj %>">上一主题</a>
    </font>
<%  } else { %>
    &nbsp;
<%  } %>
    </td>
    <td width="98%" align="center">

<table cellpadding="0" cellspacing="2" border="0">
<tr>
	<td><a href="forum.jsp?forum=<%= forumID %>"><img src="images/back_to.gif" width="12" height="12" alt="返回主题列表" border="0"></a></td>
	<td nowrap><font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">
        &nbsp;<a href="forum.jsp?forum=<%= forumID %>" title="返回主题列表">返回主题列表</a>
        </font>
    </td>
    <td nowrap>&nbsp;&nbsp;</td>
	<td><a href="#top"><img src="images/up_to.gif" width="12" height="12" alt="返回页首" border="0"></a></td>
	<td nowrap><font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">
        &nbsp;<a href="#top" title="C返回页首">返回页首</a>
        </font>
    </td>
</tr>
</table>

    </td>
    <td width="1%" nowrap valign="top">
<%  if (threadIterator.hasNext()) {
        ForumThread nextThread = (ForumThread)threadIterator.next();
        String subj = nextThread.getRootMessage().getSubject();
%>
    <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">
    <a href="thread.jsp?forum=<%= forumID %>&thread=<%= nextThread.getID() %>"
     title="<%= subj %>">下一主题</a>
    </font>
    <a href="thread.jsp?forum=<%= forumID %>&thread=<%= nextThread.getID() %>"
     title="<%= subj %>"><img src="images/next.gif" width="10" height="10" hspace="2" alt="Topic: <%= subj %>" border="0"></a>
<%  } else { %>
    &nbsp;
<%  } %>
    </td>
</tr>
</table>
<br>






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

⌨️ 快捷键说明

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