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

📄 showcate.asp

📁 苹果风格的论坛 asp编写
💻 ASP
字号:
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'	Snowman Forum v2.0 for MS SQL Server
'
'	Copyright(C) Snowman, All rights reserved.
'
'	http://www.xinboard.net
'
'	Access版本免费, 欲使用SQL Server商业版本请购买使用权
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

dim StrSql, rs, rs2, toptext, StrHtml, StrHtml2, StrHtml3, t1
dim StrForum, StrCate

if request("cateid") <> "" then
	cateid = ChkSql(request("cateid"))
	err = false
	if not IsNumeric(cateid) then
		err = true
	else
		StrSql = "select * from sf_cate where cateid = " & cateid
		Set rs2 = Conn.Execute(StrSql)
		if rs2.bof or rs2.eof then
			err = true
		else
			''''''''''''''''''''''''''
			'change window title
			'''''''''''''''''''''
			forumtitle = rs2("catetitle")
		end if
	end if
else
	err = true
end if



StrHtml = loadtemplate("htmltop")
StrHtml = Replace(StrHtml, "{pagetitle}", forumtitle)
StrHtml = Replace(StrHtml, "{style_path}", loadtemplate("path"))
StrHtml = Replace(StrHtml, "{forumtitle}", boardtitle)
response.write StrHtml

' Display pm window
response.write pmpopwin
StrHtml = loadtemplate("pagetitle")
StrHtml = Replace(StrHtml, "{title_img}", "<img src=""style/" & loadtemplate("path") & "/image/title.gif"">")

if err then
	StrHtml = loadtemplate("error")
	StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_url"))
	response.write StrHtml
	response.end
end if



StrSql = "select usernum, threadnum, postnum, lastuser, lastuserid, maxolnum, maxoltime from sf_counter"
Set rs2 = Conn.Execute(StrSql)
if rs2.bof or rs2.eof then
	response.write "sf cannot be initialized. (010)"
	response.end
end if


if request.cookies("sf")("username") = "" then
	toptext = loadtemplate("toptextguest")
else
	toptext = loadtemplate("toptextuser")
end if
toptext = toptext & loadtemplate("toptext")
StrHtml = Replace(StrHtml, "{top_text}", toptext)
StrHtml = Replace(StrHtml, "{username}", request.cookies("sf")("username"))
response.write StrHtml

StrHtml = loadtemplate("pagepath")
StrHtml = Replace(StrHtml, "{path_text}", "<img src=""style/" & loadtemplate("path") & "/image/home.gif""><a href=index.asp>" & boardtitle & "</a> &raquo; " & forumtitle)
response.write StrHtml

response.write loadtemplate("indexforumtop")
StrCate = loadtemplate("indexcate")
StrForum = loadtemplate("indexforum")
'rs2.close
Set rs3 = server.CreateObject("ADODB.RecordSet")
StrSql = "select forumid, userid, username from sf_moderator"
rs3.Open StrSql, Conn, 1, 1
'Set rs2 = Conn.Execute(StrSql)
if not (rs3.bof or rs3.eof) then
	modercount = rs3.RecordCount
else
	modercount = 0
end if
rs2.close
StrSql = "select sf_forum.forumid, sf_forum.cateid, sf_forum.title, sf_forum.description, sf_forum.onlymember, sf_forum.allowposting, sf_forum.replycount, sf_forum.lastpost, sf_forum.lastposter, sf_forum.lastposterid, sf_forum.lastpostid, sf_forum.lastposttitle, sf_forum.threadcount, sf_cate.catetitle from sf_forum left join sf_cate on (sf_forum.cateid = sf_cate.cateid) where sf_cate.displayorder>0 and sf_forum.displayorder>0 and sf_forum.cateid = " & cateid & " order by sf_cate.displayorder DESC, sf_cate.cateid ASC, sf_forum.displayorder DESC, sf_forum.forumid ASC"
'on Error resume next
rs2.Open StrSql, Conn, 1, 1
if not(rs2.bof or rs2.eof) then
	do until rs2.eof
		if nowcateid <> rs2("cateid") then
			StrHtml2 = StrCate
			StrHtml2 = Replace(StrHtml2, "{forum_name}", "<a href=""showcate.asp?cateid=" & rs2("cateid") & """>" & rs2("catetitle") & "</a>")
			response.write StrHtml2
			nowcateid = rs2("cateid")
		end if
		StrHtml2 = StrForum
		description = ""
		if not isnull(rs2("description")) then description = rs2("description")
		lastposter = ""
		if not isnull(rs2("lastposter")) then lastposter = rs2("lastposter")
		lastposttitle = ""
		if not isnull(rs2("lastposttitle")) then lastposttitle = server.htmlencode(rs2("lastposttitle"))
		if datediff("h", now(), rs2("lastpost")) = 0 then
			forumicon = "new"
		else
			forumicon = "old"
		end if
		if rs2("onlymember") = 1 then forumicon = "hidden"
		if rs2("allowposting") = 0 then forumicon = "readonly"
		StrHtml2 = Replace(StrHtml2, "{forum_icon}", "<img src=""style/" & loadtemplate("path") & "/forumicon/" & forumicon & ".gif"">")
		StrHtml2 = Replace(StrHtml2, "{forum_description}", description)
		StrHtml2 = Replace(StrHtml2, "{forum_thread_num}", rs2("threadcount"))
		StrHtml2 = Replace(StrHtml2, "{forum_post_num}", rs2("replycount"))
		if rs2("onlymember") <> 1 then
			if lastposter = "" then
				StrHtml2 = Replace(StrHtml2, "{forum_lastpost}", "")
			else
				StrHtml2 = Replace(StrHtml2, "{forum_lastpost}", "<a href=""showthread.asp?page=end&threadid=" & rs2("lastpostid") & """ title=""" & lastposttitle & chr(10) & rs2("lastpost") & """><img src=""style/" & loadtemplate("path") & "/image/lasticon.gif"" border=""0"">" & left(lastposttitle, 10) & "</a><br> - <a href=""showuser.asp?userid=" & rs2("lastposterid") & """ target=_blank>" & lastposter & "</a>")
			end if
		else
			StrHtml2 = Replace(StrHtml2, "{forum_lastpost}", "")
		end if
		StrHtml2 = Replace(StrHtml2, "{forum_post_num}", rs2("replycount"))
		StrHtml2 = Replace(StrHtml2, "{forum_name}", "<a href=""showforum.asp?forumid=" & rs2("forumid") & """>" & rs2("title") & "</a>")
		' 取得版主信息
		StrHtml = ""
		if modercount > 0 then
			rs3.MoveFirst
			for j = 1 to modercount
				if rs3("forumid") = rs2("forumid") then StrHtml = StrHtml & "<a href=""showuser.asp?userid=" & rs3("userid") & """ target=_blank>" & rs3("username") & "</a> "
				rs3.MoveNext
			next
		end if
		StrHtml2 = Replace(StrHtml2, "{forum_moder}", StrHtml)
		response.write StrHtml2
		forumid = rs2("forumid")
		rs2.MoveNext
	loop
end if

StrHtml = loadtemplate("indexforumbottom") 
StrHtml = Replace(StrHtml, "{forumicon_new}", "<img src=""style/" & loadtemplate("path") & "/forumicon/new.gif"">")
StrHtml = Replace(StrHtml, "{forumicon_old}", "<img src=""style/" & loadtemplate("path") & "/forumicon/old.gif"">")
StrHtml = Replace(StrHtml, "{forumicon_hidden}", "<img src=""style/" & loadtemplate("path") & "/forumicon/hidden.gif"">")
StrHtml = Replace(StrHtml, "{forumicon_readonly}", "<img src=""style/" & loadtemplate("path") & "/forumicon/readonly.gif"">")
response.write StrHtml

response.write sfcopyright
response.write loadtemplate("htmlbottom")
Conn.Close
Set Conn = nothing
Set rs2 = nothing
Set StrForum = nothing
Set StrCate = nothing
Set StrHtml = nothing
Set StrHtml2 = nothing
Set StrHtml3 = nothing
Set t1 = nothing
%>

⌨️ 快捷键说明

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