📄 thread.jsp
字号:
</td>
<td width="1%" nowrap>
<font size="-1">
<a href="forum.jsp?forum=<%= forumID %>" style="color:#ffffff;"
>Back to topic list</a>
</font>
</td>
</tr>
</table>
<% // check to see if there are any forums
if (!messages.hasNext()) {
%>
<font size="-1">
<i>No threads to display in this forum (or you don't have permission to see any).</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();
bgcolor = ((row++%2)==0)?tableRowColor1:tableRowColor2;
%>
<a name="<%= message.getID() %>"></a>
<table bgcolor="<%= tableBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="98%" align="center">
<tr><td>
<table bgcolor="<%= 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 size="-1">
<% 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>Guest: <%= nameAndEmail %></i>
<% } else { %>
<i>Guest</i>
<% }
} else {
String userStatus = author.getProperty("status");
%>
<a href="profile.jsp?user=<%= author.getID() %>"
><b><%= author.getUsername() %></b></a>
<% if (userStatus != null) { %>
<br><i><%= userStatus %></i>
<% } %>
<br><br>
Posts: <%= userManager.userMessageCount(author) %>
<br>
From:
<br>
Since: <%= shortDateFormatter.format(author.getCreationDate()) %>
<br>
<% } %>
</font>
</td>
</tr>
</table>
</td>
<td width="98%">
<font size="-1">
<b><%= message.getSubject() %></b>
<br>
Date Posted: <%= SkinUtils.formatDate(request,response,pageUser,message.getCreationDate()) %>
</font>
</td>
<td width="1%" nowrap align="center">
<font size="-1" color="#666666">
<a href="post.jsp?forum=<%= forumID %>&thread=<%= threadID %>&message=<%= message.getID() %>&reply=true"
title="Reply to this message">» Reply</a>
</font>
</td>
</tr>
<tr bgcolor="<%= bgcolor %>">
<td width="99%" colspan="3" valign="top">
<font size="-1">
<% if (hilite) {
String body = message.getBody();
String[] queryWords = StringUtils.toLowerCaseWordArray(searchWords);
body = StringUtils.highlightWords(body, queryWords, "<font style='background-color:#ffff00'><b>", "</b></font>");
%>
<%= body %>
<% } else { %>
<%= message.getBody() %>
<% } %>
</font>
<p>
</td>
</tr>
</table>
</td></tr>
</table>
<% if (isRootMessage) { %>
<br>
<% } %>
<% } // end of while
} // end of else
%>
<table bgcolor="<%= tableBorderColor %>" cellpadding="1" cellspacing="0" border="0" width="98%" align="center">
<tr>
<td>
<table bgcolor="<%= paginatorTableBgColor %>" cellpadding="3" cellspacing="0" border="0" width="100%" align="center">
<tr><td width="99%">
<font size="-1" color="<%= paginatorTextColor %>">
This topic has <b><%= numReplies %></b> <%= ((numReplies==1)?"reply":"replies") %>
on <b><%= numPages %></b> <%= ((numPages==1)?"page":"pages") %>
<% if (numPages > 1) { %>
[
<% if (start > 0) { %>
<a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= (start-range) %>&msRange=<%= range %>"
title="Previous page" style="color:<%= paginatorTextColor %>;">«</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:<%= paginatorTextColor %>;"><%= lo %></a>
<% lo++;
}
%>
<b><span style="background-color:#ffffff;color:#000000;"><%= currentPage %></span></b>
<% while ((currentPage < hi) && (currentPage<numPages)) { %>
<a href="thread.jsp?forum=<%=forumID%>&thread=<%=threadID%>&start=<%= ((currentPage)*range) %>&msRange=<%= range %>"
style="color:<%= paginatorTextColor %>;"><%= 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:<%= paginatorTextColor %>;">»</a>
<% } %>
]
<% } %>
</font>
</td>
<td width="1%" nowrap>
<font size="-1">
<a href="forum.jsp?forum=<%= forumID %>" style="color:<%= paginatorTextColor %>;"
>Back to topic list</a>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%-- begin the special wrapping table again --%>
<table cellpadding="8" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<br>
<table cellpadding="0" cellspacing="2" border="0" width="100%">
<tr>
<td width="1%">
<%= printBox("<img src=images/back_12_12.gif border=0 width=12 height=12 alt=\"Back to topic list\"> Back to topic list","forum.jsp?forum="+forumID,buttonBorderColor,buttonBgColor,buttonBorderColorHover,buttonBgColorHover,"100%") %>
</td>
<td width="1%">
<%= printBox("<img src=images/up_12_12.gif border=0 width=12 height=12 alt=\"Top of the page\"> Top of the page","#top",buttonBorderColor,buttonBgColor,buttonBorderColorHover,buttonBgColorHover,"100%") %>
</td>
<td width="98%"> </td>
</tr>
</table>
<br>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="right">
<a href="http://www.jivesoftware.com/poweredby/" target="_blank"
><img src="images/powered_by_jive.gif" width="100" height="30" alt="Powered by Jive" border="0"></a>
</td>
</tr>
</table>
<%@ include file="include/branding/footer.jsp" %>
<jsp:include page="include/footer.jsp" flush="true"/>
<%! // Global vars, methods, etc
// Returns a property formatted name and email address string,
// like <a href="mailto:foo">Foo Bar</a>
private String myEnv.du.getNameAndEmailDisplay(String name, String email) {
if (name == null && email == null) {
return null;
}
StringBuffer buf = new StringBuffer(40);
// name is not null, so try to make a like like:
// <a href="mailto:foo@bar.com">Foo Bar</a>
if (name != null) {
if (email != null) {
buf.append("<a href=\"mailto:").append(email).append("\">");
buf.append(name);
buf.append("</a>");
}
else {
buf.append(name);
}
}
// Else, name is null so just try to use the email:
// <a href="mailto:foo@bar.com">foo@bar.com</a>
else if (email != null) {
String display = email;
if (email.length() > 15) {
display = email.substring(0,15) + "..";
}
buf.append("<a href=\"mailto:").append(email).append("\">");
buf.append(display);
buf.append("</a>");
}
if (buf.length() == 0) {
return null;
}
else {
return buf.toString();
}
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -