📄 listtopic.jsp
字号:
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="com.redmoon.forum.err.*"%>
<%@ page import="com.redmoon.forum.person.*"%>
<%@ page import="com.redmoon.forum.ui.*"%>
<%@ page import="org.jdom.*"%>
<%@ page import="java.util.*"%>
<%@ page import="org.jdom.output.*"%>
<%@ page import="org.jdom.input.*"%>
<%@ page import="com.redmoon.forum.*"%>
<%@ page import="com.redmoon.forum.ui.*"%>
<%@ page import="cn.js.fan.db.*"%>
<%@ page import="cn.js.fan.util.*"%>
<%@ page import="cn.js.fan.web.*"%>
<%@ page import="com.redmoon.forum.plugin.*"%>
<%@ page import="com.redmoon.forum.plugin.base.*"%>
<%@ page import="cn.js.fan.security.*"%>
<%@ page import="cn.js.fan.module.pvg.*" %>
<%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
<%@ taglib uri="/WEB-INF/tlds/AdTag.tld" prefix="ad" %>
<jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<%
long pageBeginTime = System.currentTimeMillis();
String boardcode = ParamUtil.get(request, "boardcode");
if (boardcode.equals("")) {
out.print(StrUtil.Alert_Back(cn.js.fan.web.SkinUtil.LoadString(request, "res.label.forum.listtopic", "need_board")));
return;
}
Leaf curleaf = new Leaf();
curleaf = curleaf.getLeaf(boardcode);
if (curleaf==null || !curleaf.isLoaded()) {
out.print(StrUtil.makeErrMsg(cn.js.fan.web.SkinUtil.LoadString(request, "res.label.forum.listtopic", "no_board")));
return;
}
if (!privilege.canUserDo(request, boardcode, "enter_board")) {
response.sendRedirect("../info.jsp?info= " + StrUtil.UrlEncode(SkinUtil.LoadString(request, "pvg_invalid")));
return;
}
try {
privilege.checkCanEnterBoard(request, boardcode);
}
catch (ErrMsgException e) {
response.sendRedirect("../info.jsp?info=" + StrUtil.UrlEncode(e.getMessage()));
// e.printStackTrace();
return;
}
String boardname = curleaf.getName();
String strThreadType = ParamUtil.get(request, "threadType");
int threadType = ThreadTypeDb.THREAD_TYPE_NONE;
if (StrUtil.isNumeric(strThreadType)) {
threadType = Integer.parseInt(strThreadType);
}
UserSession.setBoardCode(request, boardcode);
// 取得皮肤路径
String skincode = curleaf.getSkin();
if (skincode.equals("") || skincode.equals(UserSet.defaultSkin)) {
skincode = UserSet.getSkin(request);
if (skincode==null || skincode.equals(""))
skincode = UserSet.defaultSkin;
}
SkinMgr skm = new SkinMgr();
Skin skin = skm.getSkin(skincode);
String skinPath = skin.getPath();
String op = StrUtil.getNullString(request.getParameter("op"));
//seo
com.redmoon.forum.util.SeoConfig scfg = new com.redmoon.forum.util.SeoConfig();
String seoTitle = scfg.getProperty("seotitle");
String seoKeywords = scfg.getProperty("seokeywords");
String seoDescription = scfg.getProperty("seodescription");
String seoHead = scfg.getProperty("seohead");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE><%=boardname%> - <%=Global.AppName%> <%=seoTitle%></TITLE>
<%=seoHead%>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META name="keywords" content="<%=seoKeywords%>">
<META name="description" content="<%=seoDescription%>">
<style>
<!--
#navDiv {
float:left;
width:100%;
line-height:normal;
}
#navDiv td {
float:left;
background:url("images/tag_l.gif") no-repeat left top;
margin:0;
padding:0 0 0 5px;
text-decoration:none;
height:100%;
}
#navDiv span {
float:left;
display:block;
background:url("images/tag_r.gif") no-repeat right top;
padding:5px 5px 5px 0px;
color:#FFF;
height:100%;
text-align: center;
vertical-align: middle;
}
#navDiv span {float:none;}
#navDiv a {
color:#FFF;
}
#navDiv .td_hover {
background-position:0% -42px;
}
#navDiv .td_hover span {
background-position:100% -42px;
}
#navDiv .header {
background-position:0% -42px;
}
#navDiv .header span {
background-position:100% -42px;
}
-->
</style>
<LINK href="<%=skinPath%>/skin.css" type=text/css rel=stylesheet>
<SCRIPT>
function openWin(url,width,height)
{
var newwin = window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,top=50,left=120,width="+width+",height="+height);
}
function loadonline(boardcode){
var targetImg = eval("document.all.followImg000");
var targetDiv = eval("document.all.followDIV000");
if (targetImg.src.indexOf("nofollow")!=-1){return false;}
if ("object"==typeof(targetImg)){
if (targetDiv.style.display!='block')
{
targetDiv.style.display="block";
targetImg.src="images/minus.gif";
advance.innerText="<lt:Label res="res.label.forum.listtopic" key="close_online"/>";
if (targetImg.loaded=="no")
document.frames["hiddenframe"].location.replace("online.jsp?boardcode="+boardcode);
}
else
{
targetDiv.style.display="none";
targetImg.src="images/plus.gif";
advance.innerText="<lt:Label res="res.label.forum.listtopic" key="show_online"/>"
}
}
}
// 展开帖子
function loadThreadFollow(b_id,t_id,getstr){
var targetImg2 =eval("document.all.followImg" + t_id);
var targetTR2 =eval("document.all.follow" + t_id);
if (targetImg2.src.indexOf("nofollow")!=-1){return false;}
if ("object"==typeof(targetImg2)){
if (targetTR2.style.display!="")
{
targetTR2.style.display="";
targetImg2.src="<%=skinPath%>/images/minus.gif";
if (targetImg2.loaded=="no"){
document.frames["hiddenframe"].location.replace("listtree.jsp?id="+b_id+getstr);
}
}else{
targetTR2.style.display="none";
targetImg2.src="<%=skinPath%>/images/plus.gif";
}
}
}
</SCRIPT>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY leftmargin="0" topMargin=0>
<!--<%=skinPath%><%=skincode%>-->
<%@ include file="inc/header.jsp"%>
<%@ include file="inc/position.jsp"%>
<%@ include file="../inc/inc.jsp"%>
<jsp:useBean id="Topic" scope="page" class="com.redmoon.forum.MsgMgr" />
<jsp:useBean id="userservice" scope="page" class="com.redmoon.forum.person.userservice" />
<ad:AdTag type="<%=AdDb.TYPE_TEXT%>" boardCode="<%=boardcode%>"></ad:AdTag>
<%
String querystring = StrUtil.getNullString(request.getQueryString());
String privurl=request.getRequestURL()+"?"+StrUtil.UrlEncode(querystring,"utf-8");
// 登记访客
try {
privilege.enrolGuest(request,response);
}
catch (UserArrestedException e) {
response.sendRedirect("info.jsp?info=" + StrUtil.UrlEncode(e.getMessage()));
return;
}
// 刷新在位时间
userservice.refreshStayTime(request,response);
String timelimit = request.getParameter("timelimit");
if (timelimit==null)
timelimit = "all";
String brule = StrUtil.getNullString(curleaf.getBoardRule());
if (!brule.equals("")) {%>
<TABLE height=25 cellPadding=3 width="98%" cellSpacing="1" align=center class="tableborder1">
<TBODY>
<TR>
<TD class="tablebody1"><lt:Label res="res.label.forum.listtopic" key="rule"/>
<%=brule%>
</TD>
</TR>
</TBODY>
</TABLE>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="5"></td></tr>
</table>
<%}%>
<%
PluginMgr pm = new PluginMgr();
Vector vplugin = pm.getAllPluginUnitOfBoard(boardcode);
if (vplugin.size()>0) {
Iterator irplugin = vplugin.iterator();
while (irplugin.hasNext()) {
PluginUnit pu = (PluginUnit)irplugin.next();
IPluginUI ipu = pu.getUI(request, response, out);
IPluginViewListThread pv = ipu.getViewListThread(boardcode);
String rule = pv.render(UIListThread.POS_RULE);
if (!rule.equals("") && pv.IsPluginBoard()) {
%>
<TABLE height=25 cellSpacing=1 cellPadding=3 width="98%" align=center class="tableborder1">
<TBODY>
<TR>
<TD class="tablebody1">
<!--plugin rule--><%out.print(pu.getName(request) + ": " + rule + "<BR>");%>
</TD>
</TR>
</TBODY>
</TABLE>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="5"></td></tr>
</table>
<% }
}
}%>
<%
com.redmoon.forum.person.UserMgr um = new com.redmoon.forum.person.UserMgr();
if (curleaf.getChildCount()>0) {
if (curleaf.getDisplayStyle()==Leaf.DISPLAY_STYLE_VERTICAL) {
%>
<br>
<table bordercolor="<%=skin.getTableBorderClr()%>" cellspacing=0 cellpadding=0 width="98%" align=center border=1 class="table_normal">
<tbody>
<tr align="left">
<td height="26" colspan="4" nowrap background="<%=skinPath%>/images/bg1.gif"><span class="text_title"> <%=boardname%> </span></td>
</tr>
<%
PluginMgr pmnote = new PluginMgr();
MsgDb md = new MsgDb();
LeafChildrenCacheMgr lccm = new LeafChildrenCacheMgr(boardcode);
java.util.Vector v3 = lccm.getChildren();
Iterator ir3 = v3.iterator();
while (ir3.hasNext()) {
Leaf lf = (Leaf) ir3.next();
md = md.getMsgDb(lf.getAddId());
%>
<tr>
<td width="49" align="center"><%if (lf.isLocked()) {%>
<img alt="<lt:Label res="res.label.forum.index" key="board_lock"/>" src="<%=skinPath%>/images/board_lock.gif">
<%}else{%>
<%if (lf.getTodayCount()>0) {%>
<img alt="<lt:Label res="res.label.forum.index" key="board_new"/>" src="<%=skinPath%>/images/board_new.gif">
<%}else{%>
<img alt="<lt:Label res="res.label.forum.index" key="board_nonew"/>" src="<%=skinPath%>/images/board_nonew.gif">
<%}%>
<%}%></td>
<td><table width="100%" height="65" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="47%" height="23">『 <a href="<%=ForumPage.getListTopicPage(request, lf.getCode())%>"><%=lf.getName()%></a> 』
<%
Vector vplugin1 = pmnote.getAllPluginUnitOfBoard(lf.getCode());
if (vplugin1.size()>0) {
out.print("<font color=#aaaaaa>");
Iterator irpluginnote = vplugin1.iterator();
while (irpluginnote.hasNext()) {
PluginUnit pu = (PluginUnit)irpluginnote.next();
out.print(pu.getName(request) + " ");
}
out.print("</font>");
}
%>
</td>
<td width="23%" rowspan="2" align="right" valign="middle"><%
String logo = StrUtil.getNullString(lf.getLogo());
if (!logo.equals("")) {
%>
<img src="images/board_logo/<%=logo%>" align="absmiddle">
<%}%>
</td>
<td width="30%" rowspan="2"><table width="100%" border="0" cellpadding="0" >
<tr>
<td><lt:Label res="res.label.forum.listtopic" key="topic"/><a href="<%=ForumPage.getShowTopicPage(request, md.getRootid())%>"><%=md.getMsgDb(md.getRootid()).getTitle()%></a></td>
</tr>
<tr>
<td><lt:Label res="res.label.forum.listtopic" key="post"/>
<%if (md.isLoaded()) {%>
<a href="../userinfo.jsp?username=<%=StrUtil.UrlEncode(md.getName())%>"><%=um.getUser(md.getName()).getNick()%></a>
<%}%>
</td>
</tr>
<tr>
<td><lt:Label res="res.label.forum.listtopic" key="date"/><%=DateUtil.format(md.getAddDate(), "yy-MM-dd HH:mm")%> <img src="images/lastpost.gif" width="11" height="10"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/readme.gif" width="10" height="10"> <%=lf.getDescription()%> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -