📄 boardskin0.asp
字号:
<%
sub AnnounceList0()
'on error resume next
sql="select AnnounceID from bbs1 where boardID="&cstr(boardID)&" and parentID=0 "&tl&" ORDER BY announceid desc"
rs.open sql,conn,1,1
if err.number<>0 then
foundErr = true
ErrMsg = "<li>数据库操作失败:" & err.description & "</li>"
else
if rs.bof and rs.eof then
'论坛无内容
call showEmptyBoard0()
bBoardEmpty = true
else
totalrec=RS.RecordCount
if RS.RecordCount mod MaxAnnouncePerPage =0 then
n=RS.RecordCount\MaxAnnouncePerPage
else
n=RS.RecordCount\MaxAnnouncePerPage+1
end if
RS.PageSize=MaxAnnouncePerPage
currentpage = Request("page")
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage<1 then
currentpage = 1
end if
if err.number<>0 then
err.clear
currentpage=1
end if
else
currentpage = 1
End if
if currentpage*MaxAnnouncePerPage>totalrec and not((currentpage-1)*MaxAnnouncePerPage<totalrec)then currentPage=1
Rs.AbsolutePage = currentpage
announceIDRange1=rs("AnnounceID")
rs.move MaxAnnouncePerPage-1
if rs.EOF then rs.movelast
announceIDRange2=rs("AnnounceID")
end if
rs.close
end if
if err.number<>0 then err.clear
end sub
REM 显示贴子列表
sub showPageList0()
on error resume next
sql="select AnnounceID,parentID,boardID,UserName,Topic,DateAndTime,hits,length,RootID,layer,orders,Expression,times from bbs1 where BoardID=" & boardID & " and ( rootID >= " & announceIDRange2 & " and rootID <=" & announceIDRange1 & " ) "&tl&" ORDER BY times desc,rootID desc,orders "
rs.open sql,conn,1,1
if err.number<>0 then
foundErr = true
ErrMsg = "<li>数据库操作失败:" & err.description & "</li>"
err.clear
else
'显示分页
call listPages1()
'显示数状列表
call showTree()
'显示分页
call listPages2()
rs.Close
end if
if err.number<>0 then err.clear
end sub
sub listPages1()
'on error resume next
%>
<table border="0" cellpadding="0" cellspacing="3" width="95%" align="center" bgcolor="<%=Tabletitle%>">
<form method="get" action="list.asp" name="frmList1">
<input type=hidden name="selTimeLimit" value="<%=request("selTimeLimit")%>">
<input type=hidden name="skin" value="<%=skin%>">
<tr>
<td valign="middle" nowrap height=22><font color=<%=TableFont%>>○共<strong><%=allarticle()%></strong>篇贴子 共<strong><%=n%></strong>页 目前为第<strong><%=currentPage%></strong>页 </font></td>
<td valign="middle" nowrap><font color=<%=TableFont%>>
<div align=right>
<%
if currentpage=1 then
%>[首页] [前页]<%else
%><a href="javascript:viewPage1(1)" language="javascript"><font color=<%=TableFont%>>[首页]</font></a> <a href="javascript:viewPage1(<%=currentpage-1%>)" language="javascript"><font color=<%=TableFont%>>[前页]</font></a><%end if%> <%
if currentpage=n then
%>[后页] [尾页]</font><%else
%><a href="javascript:viewPage1(<%=currentpage+1%>)"><font color=<%=TableFont%>>[后页]</font></a> <a href="javascript:viewPage1(<%=n%>)"><font color=<%=TableFont%>>[尾页]</font></a><%end if
%>
</div></font>
</td>
</tr>
<input type="hidden" name="BoardID" value="<%=BoardID%>">
</form>
</table>
<% if err.number<>0 then err.clear
end sub
sub listPages2()
'on error resume next
%>
<table border="0" cellpadding="0" cellspacing="3" width="95%" align="center" bgcolor="<%=Tabletitle%>">
<form method="get" action="list.asp" name="frmList2">
<input type=hidden name="selTimeLimit" value="<%=request("selTimeLimit")%>">
<input type=hidden name="skin" value="<%=skin%>">
<tr>
<td valign="middle" nowrap><font color=<%=TableFont%>>页次:<strong><%=currentPage%></strong>/<strong><%=n%></strong>页 每页<strong><%=MaxAnnouncePerPage%></strong> </font></td>
<td valign="middle" nowrap><font color=<%=TableFont%>>
<div align="right"><p>分页:
<%
for p=1 to n
if p<10 then
if p=currentPage then
response.write "["+Cstr(p)+"] "
else
response.write "<a href='javascript:viewPage2("+Cstr(p)+")' language='javascript'><font color="&TableFont&">["+Cstr(p)+"]</font></a> "
end if
end if
next
%>
转到:</font><input type="text" name="Page" size=3 maxlength=10 class="smallInput" value="<%=currentpage%>"><input type="button" value="Go" language="javascript" onclick="viewPage1(document.frmList2.Page.value)" id="button1" name="button1"></p>
</div>
</td>
</tr>
<input type="hidden" name="BoardID" value="<%=BoardID%>">
</form>
</table>
<% if err.number<>0 then err.clear
end sub
Rem ------显示当前页的帖子层次列表------
Sub showTree()
dim outtext
dim bytestr
response.write "<span id=forum><table border='0' width='750' cellspacing='0' cellpadding='0' align=center><tr><td><ul>"
dim layer
layer=1
do while not (rs.eof or err.number<>0)
do while layer<> rs("layer")
if rs("layer")> layer then
outtext=outtext & "<ul>"
layer=layer+1
else
outtext=outtext & "</ul>" & chr(13) & chr(10)
layer=layer-1
end if
loop
outtext=outtext & "<li>"
outtext=outtext & "<img src=images/"&rs("Expression")&">"
outtext=outtext & "<a href='ShowAnnounce.asp?boardID="&boardID&"&RootID="&cstr(rs("RootID"))&"&ID="&Cstr(rs("announceID"))&"&skin="&skin&"'>"
dim t
if rs("Length")=0 then
t=" "
else
t=" "
end if
outtext=outtext & htmlencode(rs("Topic")+t)
outtext=outtext & "</a> -- <font color='#E10071'>「作者:<a href=javascript:openScript('dispuser.asp?name="&htmlencode(rs("username"))&"',350,300) title='作者资料'><font color='#E10071'>"
bytestr="("+cstr(rs("length"))
if not WINNT_CHINESE then
if rs("Length")-1=1 then
bytestr=bytestr+" Byte)"
else
bytestr=bytestr+" Bytes)"
end if
else
bytestr=bytestr+"字)"
end if
outtext=outtext & HTMLEncode(rs("UserName"))
outtext=outtext & "</font></a>」</font> [ID:"+cstr(rs("announceID"))+" 点击:"&rs("Hits")&" <font color=green><i>"&rs("dateandtime")&"</i></font>] "+bytestr+""+chr(13)+chr(10)
if trim(rs("DateAndTime"))<>"" and isdate(rs("DateAndTime")) then
if cbool(cdate(rs("DateAndTime"))>(date()-1))=true then
outtext=outtext & "<img src='images/new.gif'>"+chr(13)+chr(10)
end if
end if
rs.movenext
response.write outtext
outtext=""
loop
if layer<>0 then
dim i
for i=1 to layer
outtext=outtext & "</ul>"
next
end if
outtext=outtext & "</ul></td></tr></table></span>"
response.write outtext
End Sub
sub showEmptyBoard0()
call listPages1()
Response.Write "<table border='0' width='750' cellspacing='0' cellpadding='0' align=center><tr><td><li>本论坛暂时没有内容,欢迎发贴。<li>或者在您选择的查询条件下没有相关贴子,请重新指定条件。</td></tr></table>"
call listPages2()
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -