/**
* $RCSfile: forum.jsp,v $
* $Revision: 1.3 $
* $Date: 2002/09/30 14:56:16 $
*/
%>
com.jivesoftware.util.*,
com.jivesoftware.forum.*,
com.jivesoftware.forum.util.*"
errorPage="error.jsp"
%>
long forumID = ParamUtils.getLongParameter(request,"forum",-1L);
int start = ParamUtils.getIntParameter(request,"start",0);
int range = myEnv.du.getThreadRange(request,response,pageUser);
// Load the forum
Forum forum = myEnv.getForumFactory().getForum(forumID);
%>
// counts
ResultFilter filter = new ResultFilter();
filter.setStartIndex(start);
filter.setNumResults(range);
// Set the moderation level minimum
filter.setModerationRangeMin(forum.getModerationMinThreadValue());
// More forum properties
int numThreads = forum.getThreadCount(filter);
int numMessages = forum.getMessageCount(filter);
// Iterator of threads
ForumThreadIterator threads = forum.threads(filter);
%>
>首页
»
>论坛
»
>
消息 / 主题 .
最后回复: .
发新帖
搜索论坛
返回论坛列表
// Number of
int numPages = 0;
if (numThreads != range) {
numPages = (int)Math.ceil((double)numThreads/(double)range);
} else {
numPages = 1;
}
%>
String hrefname="forum.jsp?forum="+forumID;
String paginatorHTML = myEnv.du.getForumPaginator(hrefname, numThreads, numPages, start, range); %>
这个论坛还没有主题发表.
cellpadding="0" cellspacing="0" border="0" width="100%">
cellpadding="3" cellspacing="1" border="0" width="100%">
主题名
回复
作者
最后回复
while (threads.hasNext()) {
ForumThread thread = (ForumThread)threads.next();
long threadID = thread.getID();
ForumMessage rootMessage = thread.getRootMessage();
String subject = rootMessage.getSubject();
User author = rootMessage.getUser();
String username = "Guest";
if (!rootMessage.isAnonymous()) {
username = author.getUsername();
}
else {
String name = rootMessage.getProperty("name");
String email = rootMessage.getProperty("email");
String nameAndEmail = myEnv.du.getNameAndEmailDisplay(name, email);
if (nameAndEmail != null) {
username = nameAndEmail;
}
}
// Number of topics, messages in this forum
int numThreadMessages = thread.getMessageCount();
int numReplies = numThreadMessages - 1;
// number of messages to show per thread page:
int messageRange = myEnv.du.getMessageRange(request,response,pageUser);
// Number of pages of messages in this thread
int numMsgPages = (int)Math.ceil((double)numThreadMessages/(double)messageRange);
// Indicate if this thread has been modified since the last time the
// user visited the page
boolean isNew = (thread.getModifiedDate().getTime() > lastVisited.getTime());
ForumMessage lastPost = myEnv.du.getLastPost(thread);
User lastPostAuthor = null;
if (lastPost != null) {
lastPostAuthor = lastPost.getUser();
}
%>
// parts of the thread.
if (numMsgPages > 1) {
%>
[页:
>
if (numMsgPages > 5) {
%>
...
]
color="">
color="">
by: Guest
by: title="Jump to Message"
> »
color="">
color="">
表示在您最后一次访问本论坛有新消息发布.
返回论坛列表