📄 listtopic.jsp
字号:
Iterator irmgr = managers.iterator();
while (irmgr.hasNext()) {
UserDb user = (UserDb) irmgr.next();
%>
<a href="../userinfo.jsp?username=<%=StrUtil.UrlEncode(user.getName())%>"><%=user.getName()%></a>
<%}%>
</td>
<td height="23" valign="center" bgcolor="#EEEEEE"> <img alt="<lt:Label res="res.label.forum.listtopic" key="today_post"/>" src="images/Forum_today.gif" width="25" height="10" align="absmiddle"> <%=lf.getTodayCount()%> <img alt="<lt:Label res="res.label.forum.listtopic" key="topic_count"/>" src="images/Forum_topic.gif" width="25" height="10" align="absmiddle"> <%=lf.getTopicCount()%> <img src="images/Forum_post.gif" alt="<lt:Label res="res.label.forum.listtopic" key="post_count"/>" width="25" height="10" align="absmiddle"> <%=lf.getPostCount()%></td>
</tr>
</table></td>
</tr>
<%}%>
</tbody>
</table>
<br>
<%}%>
<TABLE bordercolor="<%=skin.getTableBorderClr()%>" cellSpacing=0 cellPadding=4 width="98%" align=center border=1 class="table_normal">
<TBODY>
<TR bgColor=#ffffff>
<TD width="66%">
<%
String addpage = "addtopic_new.jsp";
if (curleaf.getWebeditAllowType()==Leaf.WEBEDIT_ALLOW_TYPE_REDMOON_FIRST)
addpage = "addtopic_we.jsp";
%>
<A href="<%=addpage%>?boardcode=<%=boardcode%>&privurl=<%=privurl%>">
<IMG src="<%=skinPath%>/images/post_<%=SkinUtil.getLocale(request)%>.gif" border=0 width=99 height=25 alt="<lt:Label res="res.label.forum.listtopic" key="post_btn"/>"></A>
<A href="<%=addpage%>?isvote=1&boardcode=<%=boardcode%>&privurl=<%=privurl%>">
<IMG src="<%=skinPath%>/images/votenew_<%=SkinUtil.getLocale(request)%>.gif" border=0 width=99 height=25 alt="<lt:Label res="res.label.forum.listtopic" key="vote_btn"/>"></A>
<%
if (vplugin.size()>0) {
Iterator irplugin = vplugin.iterator();
while (irplugin.hasNext()) {
PluginUnit pu = (PluginUnit)irplugin.next();
IPluginUI ipu = pu.getUI(request);
IPluginViewListThread pv = ipu.getViewListThread(boardcode);
if (pv.IsPluginBoard() && pu.getType().equals(pu.TYPE_TOPIC)) {%>
<a href="<%=addpage%>?pluginCode=<%=pu.getCode()%>&boardcode=<%=StrUtil.UrlEncode(boardcode)%>&privurl=<%=privurl%>"><img src="<%=skinPath + "/" + pu.getButton()%>_<%=SkinUtil.getLocale(request)%>.gif" border="0"></a>
<%}
}
}
%>
<%
Vector vplugin2 = curleaf.getAllPlugin2();
Iterator irplugin2 = vplugin2.iterator();
while (irplugin2.hasNext()) {
com.redmoon.forum.plugin2.Plugin2Unit p2u = (com.redmoon.forum.plugin2.Plugin2Unit)irplugin2.next();
%>
<a href="<%=addpage%>?plugin2Code=<%=p2u.getCode()%>&boardcode=<%=StrUtil.UrlEncode(boardcode)%>&privurl=<%=privurl%>"><img src="<%=skinPath + "/images/" + p2u.getButton()%>_<%=SkinUtil.getLocale(request)%>.gif" border="0"></a>
<%}%>
</TD>
<TD width="34%" align="right">
<a href="listtopic.jsp?op=showelite&boardcode=<%=boardcode%>">
<lt:Label res="res.label.forum.listtopic" key="elite"/></a>
<SELECT onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"
name=select2>
<OPTION selected><lt:Label res="res.label.forum.listtopic" key="manager"/></OPTION>
<OPTION>-------</OPTION>
<%
String username = privilege.getUser(request);
// 置用户所在版块
if (username!=null && !username.equals("")) {
OnlineUserDb ou = new OnlineUserDb();
ou = ou.getOnlineUserDb(username);
ou.setUserInBoard(boardcode);
}
MsgMgr mm = new MsgMgr();
Vector managers = mm.getBoardManagers(boardcode);
Iterator irmgr = managers.iterator();
boolean isUserBoardManager = false;
while (irmgr.hasNext()) {
UserDb user = (UserDb) irmgr.next();
if (user.getName().equals(username))
isUserBoardManager = true;
%>
<OPTION value="../userinfo.jsp?username=<%=StrUtil.UrlEncode(user.getName())%>"><%=user.getName()%></OPTION>
<%}%>
</SELECT> <SELECT onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value+'&op=<%=op%>';}"
name=seltimelimit>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=all" selected><lt:Label res="res.label.forum.listtopic" key="topic_all"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=1"><lt:Label res="res.label.forum.listtopic" key="topic_one_day"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=2"><lt:Label res="res.label.forum.listtopic" key="topic_two_day"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=7"><lt:Label res="res.label.forum.listtopic" key="topic_week"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=15"><lt:Label res="res.label.forum.listtopic" key="topic_half_month"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=30"><lt:Label res="res.label.forum.listtopic" key="topic_one_month"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=60"><lt:Label res="res.label.forum.listtopic" key="topic_two_month"/></OPTION>
<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=180"><lt:Label res="res.label.forum.listtopic" key="topic_half_year"/></OPTION>
</SELECT>
<script language=javascript>
</script>
<script language=javascript><!--
seltimelimit.value = "listtopic.jsp?boardcode=<%=boardcode%>&timelimit=<%=timelimit%>"
//-->
</script>
<A href="javascript:this.location.reload()" title="<lt:Label res="res.label.forum.listtopic" key="refresh"/>"><IMG src="images/refresh.gif" border=0></A>
<a href="rss.jsp?boardCode=<%=StrUtil.UrlEncode(boardcode)%>"><img src="../images/rss.gif" alt="rss<lt:Label res="res.label.forum.listtopic" key="subscription"/>" width="36" height="14" border="0" align="absmiddle"></a></TD>
</TR>
</TBODY>
</TABLE>
<%
int msgcount = 0;
if (privilege.isUserLogin(request)) {
%>
<jsp:useBean id="Msg" scope="page" class="com.redmoon.forum.message.MessageMgr"/>
<%
msgcount = Msg.getNewMsgCount(request);
%>
<%if (msgcount>0) {%>
<script language=javascript>
openWin("../message/message.jsp",320,260);
</script>
<%
}
}
if (boardcode==null)
{
out.println(StrUtil.makeErrMsg(SkinUtil.LoadString(request, "res.label.forum.listtopic", "need_board")));
return;
}
String sql = SQLBuilder.getListtopicSql(boardcode, op, timelimit);
MsgDb msgdb = new MsgDb();
int total = msgdb.getThreadsCount(sql, boardcode);
int pagesize = 20;
Paginator paginator = new Paginator(request, total, pagesize);
int curpage = paginator.getCPage(request);
int totalpages = paginator.getTotalPages();
if (totalpages==0)
{
curpage = 1;
totalpages = 1;
}
long start = (curpage-1)*pagesize;
long end = curpage*pagesize;
ThreadBlockIterator irmsg = msgdb.getThreads(sql, boardcode, start, end);
%>
<table width="98%" border="0" align="center">
<tr>
<td width="44%" align="left">
<%if (msgcount>0) {%>
<a href="javascript:openWin('../message/message.jsp',320,260)"><font color="#CC0000"><img src="images/brow/17.gif" border="0" align="absmiddle">
<%=msgcount%><lt:Label res="res.label.forum.listtopic" key="new_short_msg"/></font></a>
<%}%></td>
<td width="56%" align="right"><lt:Label res="res.label.forum.listtopic" key="find_record"/> <b><%=paginator.getTotal() %></b> <lt:Label res="res.label.forum.listtopic" key="tiao"/> <lt:Label res="res.label.forum.listtopic" key="per_page"/> <b><%=paginator.getPageSize() %></b>
<lt:Label res="res.label.forum.listtopic" key="tiao"/> <lt:Label res="res.label.forum.listtopic" key="page"/> <b><%=curpage %>/<%=totalpages %></b></td>
</tr>
</table>
<TABLE borderColor=#edeced cellSpacing=0 cellPadding=1 width="98%" align=center border=1 class="list">
<TBODY>
<TR height=25>
<TD height="26" colSpan=3 align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title">
<lt:Label res="res.label.forum.listtopic" key="topis_list"/></TD>
<TD width=91 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="author"/></TD>
<TD width=55 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="reply"/></TD>
<TD width=55 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="hit"/></TD>
<TD width=80 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="list_title_date"><lt:Label res="res.label.forum.listtopic" key="reply_date"/></TD>
</TR>
</TBODY>
</TABLE>
<%
String id="",topic = "",name="",lydate="",rename="",redate="";
int level=0,iselite=0,islocked=0,expression=0;
int i = 0,recount=0,hit=0,type=0;
// 取出论坛置顶的贴子
ForumDb forum = new ForumDb();
long[] topmsgs = forum.getTopMsgs();
int tlen = topmsgs.length;
while (i<tlen) {
msgdb = msgdb.getMsgDb((int)topmsgs[i]);
i++;
id = ""+msgdb.getId();
topic = StrUtil.toHtml(msgdb.getTitle());
name = msgdb.getName();
lydate = com.redmoon.forum.ForumSkin.formatDateTime(request, msgdb.getAddDate());
recount = msgdb.getRecount();
hit = msgdb.getHit();
expression = msgdb.getExpression();
type = msgdb.getType();
iselite = msgdb.getIsElite();
islocked = msgdb.getIsLocked();
level = msgdb.getLevel();
rename = StrUtil.getNullString(msgdb.getRename());
redate = com.redmoon.forum.ForumSkin.formatDateTime(request, msgdb.getRedate());
%>
<table class="list" bordercolor="<%=skin.getTableBorderClr()%>" cellspacing=0 cellpadding=1 width="98%" align=center border=1>
<tbody>
<tr>
<td noWrap align=middle width=30 bgcolor=#f8f8f8>
<%if (recount>20){ %>
<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_hot"/>" src="<%=skinPath%>/images/f_hot.gif">
<%}
else if (recount>0) {%>
<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_reply"/>" src="<%=skinPath%>/images/f_new.gif">
<%}
else {%>
<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_no_reply"/>" src="<%=skinPath%>/images/f_norm.gif">
<%}%> </td>
<td class="list_td_emote" align=middle width=17 bgcolor=#ffffff> <% String urlboardname = StrUtil.UrlEncode(boardname,"utf-8"); %> <a href="showtopictree.jsp?rootid=<%=id%>" target=_blank>
<%
if (islocked==1) { %>
<IMG height=15 alt="" src="<%=skinPath%>/images/f_locked.gif" width=17 border=0>
<% }
else {
if (type==1) { %>
<IMG height=15 alt="" src="<%=skinPath%>/images/f_poll.gif" width=17 border=0>
<%}else { %>
<img src="images/brow/<%=expression%>.gif" border=0>
<%}
} %>
</a></td>
<td onMouseOver="this.style.backgroundColor='#ffffff'"
onMouseOut="this.style.backgroundColor=''" align=left bgcolor=#f8f8f8><%
if (recount==0) {
%>
<img id=followImg<%=id%> title="<lt:Label res="res.label.forum.listtopic" key="extend_reply"/>" src="<%=skinPath%>/images/minus.gif" loaded="no">
<% }else { %>
<img id=followImg<%=id%> title=<lt:Label res="res.label.forum.listtopic" key="extend_reply"/> style="CURSOR: hand"
onClick="loadThreadFollow(<%=id%>,<%=id%>,'&boardcode=<%=boardcode%>&hit=<%=hit+1%>&boardname=<%=urlboardname%>')" src="<%=skinPath%>/images/plus.gif" loaded="no">
<% } %>
<strong><lt:Label res="res.label.forum.listtopic" key="top"/></strong>
<!--<a href="showtopictree.jsp?rootid=<%=id%>">(树形)<%=topic%></a>-->
<%
String attIcon = MsgUtil.getIconImg(msgdb);
if (!attIcon.equals("")) {
out.print("<img src='../images/fileicon/" + attIcon + "'>");
}
%>
<a href="showtopic.jsp?rootid=<%=id%>">
<%
String color = StrUtil.getNullString(msgdb.getColor());
String tp = topic;
if (!color.equals(""))
tp = "<font color='" + color + "'>" + tp + "</font>";
if (msgdb.isBold())
tp = "<B>" + tp + "</B>";
%>
<%=tp%> </a>
<%if (iselite==1) { %>
<IMG src="images/topicgood.gif">
<%}%>
<%
//计算共有多少页回贴
int allpages = Math.round((float)recount/10+0.5f);
if (allpages>1)
{
int pg = allpages;
if (allpages>10)
pg = 10;
out.print("[");
for (int m=1; m<=pg; m++)
{%>
<a href="showtopic.jsp?rootid=<%=id%>&CPages=<%=m%>"><%=m%></a>
<%}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -