📄 forum_list.asp
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="init.inc" -->
<%
keyno=Request.QueryString("keyno")
classcode=Request.QueryString("classcode")
pageno=Request.QueryString("pageno")
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")
if classcode<>"" then
sql="select * from forum_class where state='1' and classcode='"+classcode+"'"
else
sql="select * from forum_class where state='1' order by sortnum"
end if
rs2.Open sql,cn,1,1
if not rs2.EOF then
manager=trim(rs2("manager"))
classcode=trim(rs2("classcode"))
classname=trim(rs2("classname"))
topcount=rs2("topcount")
totcount=rs2("reccount")
flag=rs2("flag")
else
Response.End
end if
rs2.Close
select case Session("userflag")
case "1"
userqx=mid(flag,2,1)
case "2"
userqx=mid(flag,3,1)
case else
userqx=mid(flag,1,1)
end select
if manager<>"" then
keyword=manager+"/"
manager=""
xx1=1
xx2=instr(xx1,keyword,chr(47))
wheretxt=""
do while xx2>0
ttt=mid(keyword,xx1,xx2-xx1)
if ttt<>"" then
sql="select userno from userinfo where state='1' and usercode='"+ttt+"'"
rs2.Open sql,cn,1,1
if not rs2.EOF then
if cstr(Session("userno"))=cstr(rs2(0)) then
userqx="9"
end if
ttt="<a href='user_display.asp?userno="&rs2(0)&"' target=_blank>"+ttt+"</a>"
if manager="" then
manager=ttt
else
manager=manager+","+ttt
end if
end if
rs2.Close
end if
xx1=xx2+1
xx2=instr(xx1,keyword,"/")
loop
else
manager="暂无"
end if
if Session("userqx")="9" or Session("userflag")="9" then
userqx="9"
end if
if userqx="0" then
Response.End
end if
if Request.ServerVariables("REQUEST_METHOD")="POST" and userqx="9" then
rectot=Request.Form("rectot")
cn.BeginTrans
for i=1 to rectot
checksele=Request.Form("checksele"&i)
if checksele<>"" then
seleitem=Request.Form("seleitem"&i)
sqltext="delete from forum where parentno="&seleitem
cn.Execute sqltext
end if
next
sql="select count(keyno) from forum where classcode='"+classcode+"' and grade=1"
rs2.Open sql,cn,1,1
topcount=rs2(0)
rs2.Close
sql="select count(keyno) from forum where classcode='"+classcode+"'"
rs2.Open sql,cn,1,1
reccount=rs2(0)
rs2.Close
sql="update forum_class set topcount="&topcount&",reccount="&reccount&" where classcode='"+classcode+"'"
cn.Execute sql
cn.CommitTrans
end if
myurl="forum_list.asp?classcode="+classcode
mymenu="forum"
sql="select * from forum where classcode='"+classcode+"' and grade=1 order by topflag desc,replyno desc"
rs.Open sql,cn,1,1
pagesize=25
rs.PageSize=pagesize
if pageno="" then pageno=1 else pageno=cint(pageno)
if rs.PageCount>0 then rs.AbsolutePage=pageno
pagecount=rs.PageCount
reccount=rs.RecordCount
%>
<!-- #include file="begin.asp" -->
<%
sql="select count(keyno) from user_login"
rs2.Open sql,cn,1,1
reccount1=rs2(0)
rs2.Close
sql="select count(keyno) from user_login where classcode='"+classcode+"'"
rs2.Open sql,cn,1,1
reccount2=rs2(0)
rs2.Close
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td height="8"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="30" bgcolor=ffffff>
<tr>
<td width="20"> </td>
<td>欢迎光临<%=forumtitle%></td>
<td width="10"> </td>
</tr>
</table>
</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td background="images/shadow1.jpg" height="8"></td>
</tr>
<tr>
<td bgcolor="#CDDCF2" height="1"></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="30" bgcolor="<%=barcolor%>">
<tr>
<td width="10"> </td>
<td width=30 align=center><img src="images/homeflag.gif"></td>
<%if classflag="1" then%>
<td><a href="forum.asp"><%=forumtitle%></a> > <a href="forum_list.asp?classcode=<%=classcode%>"><%=classname%></a> > 帖子列表</td>
<%else%>
<td><a href="forum_list.asp"><%=forumtitle%></a> > <a href="forum_list.asp?classcode=<%=classcode%>"><%=classname%></a> > 帖子列表</td>
<%end if%>
<td width="100" align="right"></td>
<td width="10"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="6"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=tablecolor%>">
<tr bgcolor="<%=titlebgcolor%>">
<td align="left" height=22> <font color="<%=titlecolor%>">目前共有 <b><%=reccount1%></b> 人在线,本版块有 <b><%=reccount2%></b> 人
主题帖: <b><%=topcount%></b> 总帖数: <b><%=totcount%></b> </font>
</td>
</tr>
<tr bgcolor="<%=tablecolor%>">
<td height=1></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="6"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width=10></td>
<td height="26" align="left">
<%if userqx="2" then%>
<font color=ff6600>您对本版块具有只读权限</font></td>
<%else%>
<a href="forum_post.asp?classcode=<%=classcode%>"><img src="images/bt_post.gif" border=0></a></td>
<%end if%>
<td width=10></td>
<td align=center>
版主:<%=manager%>
</td>
<td width=120 align=center>
<%
select case Session("userflag")
case "1" '内部用户
if databaseflag="access" then
sql="select * from forum_class where state='1' and mid(flag,2,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and substring(flag,2,1)>'0' order by sortnum "
end if
case "2" '高级用户
if databaseflag="access" then
sql="select * from forum_class where state='1' and mid(flag,3,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and substring(flag,3,1)>'0' order by sortnum "
end if
case else
if databaseflag="access" then
sql="select * from forum_class where state='1' and mid(flag,1,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and substring(flag,1,1)>'0' order by sortnum "
end if
end select
if userqx="9" then '管理员或总坛主
sql="select * from forum_class where state='1' order by sortnum "
end if
%>
<select name="select" onChange="if(this.options[this.selectedIndex].value!='$') {window.open(this.options[this.selectedIndex].value,'_self')}" >
<option value="$">--快速跳转--</option>
<%
rs2.Open sql,cn,1,1
do while not rs2.EOF
%>
<option value="forum_list.asp?classcode=<%=rs2("classcode")%>"><%=trim(rs2("classname"))%></option>
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -