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

📄 listforum.asp

📁 很好的一个论坛原代码
💻 ASP
字号:
<%
if not session("sfadmin") then response.redirect("welcome.asp")
%>
<!--#INCLUDE FILE="../inc/db_inc.asp"-->
<!--#INCLUDE FILE="../inc/char_inc.asp"-->
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" href="image/style.css" type="text/css">
</HEAD>

<BODY bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10">
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<!--#INCLUDE FILE="checkadmin.asp"-->
<TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF" align="center"><B>论坛列表</B></TD>
  </TR>
  <TR> 
    <TD bgcolor="#F5F5F5" align="right"><A href="newcate.asp">添加新分类</A> &nbsp; </TD>
  </TR>
<%
Set rs3 = server.CreateObject("ADODB.RecordSet")
StrSql = "select forumid, userid, username from sf_moderator"
rs3.Open StrSql, Conn, 1, 1
if not (rs3.bof or rs3.eof) then
	modercount = rs3.RecordCount
else
	modercount = 0
end if
Set rs2 = Conn.Execute("select sf_cate.cateid, sf_cate.catetitle, sf_cate.displayorder AS catedisplayorder from sf_cate order by sf_cate.displayorder DESC, sf_cate.cateid ASC")
if not(rs2.bof or rs2.eof) then
	do until rs2.eof
		response.write "<TR><TD bgcolor=""#FFFFFF"" height=""10""></TD></TR><TR><TD bgcolor=""#E4EEDB"">分类: &nbsp; " & rs2("catetitle") & " &nbsp; &nbsp; <A href=""editcate.asp?id=" & rs2("cateid") & """>编辑</A> &nbsp; &nbsp; <A href=""delcate.asp?id=" & rs2("cateid") & """>删除</A> &nbsp; &nbsp; 显示序号: " & rs2("catedisplayorder") & " &nbsp; &nbsp; <A href=""newforum.asp?id=" & rs2("cateid") & """>为该分类添加版块</A>"
		if rs2("catedisplayorder") = 0 then response.write " &nbsp; &nbsp; (特别属性: &nbsp;无)"
		response.write "</TD></TR><TR><TD bgcolor=""#FFFFFF"" height=""5""></TD></TR>"

		Set rs = Conn.Execute("select sf_forum.forumid, sf_forum.displayorder, sf_forum.onlyuser, sf_forum.cateid, sf_forum.title, sf_forum.description, sf_forum.onlymember, sf_forum.allowposting, sf_forum.postcount, sf_forum.lastpost, sf_forum.lastposter, sf_forum.lastposterid, sf_forum.lastpostid, sf_forum.lastposttitle, sf_forum.threadcount from sf_forum where sf_forum.cateid = " & rs2("cateid")  & " order by sf_forum.displayorder DESC, sf_forum.forumid ASC")
		if not(rs.bof or rs.eof) then
			do until rs.eof
				response.write "<TR><TD bgcolor=""#F5F5F5"">版块: &nbsp; " & rs("title") & "</TD></TR><TR><TD bgcolor=""#FFFFFF""><A href=""editforum.asp?id=" & rs("forumid") & """>编辑</A> &nbsp; &nbsp; <A href=""delforum.asp?id=" & rs("forumid") & """>删除</A> &nbsp; &nbsp; 显示序号: " & rs("displayorder")
				attribstr = ""
				if rs("onlyuser") = 1 then attribstr = attribstr & " &nbsp;登录"
				if rs("displayorder") = 0 then attribstr = attribstr & " &nbsp;隐藏"
				if rs("onlymember") = 1 then attribstr = attribstr & " &nbsp;内部"
				if rs("allowposting") = 0 then attribstr = attribstr & " &nbsp;只读"
				if attribstr <> "" then response.write  "&nbsp; &nbsp; (特别属性: " & attribstr & ")"
				response.write "</TD></TR><TR><TD bgcolor=""#FFFFFF"">版主: "
				moderstr = ""
				if modercount > 0 then
					rs3.MoveFirst
					for j = 1 to modercount
						if rs3("forumid") = rs("forumid") then moderstr = moderstr & "<a href=""edituser.asp?userid=" & rs3("userid") & """>" & rs3("username") & "</a> &nbsp; "
						rs3.MoveNext
					next
				end if
				if moderstr = "" then
					response.write "空"
				else
					response.write moderstr
				end if
		
				response.write "</TD></TR><TR><TD bgcolor=""#FFFFFF"" height=""10""></TD></TR>"
				rs.MoveNext
			loop
		else
			response.write "<TR><TD>该分类下目前无任何版块</TD></TR>"
		end if
		rs2.MoveNext
	loop

end if
%>
</TABLE>
<BR><BR><BR>
</BODY>
</HTML>
<%
Conn.close
Set Conn = nothing
Set rs = nothing
%>

⌨️ 快捷键说明

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