📄 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="0" width="100%">
<tr>
<td width="25%"><font color="#003399">主题总数:<b><%=totalrec%> <FONT color=#003399></b>当前显示:<B><%=currentpage*25-24%>-<%=currentpage*25%></B></FONT><b> </b></font>
</b></font></td>
<td width="75%">
<p align="right"><a href="#"onClick="window.open('announce.asp?boardid=1&skin=0','caikuang','scrollbars=yes,resizable=yes,top=100,left=100,width=500,height=420')">[发表新贴]</a> <a href="list.asp?boardid=1&skin=1">[UBB风格]</a> <a href="#"onClick="window.open('reg.asp','caikuang','scrollbars=yes,resizable=yes,top=100,left=100,width=400,height=400')">[注册]</a> <a href="Query.asp">[搜索帖子]</a>
页码选择:
<%
if currentpage=1 then
%>首页 上页<%else
%><a href="javascript:viewPage1(1)" language="javascript">首页</a> <a href="javascript:viewPage1(<%=currentpage-1%>)" language="javascript">上页</a><%end if%> <%
if currentpage=n then
%>下页 尾页<%else
%><a href="javascript:viewPage1(<%=currentpage+1%>)">下页</a> <a href="javascript:viewPage1(<%=n%>)">尾页</a> <%end if %>
(第<strong><%=currentPage%></strong>页/共<strong><%=n%></strong>页)
</p>
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#800000" bordercolordark="#800000">
<tr><td width="100%"><p align="center">
<table border="0" cellpadding="0" cellspacing="3" width="100%" align="center" bgcolor="#800000" height="20">
<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=16> </td>
<td valign="middle" nowrap height="16">
</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="100%" align="center" bgcolor="#800000" height="5">
<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 height="1"><font color="#FFFFFF">页次:<strong><%=currentPage%></strong>/<strong><%=n%></strong>页 每页<strong><%=MaxAnnouncePerPage%></strong> </font></td>
<td valign="middle" nowrap height="1">
<div align="right"><p><font color="#FFFFFF">分页:
<%
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='#ffffff'>["+Cstr(p)+"]</font></a> "
end if
end if
next
%>
转到:<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"></font></p>
</div>
</td>
</tr>
<input type="hidden" name="BoardID" value="<%=BoardID%>">
</form>
</table></td></tr></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='100%' cellspacing='0' cellpadding='0' align=center><tr><td bgcolor='eeeeee'><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 & ""
outtext=outtext & "<a href='ShowAnnounce.asp?boardID="&boardID&"&RootID="&cstr(rs("RootID"))&"&ID="&Cstr(rs("announceID"))&"&skin="&skin&"' target=_blank>"
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='100%' 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 + -