?? bbs_list.asp
字號:
<%
sub AnnounceList1()
'on error resume next
'打開數據庫連接
sql="select count(Announceid) from bbs1 where istop=1 and layer=1 and boardid="&boardid
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
topNum=rs(0)
rs.close
if currentPage>1 then
sql="select top "&MaxAnnouncePerPage&" AnnounceID,parentID,boardID,UserName,child,Topic,body,DateAndTime,hits,RootID,Expression,times,locktopic,istop,isbest,isvote from bbs1 where boardID="&cstr(boardID)&" and parentID=0 and times < all (select top "&(currentPage-1)*MaxAnnouncePerPage-topNum&" times from bbs1 where boardID="&cstr(boardID)&" and istop=0 and parentID=0 order by times desc) "&tl&" and not locktopic=2 ORDER BY istop desc,times desc,announceid desc"
else
sql="select top "&MaxAnnouncePerPage&" AnnounceID,parentID,boardID,UserName,child,Topic,body,DateAndTime,hits,RootID,Expression,times,locktopic,istop,isbest,isvote from bbs1 where boardID="&cstr(boardID)&" and parentID=0 "&tl&" and not locktopic=2 ORDER BY istop desc,times desc,announceid desc"
end if
rs.open sql,conn,1,1
if err.number<>0 then
rs.close
set rs=nothing
foundErr = true
ErrMsg = "<li>數據庫操作失?。?quot; & err.description & "</li>"
else
if rs.bof and rs.eof then
'論壇無內容
call showEmptyBoard1()
bBoardEmpty = true
else
if currentpage<1 then currentpage=1
MaxAnnouncePerpage=Clng(MaxAnnouncePerpage)
call showpagelist1()
end if
rs.close
set rs=nothing
set cmd=nothing
end if
if err.number<>0 then err.clear
end sub
REM 顯示貼子列表
sub showPageList1()
response.write "<table cellspacing=0 border=0 width="&TableWidth&" bgcolor="&Tablebackcolor&" align=center><tr><td height=1></td></tr></table>"&_
"<TABLE style=color:"&TableFontcolor&" border=1 cellPadding=0 cellSpacing=0 width=95% align=center bordercolor="&Tablebackcolor&">"&_
"<TBODY>"&_
"<TR align=middle>"&_
"<TD height=27 width=32 bgColor="&Tabletitlecolor&"><font color="&TableFontcolor&">狀態</font></TD>"&_
"<TD bgColor="&Tabletitlecolor&" width=*><font color="&TableFontcolor&">主 題 (點<img src="&picurl&"plus.gif>即可展開貼子列表)</font></TD>"&_
"<TD bgColor="&Tabletitlecolor&" width=80><font color="&TableFontcolor&">作 者</font></TD>"&_
"<TD bgColor="&Tabletitlecolor&" width=64><font color="&TableFontcolor&">回復/人氣</font></TD>"&_
"<TD bgColor="&Tabletitlecolor&" width=195><font color="&TableFontcolor&">最后更新 | 回復人</font></TD>"&_
"</TR>"&_
"</TBODY></TABLE>"
Forumupload=split(Forum_upload,",")
do while not rs.eof
body=rs(6)
response.write "<TABLE style=color:"&TableContentColor&" border=1 cellPadding=0 cellSpacing=0 width=95% align=center bordercolor="&Tablebackcolor&">"&_
"<TBODY><TR align=middle>"&_
"<TD bgColor="&aTableBodyColor&" width=32 height=27>"
if rs(13)<>1 and lockboard<>1 and rs(12)<>1 and rs(15)<>1 and rs(14)<>1 and rs(4)<10 then
response.write "<img src="""&picurl&P_opentopic&""" alt=開放主題>"
elseif rs(15)=1 then
response.write "<img src="""&picurl&P_isvote&""" alt=投票貼子>"
elseif rs(13)=1 then
response.write "<img src="""&picurl&P_istop&""" alt=固頂主題>"
elseif rs(14)=1 then
response.write "<img src="""&picurl&P_Tisbest&""" alt=精華帖子>"
elseif rs(4)>=10 then
response.write "<img src="""&picurl&P_hotTopic&""" alt=熱門主題>"
elseif rs(12)=1 then
response.write "<img src="""&picurl&P_closeTopic&""" alt=本主題已鎖定>"
elseif lockboard=1 then
response.write "<img src="""&picurl&P_closeTopic&""" alt=本論壇已鎖定>"
else
response.write "<img src="""&picurl&P_opentopic&""" alt=開放主題>"
end if
response.write "</TD>"&_
"<TD align=left bgcolor="&TableBodyColor&" width=* onmouseover=javascript:this.bgColor='"&aTableBodyColor&"' onmouseout=javascript:this.bgColor='"&TableBodyColor&"'>"
if rs(4)=0 then
response.write "<img src='"& picurl &"nofollow.gif' id='followImg"& rs(9) &"'>"
else
response.write "<img loaded=no src='"& picurl &"plus.gif' id='followImg"& rs(9) &"' style='cursor:hand;' onclick='loadThreadFollow("& rs(9) &","& rs(0) &","& boardid &")' title=展開貼子列表>"
end if
for u=0 to ubound(Forumupload)
if instr(body,"[upload="&Forumupload(u)&"]") and instr(body,"[/upload]")>0 then
response.write "<img src="&picurl&Forumupload(u)&".gif>"
exit for
end if
next
body=htmlencode(left(body,20))
dim Ers, Eusername, Edateandtime
Eusername=""
Edateandtime=""
set Ers=conn.execute("select top 1 username,dateandtime,body from bbs1 where rootid="& rs(9) &" and not announceid="& rs(9) &" and not locktopic=2 order by announceid desc")
if not(Ers.eof and Ers.bof) then
body=htmlencode(left(Ers(2),20))
Eusername=htmlencode(Ers(0))
Edateandtime=Ers(1)
end if
Ers.close
set Ers=nothing
response.write "<a href=""dispbbs.asp?boardID="& boardID &"&RootID="& rs(9) &"&ID="& rs(0)&""" title=""《"& htmlencode(rs(5)) &"》 作者:"& htmlencode(rs(3)) &" 發表于"& rs(7) &" 最后跟貼:"& body &"..."">"
if len(rs(5))>26 then
response.write ""&left(htmlencode(rs(5)),26)&"..."
else
response.write htmlencode(rs(5))
end if
response.write "</a>"
Maxtitlelist=Cint(Maxtitlelist)
if rs(4)>Maxtitlelist then
response.write " [<img src="&picurl&"multipage.gif>"
if rs(4) mod Maxtitlelist=0 then
Pnum= rs(4) \ Maxtitlelist
else
Pnum= rs(4) \ Maxtitlelist+1
end if
for p=1 to Pnum
response.write " <a href='dispbbs.asp?boardID="& boardID &"&RootID="& rs(9) &"&ID="& rs(0) &"&star="&P&"'><font color="&AlertFontcolor&"><b>"&p&"</b></font></a> "
next
response.write "]"
end if
response.write "</TD>"&_
"<TD bgColor="&aTableBodyColor&" width=80><a href=dispuser.asp?name="& htmlencode(rs(3)) &" target=_blank>"& htmlencode(rs(3)) &"</a></TD>"&_
"<TD bgColor="&TableBodyColor&" width=64><font color="& TableContentColor &">"
if rs(15)=1 then
set vrs=conn.execute("select votenum from vote where announceid="& rs(0) &"")
votenum=vrs("votenum")
votenum=split(votenum,"|")
dim iu
for iu = 0 to ubound(votenum)
votenum_1=cint(votenum_1)+votenum(iu)
next
response.write "<FONT color="&AlertFontColor&"><b>"&votenum_1&"</b></font> 票"
votenum_1=0
vrs.close
set vrs=nothing
else
response.write ""& rs(4) &"/"& rs(8) &"</font>"
end if
response.write "</TD><TD align=left bgColor="& aTableBodyColor &" width=195> "
'on error resume next
if Eusername="" then
response.write " "&_
FormatDateTime(rs(7),2)&" "&FormatDateTime(rs(7),4)&_
" <font color="&AlertFontColor&">|</font> ------"
else
response.write " <a href=dispbbs.asp?boardid="& boardid &"&rootid="& rs(9) &"&id="& rs(11) &"&skin=1>"&_
FormatDateTime(Edateandtime,2)&" "&FormatDateTime(Edateandtime,4)&_
"</a> <font color="&AlertFontColor&">|</font> "
if rs(0)=rs(11) then
response.write "<font color="& TableContentColor &">------</font>"
else
response.write "<a href=dispuser.asp?name="&Eusername&">"&Eusername&"</a>"
end if
end if
response.write "</TD></TR>"&_
"<tr style=display:none id='follow"& rs(9) &"'><td colspan=5 id='followTd"& rs(9) &"' style=padding:0px><div style='width:240px;margin-left:18px;border:1px solid black;background-color:lightyellow;color:black;padding:2px' onclick=loadThreadFollow("& rs(9) &")>正在讀取關于本主題的跟貼,請稍侯……</div></td></tr>"&_
"</TBODY></TABLE>"
i=i+1
rs.movenext
loop
if err.number<>0 then err.clear
end sub
sub listPages3()
'on error resume next
set rs=conn.execute("select count(announceid) from bbs1 where boardID="&cstr(boardID)&" and parentID=0 "&tl&" and not locktopic=2")
totalrec=rs(0)
dim n,pi
if totalrec mod MaxAnnouncePerPage=0 then
n= totalrec \ MaxAnnouncePerPage
else
n= totalrec \ MaxAnnouncePerPage+1
end if
if currentpage-1 mod 10=0 then
p=(currentpage-1) \ 10
else
p=(currentpage-1) \ 10
end if
response.write "<table border=0 cellpadding=0 cellspacing=3 width="&TableWidth&" align=center >"&_
"<form method=post action=list.asp name=frmList2 >"&_
"<input type=hidden name=selTimeLimit value='"& request("selTimeLimit") &"'><tr>"&_
"<td valign=middle><font color="&BodyFontColor&">頁次:<b>"& currentPage &"</b>/<b>"& n &"</b>頁 每頁<b>"& MaxAnnouncePerPage &"</b> 主題數<b>"& totalrec &"</b></font></td>"&_
"<td valign=middle><div align=right ><font color="&BodyFontColor&"><p>分頁:"
if p*10>0 then response.write "<a href='javascript:viewPage2("+Cstr(p*10)+")' language='javascript'>[<<]</a> "
for ii=p*10+1 to P*10+10
if ii=currentPage then
response.write "<font color=gray>["+Cstr(ii)+"]</font> "
else
response.write "<a href='javascript:viewPage2("+Cstr(ii)+")' language='javascript'>["+Cstr(ii)+"]</a> "
end if
if ii=n then exit for
'p=p+1
next
if ii<n then response.write "<a href='javascript:viewPage2("+Cstr(ii)+")' language='javascript'>[>>]</a> "
response.write "轉到:<input type=text name=Page size=3 maxlength=10 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>"
if err.number<>0 then err.clear
end sub
sub showEmptyBoard1()
response.write "<TABLE style=color:"&TableFontcolor&" bgColor='"&Tablebackcolor&"' border=0 cellPadding=4 cellSpacing=1 width=95% align=center>"&_
"<TBODY>"&_
"<TR align=middle bgColor='"&Tabletitlecolor&"'>"&_
"<TD height=25><font color="&TableFontcolor&">狀態</font></TD>"&_
"<TD><font color="&TableFontcolor&">主 題 (點心情符為開新窗瀏覽)</font></TD>"&_
"<TD><font color="&TableFontcolor&">作 者</font></TD> "&_
"<TD><font color="&TableFontcolor&">回復/人氣</font></TD> "&_
"<TD><font color="&TableFontcolor&">最新回復</font></TD></TR> "&_
"<tr bgColor="&TableBodyColor&"><td colSpan=5 width=100% ><font color="&TableContentColor&">本論壇暫無內容,歡迎發貼:)</font></td></tr>"&_
"</TBODY></TABLE>"
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -