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

📄 topiclist.asp

📁 程序网络论坛HigroupBBS v4.00 默认管理员帐号密码都是Marcos
💻 ASP
字号:
<!--#include file="MarcosCB.asp"-->
<%
	dim i,boardId
	dim str,url,page,theAct,newTopic,boardName,pageCode,pageTitle,pageOther,pageCountList

	getConn()
	str=getMainCode(mySkinId)
	page=getPost("page")
	theAct=getPost("theAct")
	boardId=getPost("boardId")
	boardName=getPost("boardName")
	if not isNumeric(page) then
		page=1
	end if

	if not isNumeric(boardId) and theAct<>"showNew" then
		echo "错误的版面参数!"
		closeConn()
		response.End()
	end if
	
	select case theAct
		case ""
			url="?" & request.ServerVariables("QUERY_STRING")
			pageTitle="<a href=""" & url & """>" & boardName & "</a>"
			pageOther="<script>document.title+=' - " & boardName & "帖子列表';</script>"
			sql="select boardId from Marcos_Board where boardId=" & boardId & " and topBoardId<>0"
			set rs_sys=conn.execute(sql)
			if rs_sys.eof then
				echo "错误的版面参数!(版块已被删除或者此版块是主版块)"
				closeConn()
				response.end
			end if
			queryTimes=queryTimes+1
			nowWhere "查看"&boardName&"帖子列表","topicList.asp?page="&page&"&boardId="&boardId&"&boardName="&boardName
		case "showNew"
			pageTitle="<a href=""javascript:location.reload();"">论坛新帖</a>"
			pageOther="<script>document.title+=' - 查看最新发布的帖子';</script>"
			nowWhere "查看论坛新帖","topicList.asp?theAct=showNew"
	end select
	
	showHead str,pageTitle,pageOther
	select case theAct
		case ""
			showBody()
		case "showNew"
			showNew()
	end select
	showFoot(str)
	
	sub showNew()
		dim rs_sys
		dim str,body,theBody,tableEnd,tableStart
		
'		if getApp("pageListCode_"&mySkinId&"_"&page)<>"" then
'			echo getApp("pageListCode_"&mySkinId&"_"&page)
'			exit sub
'		end if
		
		pageCode=getPageCode(mySkinId,"PageList")
		PageList=split(pageCode,"$$$")
		
		sql="select top 200 * from Marcos_Topic where isRecycled=false order by lastReplyTime desc"
		rs.open sql,conn,1,1
		rs.pageSize=listNum
		if not rs.eof then
			rs.absolutePage=page
		 else
			str="<tr height=""180""><td align=center colspan=5>本论坛暂时没有任何帖子,欢迎发布!</td></tr>"
		end if
		for i=1 to 10
			if i>rs.pageCount then
				exit for
			end if
			pageCountList=pageCountList & "<a href=""?page=" & i & "&theAct=showNew""><font {$font"&i&"}>" & i & "</font></a> "
		next
		
		pageCountList=replace(pageCountList,"{$font"&page&"}","class=warningColor")
		
		if rs.pageCount>=1 then
			pageCountList=pageCountList & " 跳转到<select name=page onChange=""this.form.submit();"">"
			for i=1 to rs.pageCount
				pageCountList=pageCountList & "<option value=""" & i & """ {$selected" & i & "}>第" & i & "页</option>"
			next
			pageCountList=pageCountList & "</select>"
			pageCountList=pageCountList & "<input type=""hidden"" name=theAct value=""showNew"">"
			pageCountList=replace(pageCountList,"{$selected" & page & "}","selected")
		end if
		
		for i=1 to listNum
			if rs.eof then exit for
			body=PageList(1)
			body=replace(body,"{$userName}",rs("userName"))
			body=replace(body,"{$replyCount}",rs("replyCount"))
			body=replace(body,"{$replyPageList}",getPageTwo(rs("replyCount"),rs("topicId"),rs("boardId")))
			body=replace(body,"{$visitCount}",rs("visitCount"))
			body=replace(body,"{$updateTime}",rs("lastReplyTime"))
			str_sys=getStatusImg(rs("replyCount"))
			body=replace(body,"{$statusImg}",split(str_sys,"$$$")(0))
			body=replace(body,"{$statusTitle}",split(str_sys,"$$$")(1))
			body=replace(body,"{$lastPostInfo}",replace(enCode(replace(replace(rs("lastPostInfo"),"$$$",vbNewLine),"@@","")),vbNewLine,"<br>"))
			if len(rs("topicTitle"))<=21 then
				topicTitle=enCode(rs("topicTitle"))
			 else
				topicTitle=enCode(left(rs("topicTitle"),21) & "...")
			end if
			if rs("isBest")=true then
				topicTitle="<font class=""warningColor"">[精华]</font>"&topicTitle
			end if
			if rs("isTop")=true then
				topicTitle="<font class=""warningColor"">[置顶]</font>"&topicTitle
			end if
			body=replace(body,"{$topicTitle}",topicTitle)
			body=replace(body,"{$topicLink}","topicShow.asp?boardId=" & rs("boardId") & "&topicId=" & rs("topicId"))
			body=replace(body,"{$mood}","&nbsp;<img src=""" & rs("topicMood") & """ border=0>")
			body=replace(body,"{$updateUser}",split(split(rs("lastPostInfo"),"$$$")(0),"@@")(1))
			str=str&body
			rs.movenext
		next
		rs.close
		queryTimes=queryTimes+1
		echo PageList(0)
		echo str
		
		body=replace(PageList(2),"{$newTopic}",newTopic)
		body=replace(body,"{$pageList}",pageCountList)
'		setApp "pageListCode_"&mySkinId&"_"&page,PageList(0)&str&body
		echo body
	end sub
	
	sub showBody()
	
		dim rs_sys
		dim str,body,theBody,tableEnd,tableStart
		
		pageCode=getPageCode(mySkinId,"PageList")
		PageList=split(pageCode,"$$$")
		
		if canSetTrue(boardId) then
			sql="select * from Marcos_Topic where boardId=" & boardId & " order by isRecycled desc,isTop,lastReplyTime desc"
		 else
			sql="select * from Marcos_Topic where boardId=" & boardId & " and isRecycled=false order by isTop,lastReplyTime desc"
		end if

		rs.open sql,conn,1,1
		rs.pageSize=listNum
		if not rs.eof then
			rs.absolutePage=page
		 else
			str="<tr height=""180""><td align=center colspan=5>本版块暂时没有帖子,欢迎发布!</td></tr>"
		end if
		newTopic="<img src=""Images/{$styleRoot}/newTopic.gif""><a href=""newTopic.asp?boardId=" & boardId & "&boardName=" & boardName & """>发表新帖</a>"
		for i=1 to 10
			if i>rs.pageCount then
				exit for
			end if
			pageCountList=pageCountList & "<a href=""?page=" & i & "&boardName=" & boardName & _
						  "&boardId=" & boardId & """><font {$font"&i&"}>" & i & "</font></a> "
		next
		
		pageCountList=replace(pageCountList,"{$font"&page&"}","class=warningColor")
		
		if rs.pageCount>=1 then
			pageCountList=pageCountList & "跳转到<select name=page onChange=""this.form.submit();"">"
			for i=1 to rs.pageCount
				pageCountList=pageCountList & "<option value=""" & i & """ {$selected" & i & "}>第" & i & "页</option>"
			next
			pageCountList=pageCountList & "</select>"
			pageCountList=pageCountList & "<input type=""hidden"" name=boardId value=""" & boardId & """>"
			pageCountList=pageCountList & "<input type=""hidden"" name=boardName value=""" & boardName & """>"
			pageCountList=replace(pageCountList,"{$selected" & page & "}","selected")
		end if
		
		for i=1 to listNum
			if rs.eof then exit for
			body=PageList(1)
			body=replace(body,"{$userName}",rs("userName"))
			body=replace(body,"{$replyCount}",rs("replyCount"))
			body=replace(body,"{$replyPageList}",getPageTwo(rs("replyCount"),rs("topicId"),rs("boardId")))
			body=replace(body,"{$visitCount}",rs("visitCount"))
			body=replace(body,"{$updateTime}",rs("lastReplyTime"))
			str_sys=getStatusImg(rs("replyCount"))
			body=replace(body,"{$statusImg}",split(str_sys,"$$$")(0))
			body=replace(body,"{$statusTitle}",split(str_sys,"$$$")(1))
			body=replace(body,"{$lastPostInfo}",replace(enCode(replace(replace(rs("lastPostInfo"),"$$$",vbNewLine),"@@","")),vbNewLine,"<br>"))
			if len(rs("topicTitle"))<=21 then
				topicTitle=enCode(rs("topicTitle"))
			 else
				topicTitle=enCode(left(rs("topicTitle"),21) & "...")
			end if
			if rs("isRecycled")=true then
				topicTitle="<font class=""warningColor"">[已回收]</font>"&topicTitle
			 else
				if rs("isBest")=true then
					topicTitle="<font class=""warningColor"">[精华]</font>"&topicTitle
				end if
				if rs("isTop")=true then
					topicTitle="<font class=""warningColor"">[置顶]</font>"&topicTitle
				end if
			end if
			body=replace(body,"{$topicTitle}",topicTitle)
			body=replace(body,"{$topicLink}","topicShow.asp?boardId=" & boardId & "&boardName=" & boardName & "&topicId=" & rs("topicId"))
			body=replace(body,"{$mood}","&nbsp;<img src=""" & rs("topicMood") & """ border=0>")
			body=replace(body,"{$updateUser}",split(split(rs("lastPostInfo"),"$$$")(0),"@@")(1))
			str=str&body
			rs.movenext
		next
		rs.close
		queryTimes=queryTimes+1
		echo PageList(0)
		echo str
		
		body=replace(PageList(2),"{$newTopic}",newTopic)
		body=replace(body,"{$pageList}",pageCountList)
		echo body
	end sub
	
	closeConn()
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -