⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbs_list.asp

📁 生活者姿态整站程序 生活者姿态整站程序 生活者姿态整站程序
💻 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>数据库操作失败:" & 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)) &"》&#13;&#10;作者:"& htmlencode(rs(3)) &"&#13;&#10;发表于"& rs(7) &"&#13;&#10;最后跟贴:"& 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 "&nbsp;&nbsp;[<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>&nbsp;"

	'on error resume next
	if Eusername="" then
		response.write "&nbsp;"&_
						FormatDateTime(rs(7),2)&"&nbsp;"&FormatDateTime(rs(7),4)&_
						"&nbsp;<font color="&AlertFontColor&">|</font>&nbsp;------"
	else
		response.write "&nbsp;<a href=dispbbs.asp?boardid="& boardid &"&rootid="& rs(9) &"&id="& rs(11) &"&skin=1>"&_
						FormatDateTime(Edateandtime,2)&"&nbsp;"&FormatDateTime(Edateandtime,4)&_
						"</a>&nbsp;<font color="&AlertFontColor&">|</font>&nbsp;"
		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 + -