📄 topic.jsp
字号:
<%
/*##################################################################**
**# 程序名称:LyBBS『凌云论坛』 #**
**# #**
**# 程序开发: teddy 『星语凌』 #**
**# #**
**# 版权所有: 凌云创作室 (原流星电脑工作室) #**
**# #**
**# 主页地址: http://www.lybbs.net #**
**# 电邮地件: horseye@sina.com #**
**# #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=GBK" %>
<%
int forumID=0,
topic=0,
isAdmin=0;
String replyNum="";
boolean isAuthor=false;
ParameterUtils.setCharacterEncoding(request);
forumID=ParameterUtils.getInt(request,"forumID");
topic=ParameterUtils.getInt(request,"topic");
replyNum=ParameterUtils.getString(request,"replynum");
if(forumID==0 || topic==0)
response.sendRedirect("errorPage.jsp");
%>
<%@ include file="include/boardprepare.jsp"%>
<%
//取forumstyle
forumStyle.getForumStyle();
int maxTopics=forumStyle.getMaxTopics();
String arrowUserDel=forumStyle.getArrowUserDel();
String boardDispSign=forumStyle.getBoardDispSign();//默认是否显示用户签名
String pvtIP=forumStyle.getPvtIP();//是否保密IP
String dispQuickReply=forumStyle.getDispQuickReply();
forumStatus.getTopicConfig();
String sticky=forumStatus.getSticky(),
emotIcons=forumStatus.getEmotIcons();//是否允许表情符转换
ForumTopicFactory forumTopicFactory=new ForumTopicFactory();
forumTopicFactory.setForumID(forumID);
forumTopicFactory.setTopic(topic);
forumTopicFactory.getOtherTopic();
int nextTopic=forumTopicFactory.getNextTopic(),
previousTopic=forumTopicFactory.getPreviousTopic();
forumTopicFactory.setClickTimes();
forumTopicFactory.getTopicInfo();
int clickTimes=forumTopicFactory.getClickTimes();
String postTitle=forumTopicFactory.getPostTitle(),
postTitleLock=forumTopicFactory.getPostTitleLock();
Forum forum=(new ForumFactory()).getForum(forumID);
String forumName=forum.getForumName(),
htmlStat=forum.getHtmlStat(),//是否允许html语言
lyCodeStat=forum.getLyCodeStat(),//是否允许凌云标签
privateForum=forum.getPrivateForum();
int maxUpload=forumStyle.getMaxUpload();//最大上传文件大小
String allowAttachment=forumStyle.getAllowAttachment(),//回复是否允许上传
arrawPostFlash=forumStyle.getArrawPostPic(),//帖子中是否允许Flash
arrawPostFontSize=forumStyle.getArrawPostFontSize(),//帖子中是否允许改变字体大小
arrawPostMedia=forumStyle.getArrawPostPic(),//帖子中是否允许mp/rm/qt
arrawPostPic=forumStyle.getArrawPostPic(),//帖子中是否允许贴图
arrawPostSound=forumStyle.getArrawPostPic(),//帖子中是否允许背景声音
arrawSignFlash=forumStyle.getArrawSignPic(),//签名中是否允许Flash
arrawSignFontSize=forumStyle.getArrawSignFontSize(),//签名中是否允许改变字体
arrawSignMedia=forumStyle.getArrawSignPic(),//签名中是否允许mp/rm/qt
arrawSignPic=forumStyle.getArrawSignPic(),//签名中是否允许贴图
arrawSignSound=forumStyle.getArrawSignPic();//签名中是否允许背景声音
if(cookieMode.compareTo("5")>0)
isAdmin=1;
else if(!cookieMode.equals("0"))
isAdmin=(new Admin()).getIsAdmin(forumID,Integer.parseInt(cookieID));
if(privateForum.equals("1") && isAdmin==0 && user.getAllowPrivate(forumID).equals("0"))
response.sendRedirect("forum.jsp?forumID="+forumID);
//分页变量定义
int e=20; //'每页显示的记录数
int totalpage=0; //'页面总数
int pages=1; //'显示的当前页面
int count=0; //'库中数据的总记录数
int from=0,to=0; //'从from篇到to篇
int p=0; //'数据库查询从p开始
if(maxTopics!=0)
e=maxTopics;
//取页数
pages=ParameterUtils.getInt(request,"pages");
//分页预备
count=forumTopicFactory.getTopicNumber();
totalpage=((count%e==0)?(count/e):(count/e+1));
if(totalpage==0) totalpage=1;
if(pages>totalpage || replyNum.equals("last")) pages=totalpage;
else if(pages<1) pages=1;
if(count!=0)
from=(pages-1)*e+1;
if(totalpage==pages)
to=count;
else if(count!=0)
to=from+e-1;
p= (pages-1)*e;
//更新用户目前的位置
User.setUserPosition(Integer.parseInt(cookieID),forumID);
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<script language="JavaScript">
function menu(){
var URL = document.jump.jumpto.options[document.jump.jumpto.selectedIndex].value;
location.href = URL; target = '_self';
}
function changePages(){
var URL = document.changepages.pages.options[document.changepages.pages.selectedIndex].value;
location.href = URL; target = '_self';
}
</script>
<body <%=lbbody%>>
<%@ include file="include/userheader.jsp"%>
<br>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> align=center>
<tr>
<td width=30% rowspan=2 valign=top>
<img src="images/<%=boardlogo%>" border=0>
</td>
<td valign=top align=left>
<font face="宋体" color=<%=fontcolormisc%>>
<img src="images/closedfold.gif" border=0> <a href="index.jsp"><%=boardname%></a><br>
<img src="images/bar.gif" border=0><img src="images/closedfold.gif" border=0> <a href="forum.jsp?forumID=<%=forumID%>"><%=forumName%> [返回]</a><br>
<img src="images/bar.gif" border=0><img src="images/openfold.gif" border=0> <%=postTitle.length()>34?postTitle.substring(0,34)+"…":postTitle%>
</font>
</td>
</tr>
</table>
<br>
<table cellpadding=1 cellspacing=0 width=<%=tablewidth%> align=center>
<tr>
<td align=center width=1></td>
<td width=330 valign=bottom>
<a href=post.jsp?action=new&forumID=<%=forumID%>><img src=images/<%=newThreadLogo%> border=0 alt=发表一个新主题 width=99 height=25></a>
<%
if(postTitleLock.equals("0")) {
%>
<a href=post.jsp?action=reply&forumID=<%=forumID%>&topic=<%=topic%>><img src=images/<%=newReplyLogo%> border=0 alt=回复贴子 width=99 height=25></a>
<%
}
%> <a href=poll.jsp?action=new&forumID=<%=forumID%>><img src=images/<%=newPollLogo%> border=0 alt=开启一个新投票 width=99 height=25></a>
</td>
<td align=right valign=bottom width=* nowarp>
<font color=<%=forumfontcolor%>>您是本帖第 <b><%=clickTimes%></b> 个阅读者</font>
<%
if(previousTopic!=0) {
%>
<a href=topic.jsp?forumID=<%=forumID%>&topic=<%=previousTopic%>><img src=images/prethread.gif border=0 alt=浏览上一篇主题 width=52 height=12></a>
<%
}
%>
<a href="javascript:this.location.reload()"><img src=images/refresh.gif border=0 alt=刷新本主题 width=40 height=12></a>
<%
if(nextTopic!=0) {
%>
<a href=topic.jsp?forumID=<%=forumID%>&topic=<%=nextTopic%>><img src=images/nextthread.gif border=0 alt=浏览下一篇主题 width=52 height=12></a>
<%
}
%>
</td>
<td align=center width=2></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 width=<%=tablewidth%> align=center>
<tr>
<td bgcolor=<%=tablebordercolor%> width=1 height=24></td>
<td bgcolor=<%=titlecolor%> colspan=2>
<table cellpadding=0 cellspacing=1 width=100%>
<tr>
<td bgcolor=<%=titlecolor%>>
<font color=<%=titlefontcolor%>> <b>* 贴子主题</B>:<%=postTitle%></font>
<%
if(postTitleLock.equals("1")) {
%>
<img src=images/closed.gif alt="贴子被锁定,不能回复" height=13>
<%
}
else {
%>
<a href=post.jsp?action=reply&forumID=<%=forumID%>&topic=<%=topic%>><img src=images/replytothread.gif border=0 alt=回复贴子 height=13 align=absmiddle></a>
<%
}
%>
</td>
<td bgcolor=<%=titlecolor%> align=right>
<!--a href=# onclick="javascript:WebBrowser.ExecWB(4,1)"><img src=images/saveas.gif border=0 width=16 height=16 alt="保存该页为文件" align=absmiddle></a-->
<a href=#><span style="CURSOR: hand" onClick="window.external.AddFavorite('<%=HttpUtils.getRequestURL(request)%>?forumID=<%=forumID%>&topic=<%=topic%>', ' <%=boardname%> - <%=postTitle%>')"><IMG SRC=images/fav_add1.gif BORDER=0 width=15 height=15 alt=把本贴加入IE收藏夹></span></a>
</td>
</tr>
</table>
</td>
<td bgcolor=<%=tablebordercolor%> width=1 height=24></td>
</tr>
</table>
<%
/*
int allTopicNumber=count,
allReplyNumber=count-1;
*/
String postVote="0";
ArrayList forumTopicVector=forumTopicFactory.getForumTopicFactory(forumID,topic,sticky,p,e);
for(int i=0;i<forumTopicVector.size();i++) {
ForumTopic forumTopic=(ForumTopic)forumTopicVector.get(i);
int postID=forumTopic.getPostID(),
postAuthorID=forumTopic.getPostAuthorID(),
postParentID=forumTopic.getPostParentID(),
markPost=forumTopic.getMarkPost(),
moneyPost=forumTopic.getMoneyPost();
String postContent=forumTopic.getPostContent(),
postAt=forumTopic.getPostAt(),
postAuthor=forumTopic.getPostAuthor(),
postTitleImage=forumTopic.getPostTitleImage(),
accessary=forumTopic.getAccessary(),
markHidden=forumTopic.getMarkHidden(),
moneyHidden=forumTopic.getMoneyHidden(),
postIP=forumTopic.getPostIP();
postVote=forumTopic.getPostVote();
int allowShowHiddenNumber=0,
allBuyNumber=0,
cookieMark=0;
if(moneyHidden.equals("1") && !cookieMode.equals("0")) {
forumTopicFactory.getMoneyHiddenInfo(postID,Integer.parseInt(cookieID));
allowShowHiddenNumber=forumTopicFactory.getAllowShowHiddenNumber();
allBuyNumber=forumTopicFactory.getAllBuyNumber();
}
else if(markHidden.equals("1") && !cookieMode.equals("0"))
cookieMark=user.getCookieMark();
if(!postAuthor.equals("") && !postAuthor.equals("客人") && postAuthor.equals(cookieName))
isAuthor=true;
else
isAuthor=false;
int authorMark=0,
authorGrade=0,
authorCharm=0,
authorExperience=0,
authorMoney=0,
authorMode=0,
userImageWidth=0,
userImageHeight=0,
authorPostNumber=0,
authorCharmLength=0,
authorExperienceLength=0;
String authorEmail="",
authorHomePage="",
authorQQ="",
authorIcq="",
authorOnline="0",
authorTitle="",
authorPart="",
authorRegisterTime="0000-00-00",
authorAstro="",
authorSignature="",
authorAvatar="",
authorSex="",
userImageURL="",
authorGradeTitle="",
authorGradeGraphic="",
coinName="凌云点",
tempbgcolor="",
authorStatus="",
notShowSignature="";
if(!postAuthor.equals("")) {
try {
user.setUserName(postAuthor);
user.getUserStats();
authorMark=user.getUserMark();
authorGrade=user.getUserGrade();
authorCharm=user.getUserCharm();
authorExperience=user.getUserExperience();
authorMoney=user.getUserMoney();
authorMode=user.getAuthorMode();
userImageWidth=user.getUserImageWidth();
userImageHeight=user.getUserImageHeight();
authorEmail=user.getEmail();
authorHomePage=user.getHomePage();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -