📄 db.jsp
字号:
<td bgcolor=<%=titlecolor%> align=center width=80 background=images/4.gif><font color=<%=titlefontcolor%>><b>作 者</b></td>
<td bgcolor=<%=titlecolor%> align=center width=32 background=images/4.gif><font color=<%=titlefontcolor%>><b>回复</b></td>
<td bgcolor=<%=titlecolor%> align=center width=32 background=images/4.gif><font color=<%=titlefontcolor%>><b>点击</b></td>
<td bgcolor=<%=titlecolor%> width=195 align=center background=images/4.gif><font color=<%=titlefontcolor%>><b> 最后更新 | 最后回复人</b></td>
</tr>
</table>
<%
alltopicnumber=count;
allreplynumber=connect.getRowNum("posts where db="+db+" and parentid!=0");
rs=connect.executeQuery("select id,groupid,authorid,author,title,clicktimes,date_format(postat,'%Y年%m月%d日 %H:%i') as postat,vote,left(content,44),titleimage,top,titlelock,(UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(postat)) as postintervalnow,length(content) from posts where db="+db+" and parentid=0 order by top desc,orderby desc,id desc limit "+p+","+e);
while(rs.next()) {
postid=rs.getInt(1);
posttopic=rs.getInt(2);
postauthorid=rs.getInt(3);
postauthor=rs.getString(4);
posttitle=rs.getString(5);
if(posttitle.length()>22)
posttitle=posttitle.substring(0,22)+"…";
postclick=rs.getInt(6);
postat=rs.getString(7);
lastpostat=postat;
postisvote=rs.getString(8);
lastpostclue=rs.getString(9);
posttitleicon=rs.getString(10);
if(posttitleicon.equals(""))
posttitleicon="mood31.gif";
posttop=rs.getString(11);
postlock=rs.getString(12);
postintervalnow=rs.getInt(13)/3600;
lastpostlength=rs.getInt(14);
if(lastpostlength==0) {
lastpostclue="(无内容)";
posttitle+="(无内容)";
}
else if(lastpostclue.length()>20)
lastpostclue=lastpostclue.substring(0,20)+"…";
if(!postauthor.equals("") && !postauthor.equals("客人") && postauthor.equals(cookiename))
isauthor=true;
else
isauthor=false;
if(postisvote.equals("0")) {
posticon="topicnonew.gif";
postreply=connect.getRowNum("posts where db="+db+" and groupid="+posttopic+" and parentid!=0");
if(postreply>0) {
//是否有新帖
if(!cookiemode.equals("1")) {
posthavenewnumber=connect.getRowNum("posts where groupid="+posttopic+" and postat>'"+activetime+"'");
if(posthavenewnumber!=0)
posticon="topicnew0.gif";
}
//是否升级为热门帖
if(postreply>=hottopicmark) {
connect.executeUpdate("update posts set hotpost='1' where id="+postid);
if(posthavenewnumber>0)
posticon="topichot0.gif";
else
posticon="topichotnonew.gif";
}
if(posttop.equals("1"))
posticon="locktop.gif";
else if(postlock.equals("1"))
posticon="topiclocked0.gif";
rs2=connect.executeQuery2("select max(id) from posts where db="+db+" and groupid="+posttopic+" and parentid!=0");
if(rs2.next()) {
lastpostid=rs2.getInt(1);
}
if(lastpostid!=0) {
rs2=connect.executeQuery2("select authorid,author,date_format(postat,'%Y年%m月%d日 %H:%i') as postat,left(content,44),length(content),titleimage from posts where id="+lastpostid);
if(rs2.next()) {
lastpostauthorid=rs2.getInt(1);
lastpostauthor=rs2.getString(2);
lastpostat=rs2.getString(3);
lastpostclue=rs2.getString(4);
lastpostlength=rs2.getInt(5);
lastposttitleicon=rs2.getString(6);
if(lastpostlength==0)
lastpostclue="(无内容)";
else if(lastpostclue.length()>20)
lastpostclue=lastpostclue.substring(0,20)+"…";
}
}
}
}
else {
postreply=connect.getRowNum("posts where db="+db+" and groupid="+posttopic+" and parentid!=0");
if(postreply>0) {
rs2=connect.executeQuery2("select max(id) from posts where db="+db+" and groupid="+posttopic+" and parentid!=0");
if(rs2.next()) {
lastpostid=rs2.getInt(1);
}
if(lastpostid!=0) {
rs2=connect.executeQuery2("select authorid,author,date_format(postat,'%Y年%m月%d日 %H:%i') as postat,left(content,44),length(content),titleimage from posts where id="+lastpostid);
if(rs2.next()) {
lastpostauthorid=rs2.getInt(1);
lastpostauthor=rs2.getString(2);
lastpostat=rs2.getString(3);
lastpostclue=rs2.getString(4);
lastpostlength=rs2.getInt(5);
lastposttitleicon=rs2.getString(6);
if(lastpostlength==0)
lastpostclue="(无内容)";
else if(lastpostclue.length()>20)
lastpostclue=lastpostclue.substring(0,20)+"…";
}
}
}
rs2=connect.executeQuery2("select sum(votenumber) from vote where postsid="+postid);
if(rs2.next())
votenumber=rs2.getInt(1);
posticon="closedb.gif";
//是否升级到热门投票帖
if(votenumber>=hotpollmark) {
connect.executeUpdate("update posts set hotpost='1' where id="+postid);
posticon="closedbhot.gif";
}
if(posttop.equals("1"))
posticon="locktop.gif";
else if(postlock.equals("1"))
posticon="closedb1.gif";
}
%>
<table cellspacing=0 width=<%=tablewidth%> bordercolor=<%=tablebordercolor%> border=1 align=center>
<tr>
<td align=center width=30 bgcolor=<%=forumcolorone%>>
<img src=images/<%=posticon%> width=14 border=0>
</td>
<td width=* class=dp bgColor=<%=forumcolortwo%> onmouseover="this.bgColor='<%=forumcolorone%>';" onmouseout="this.bgColor='<%=forumcolortwo%>';">
<img src=posticons/<%if(sortposticonshow.equals("1") && !lastposttitleicon.equals("")) out.print(lastposttitleicon);else out.print(posttitleicon);%> width=15 height=15 border=0 align=absmiddle>
<span id=forum><a href=topic.jsp?db=<%=db%>&topic=<%=posttopic%> TITLE="最后回复摘要:
<%=lastpostclue%>"><%=posttitle%></a>
<%
if(newmarktime>0) {
if(postintervalnow<newmarktime)
out.println("<img src=images/"+new_blogo+" absmiddle>");
}
else if(postintervalnow<24)
out.println("<img src=images/"+new_blogo+" absmiddle>");
if(isadmin!=0) {
%>
<DIV ALIGN=Right><font color=<%=titlecolor%>><%if(postisvote.equals("0")) {%>|<a href=postings.jsp?action=jinghua&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>精华</font></a><%}%>|<a href=postings.jsp?action=locktop&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>固顶</font></a>|<a href=postings.jsp?action=unlocktop&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>消顶</font></a>|<a href=postings.jsp?action=puttop&db=<%=db%>&topic=<%=posttopic%>&checked=yes><font color=<%=titlecolor%>>提前</font></a>|<a href=postings.jsp?action=lock&db=<%=db%>&topic=<%=posttopic%>&checked=yes><font color=<%=titlecolor%>>锁定</font></a>|<a href=postings.jsp?action=unlock&db=<%=db%>&topic=<%=posttopic%>&checked=yes><font color=<%=titlecolor%>>解锁</font></a>|<a href=postings.jsp?action=delete&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>删除</font></a><%if(postisvote.equals("0")) {%>|<a href=postings.jsp?action=movetopic&db=<%=db%>&topic=<%=posttopic%>&checked=yes><font color=<%=titlecolor%>>移动</font></a><%}%>|</font> </DIV>
<%
}
else if(isauthor && arrowuserdel.equals("1")) {
%>
<DIV ALIGN=Right><font color=<%=titlecolor%>>| <a href=postings.jsp?action=lock&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>锁定此贴</font></a> | <a href=postings.jsp?action=unlock&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>解锁此贴</font></a> | <a href=postings.jsp?action=delete&db=<%=db%>&topic=<%=posttopic%>><font color=<%=titlecolor%>>删除此贴</font></a> |</font> </DIV>
<%
}
%>
</span>
</td>
<td align=center width=78 bgcolor=<%=forumcolorone%> title="发布时间: <%=postat%>">
<a href=javascript:O9('<%=postauthorid%>')><%=postauthor%></a>
</td>
<%
if(postisvote.equals("0")) {
%>
<td bgcolor=<%=forumcolortwo%> align=center width=30><%=postreply%></td>
<td bgcolor=<%=forumcolortwo%> align=center width=30><%=postclick%></td>
<%
}
else {
out.println("<td bgcolor="+forumcolortwo+" align=center width=63 rowspan=2>共"+votenumber+"票</td>");
}
%>
<td width=193 bgcolor=<%=forumcolorone%>>
<%=lastpostat%>
<font color=<%=fonthighlight%>> | </font><%if(postreply==0) out.println("--------");else out.println("<a href=javascript:O9('"+lastpostauthorid+"')>"+lastpostauthor+"</a>");%>
</td>
</tr>
</table>
<%
}
//rs2.close();
%>
<%@ include file="include/forumskip.jsp"%>
<br>
<%
if(dispview.equals("1")) {
%>
<%@ include file="include/boardicon.jsp"%>
<%
}
%>
<br>
<%@ include file="include/foot.jsp"%>
<%
rs.close();
connect.close();
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -