📄 topic.jsp
字号:
<%
/*##################################################################**
**# LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2 #**
**# #**
**# 版权所有: 凌云工作室 (原流星电脑工作室) #**
**# #**
**# 制作人 : 星语凌 『teddy (Yongshan Ye)』 #**
**# #**
**# 主页地址: http://www.unix-now.com/lybbs 凌云论坛主页 #**
**# http://www.ierp.info/lybbs 凌云论坛镜像站 #**
**# http://horseye@sina.com/ 凌云论坛支持信箱 #**
**# #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
String tempSTR="",action="";
//boardprepare变量定义
int db=0,styleid=0,number=0,id=0,membergone=0,authornumber=0,postsnumber=0,replynumber=0,announcementid=0;
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
String dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="",onlineview="";
String cookiename="",cookieid="",cookiemode="";
//本页变量定义
int authormode=0,postid=0,postparentid=0,topic=0,nexttopic=0,previoustopic=0,postclicktimes=0,postauthorid=0,authormark=0,authorgrade=0,authorcharm=0,authorexperience=0,authormoney=0,authorcharmlength=0,authorexperiencelength=0,authorpostnumber=0,userimagewidth=0,userimageheight=0;
String posttitle="",postcontent="",posttitlelock="0",postauthor="",postat="",postvote="",posttitleimage="";
String authoremail="",authorhomepage="",authorqq="",authoricq="",authoronline="0",authortitle="",authorpart="",authorregistertime="",authorastro="",authorgradename="",authorgradegraphic="",coinname="",authorsignature="",authorimage="",authorsex="",userimageurl="";
int votenumber=0,voteid=0,voteid2=0,allvotenumber=0,votelength=0;
String votetitle="",votename="",dispquickreply="",sticky="",query="";
ResultSet rs2,rs3;
int tempbgcolorid=0,alltopicnumber=0,allreplynumber=0,isadmin=0,orderby=0;
String tempbgcolor="";
//虽然是temp,但却有用,不可删
boolean isauthor=false,canvote=false;
String replynum="";
%>
<%
tempSTR=request.getParameter("db");
if(tempSTR!=null && !tempSTR.equals(""))
db=Integer.parseInt(tempSTR);
tempSTR=request.getParameter("topic");
if(tempSTR!=null && !tempSTR.equals(""))
topic=Integer.parseInt(tempSTR);
if(db==0 || topic==0)
response.sendRedirect("errorPage.jsp");
tempSTR=request.getParameter("replynum");
if(tempSTR!=null && !tempSTR.equals(""))
replynum=tempSTR;
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%@ include file="include/dbstyle.jsp"%>
<%@ include file="include/icon.jsp"%>
<%
rs=connect.executeQuery("select dispquickreply from style where adminselected='1'");
if(rs.next())
dispquickreply=rs.getString(1);
rs=connect.executeQuery("select sticky from config where id=1");
if(rs.next())
sticky=rs.getString(1);
rs=connect.executeQuery("select orderby from posts where db="+db+" and groupid="+topic+" and parentid=0");
if(rs.next())
orderby=rs.getInt(1);
rs=connect.executeQuery("select groupid from posts where db="+db+" and orderby>"+orderby+" order by orderby limit 1");
if(rs.next())
nexttopic=rs.getInt(1);
rs=connect.executeQuery("select groupid from posts where db="+db+" and orderby<"+orderby+" order by orderby desc limit 1");
if(rs.next())
previoustopic=rs.getInt(1);
connect.executeUpdate("update posts set clicktimes=clicktimes+1 where groupid="+topic+" and db="+db+" and parentid=0");
rs=connect.executeQuery("select clicktimes,title,titlelock from posts where groupid="+topic+" and db="+db+" and parentid=0");
if(rs.next()) {
postclicktimes=rs.getInt(1);
posttitle=rs.getString(2);
posttitlelock=rs.getString(3);
}
if(cookiemode.equals("4"))
isadmin=1;
else
isadmin=connect.getRowNum("admin where db="+db+" and authorid="+cookieid);
//分页变量定义
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;
//取页数
tempSTR=request.getParameter("pages");
if(tempSTR!=null && !tempSTR.equals(""))
pages=Integer.parseInt(tempSTR);
//分页预备
count=connect.getRowNum("posts where db="+db+" and groupid="+topic);
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;
%>
<!--//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>
<%
String vicedbname="",viceposttitle="";
rs=connect.executeQuery("select dbname from db where id="+db);
if(rs.next())
vicedbname=rs.getString(1);
rs=connect.executeQuery("select title from posts where db="+db+" and groupid="+topic+" and parentid=0");
if(rs.next())
viceposttitle=rs.getString(1);
if(viceposttitle.length()>28)
viceposttitle=viceposttitle.substring(0,28)+"…";
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> align=center>
<tr>
<td width=30% rowspan=2 valign=top>
<%@ include file="include/viceadbanner.jsp"%>
</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="db.jsp?db=<%=db%>"><%=vicedbname%> [返回]</a><br>
<img src="images/bar.gif" border=0><img src="images/openfold.gif" border=0> <%=viceposttitle%>
</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&db=<%=db%>><img src=images/<%=newthreadlogo%> border=0 alt=发表一个新主题 width=99 height=25></a>
<%
if(posttitlelock.equals("0")) {
%>
<a href=post.jsp?action=reply&db=<%=db%>&topic=<%=topic%>><img src=images/<%=newreplylogo%> border=0 alt=回复贴子 width=99 height=25></a>
<%
}
%> <a href=poll.jsp?action=new&db=<%=db%>><img src=images/<%=newpolllogo%> border=0 alt=开启一个新投票 width=99 height=25></a>
</td>
<td align=right valign=bottom width=* nowarp>
<font color=<%=forumfontcolor%>>您是本帖第 <b><%=postclicktimes%></b> 个阅读者</font>
<%
if(previoustopic!=0) {
%>
<a href=topic.jsp?db=<%=db%>&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>
<a href=topic.jsp?db=<%=db%>&topic=<%=topic%>&changemode=1><img src=images/treeview.gif width=40 height=12 border=0 alt=树形显示贴子></a>
<%
if(nexttopic!=0) {
%>
<a href=topic.jsp?db=<%=db%>&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&db=<%=db%>&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>
<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<a href=report.jsp?db=<%=db%>&topic=<%=topic%>><img src=images/report.gif border=0 width=16 height=15 alt=本贴有问题,发送短消息报告给版主></a>
<a href=fav.jsp?action=add&db=<%=db%>&topic=<%=topic%>><img src=images/fav.gif border=0 width=13 height=15 alt=加入个人收藏&关注本贴></a>
<a href=printpage.jsp?db=<%=db%>&topic=<%=topic%>><img src=images/printpage.gif border=0 width=16 height=16 alt=显示可打印的版本></a>
<a href="javascript:openScript('pag.jsp?db=<%=db%>&topic=<%=topic%>',500,400)"><img src=images/pag.gif border=0 width=16 height=16 alt=把本贴打包邮递></a>
<a href=#><span style="CURSOR: hand" onClick="window.external.AddFavorite('<%=HttpUtils.getRequestURL(request)%>?db=<%=db%>&topic=<%=topic%>', ' <%=boardname%> - <%=posttitle%>')"><IMG SRC=images/fav_add1.gif BORDER=0 width=15 height=15 alt=把本贴加入IE收藏夹></span></a>
<a href=lyfriend.jsp?db=<%=db%>&topic=<%=topic%>><img src=images/emailtofriend.gif border=0 width=16 height=16 alt=发送本页面给朋友></a>
</td>
</tr>
</table>
</td>
<td bgcolor=<%=tablebordercolor%> width=1 height=24></td>
</tr>
</table>
<%
alltopicnumber=count;
allreplynumber=connect.getRowNum("posts where db="+db+" and parentid!=0 and groupid="+topic);
query="select content,vote,date_format(postat,'%Y年%m月%d日 %H:%i') as postat,authorid,author,titleimage,id,titlelock,parentid from posts where groupid="+topic+" and db="+db+" order by parentid,postat";
if(sticky.equals("0"))
query+=" desc";
query+=" limit "+p+","+e;
rs=connect.executeQuery(query);
while(rs.next()) {
postcontent=rs.getString(1);
postvote=rs.getString(2);
postat=rs.getString(3);
postauthorid=rs.getInt(4);
postauthor=rs.getString(5);
posttitleimage=rs.getString(6);
postid=rs.getInt(7);
posttitlelock=rs.getString(8);
postparentid=rs.getInt(9);
if(!postauthor.equals("") && !postauthor.equals("客人") && postauthor.equals(cookiename))
isauthor=true;
else
isauthor=false;
if(postauthorid!=0) {
rs2=connect.executeQuery2("select mark,grade,charm,experience,money,email,homepage,qq,icq,online,newmembertitle,newsocialpart,usermode,date_format(registertime,'%Y年%m月%d日') as registertime,astro,signature,imagename,sex,imageurl,imagewidth,imageheight from author where id="+postauthorid);
if(rs2.next()) {
authormark=rs2.getInt(1);
authorgrade=rs2.getInt(2);
authorcharm=rs2.getInt(3);
authorexperience=rs2.getInt(4);
authormoney=rs2.getInt(5);
authoremail=rs2.getString(6);
authorhomepage=rs2.getString(7);
authorqq=rs2.getString(8);
authoricq=rs2.getString(9);
authoronline=rs2.getString(10);
authortitle=rs2.getString(11);
authorpart=rs2.getString(12);
authormode=rs2.getInt(13);
authorregistertime=rs2.getString(14);
authorastro=rs2.getString(15);
authorsignature=rs2.getString(16);
authorimage=rs2.getString(17);
authorsex=rs2.getString(18);
userimageurl=rs2.getString(19);
userimagewidth=rs2.getInt(20);
userimageheight=rs2.getInt(21);
}
if(authormode>1)
rs2=connect.executeQuery2("select mname,mgraphic from grade where usermode="+(authormode-1));
else
rs2=connect.executeQuery2("select mname,mgraphic from grade where grade="+authorgrade);
if(rs2.next()) {
authorgradename=rs2.getString(1);
authorgradegraphic=rs2.getString(2);
}
rs2=connect.executeQuery2("select coinname from encourage where id=1");
if(rs2.next())
coinname=rs2.getString(1);
authorpostnumber=connect.getRowNum("posts where authorid="+postauthorid);
authorcharmlength=(authorcharm/12000>1)?120:authorcharm/100;
authorexperiencelength=(authorexperience/12000>1)?120:authorexperience/100;
}
tempbgcolorid++;
if(tempbgcolorid%2==0)
tempbgcolor=postcolorone;
else
tempbgcolor=postcolortwo;
%>
<table cellpadding=0 cellspacing=1 width=<%=tablewidth%> align=center>
<tr>
<td bgcolor=<%=tablebordercolor%> width=1 height=24 rowspan=2></td>
<td bgcolor="<%=tempbgcolor%>" rowspan=2 width=180 valign=top>
<table>
<tr>
<td height=5></td>
</tr>
</table>
<table width=100% cellpadding=4 cellspacing=5 bgcolor=<%=tempbgcolor%>>
<tr>
<td bgcolor=<%=tempbgcolor%> valign=top>
<table cellpadding=0 cellspacing=0>
<tr>
<td width=30>
<%
if(authoronline.equals("1"))
out.println("<IMG SRC=images/online1.gif width=15 height=15 alt=该用户目前在线>");
else
out.println("<IMG SRC=images/offline1.gif width=15 height=15 alt=该用户目前不在线>");
%>
</td>
<td>
<div style="filter:glow(color=<%=memglow%>,direction=135)">
<font color=<%=posternamecolor%>><b><%=postauthor%> </b></font>
</div>
</td>
<td>
<%
if(postauthorid!=0) {
if(authorsex.equals("帅哥"))
out.println("<img src=images/mal.gif width=20 height=14 alt='哦,帅哥哟'>");
else if(authorsex.equals("美女"))
out.println("<img src=images/fem.gif width=20 height=14 alt='哇,美女耶'>");
}
%>
</td>
</tr>
</table>
<%
if(postauthorid==0)
out.println("<font color="+postfontcolortwo+"> -* 未注册 *-</font><br>");
else {
if(!authortitle.equals(""))
out.println("<font color="+postfontcolortwo+">头衔: "+authortitle+"</font>");
if(!authorastro.equals("") && !authorastro.equals("保密")) {
out.print("<IMG height=13 src=star/"+authorastro+".gif width=13 alt=");
if(authorastro.equals("z1"))
authorastro="白羊座";
else if(authorastro.equals("z2"))
authorastro="金牛座";
else if(authorastro.equals("z3"))
authorastro="双子座";
else if(authorastro.equals("z4"))
authorastro="巨蟹座";
else if(authorastro.equals("z5"))
authorastro="狮子座";
else if(authorastro.equals("z6"))
authorastro="处女座";
else if(authorastro.equals("z7"))
authorastro="天秤座";
else if(authorastro.equals("z8"))
authorastro="天蝎座";
else if(authorastro.equals("z9"))
authorastro="射手座";
else if(authorastro.equals("z10"))
authorastro="魔羯座";
else if(authorastro.equals("z11"))
authorastro="水瓶座";
else if(authorastro.equals("z12"))
authorastro="双鱼座";
out.println(authorastro+" align=absmiddle><BR>");
}
if(!authorpart.equals(""))
out.println("<font color="+postfontcolorone+">门派: "+authorpart+"</font><br>");
if(!userimageurl.equals(""))
out.println(" <img src=\""+userimageurl+"\" width="+userimagewidth+" height="+userimageheight+"><br>");
else if(!authorimage.equals(""))
out.println(" <img src=avatars/"+authorimage+"><br>");
if(authorgrade!=0 || authormode>1)
out.println("<img src=images/"+authorgradegraphic+" width=100 height=16><br>");
}
if(postauthorid!=0) {
%>
<font color=<%=postfontcolortwo%>>威望: <%=authormark%></font>
<br><font color=<%=postfontcolorone%>>级别: <a href=lookinfo.jsp?action=style target=_blank><%=authorgradename%></a></font>
<br><font color=<%=postfontcolortwo%>>魅力: <img src=images/bar4.gif width=<%=authorcharmlength%> height=8 alt="<%=authorcharm%>"></font>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -