📄 forum.asp
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="init.inc" -->
<%
if classflag="0" then Response.Redirect("forum_list.asp?classcode=101")
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
set rs1 = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")
if Session("userqx")="9" or Session("userflag")="9" then
userqx="9"
end if
myurl="forum.asp"
mymenu="forum"
%>
<!-- #include file="begin.asp" -->
<%
if databaseflag="access" then
cn.execute "delete from user_login where DateDiff('n',updatetime,Now())>20"
else
cn.execute "delete from user_login where DateDiff(minute,updatetime,getdate())>20"
end if
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td height="15"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr><td>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="70"><img src="images/icon_guest.gif" width="50" height="50"></td>
<td class="font2">
<a href="#" class="a11"><b><font color="#000000"><%=Session("usercode")%></font></b></a>
<font color="#000000">欢迎来到 <%=forumtitle%><br>
<%if Session("userno")="" then%>
你必须先进行 <a href="user_login.asp" class="a11"><font color="#FF6600">登录</font></a> 或 <a href="register.asp" class="a11"><font color="#FF6600">注册</font></a> 后才能浏览论坛和发帖,谢谢!<br>
<%else%>
你可以到 <a href="user_center.asp" class="a11"><font color="#FF6600">我的主页</font></a> 修改你的头像、个人资料或密码等!<br>
<%end if%>
现在时间是 <%=time()%> </font>
</td>
<td> </td>
<%
sql="select sum(topcount),sum(reccount) from forum_class where state='1' "
rs2.Open sql,cn,1,1
if not rs2.EOF then
ztopcount=rs2(0)
zreccount=rs2(1)
end if
rs2.Close
sql="select count(userno) from userinfo where state='1' "
rs2.Open sql,cn,1,1
if not rs2.EOF then
zusercount=rs2(0)
end if
rs2.Close
sql="select userno,usercode from userinfo where state='1' order by userno desc "
rs2.Open sql,cn,1,1
if not rs2.EOF then
newuserno=rs2(0)
newusercode=trim(rs2(1))
end if
rs2.Close
%>
<td width="250" align="right">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=right>
<tr>
<td width=70 align=right height=20>主题总数:</td><td width=30 align=center><%=ztopcount%></td><td width=20 align=center>|</td><td width=60 align=center>帖子总数:</td><td align=left> <%=zreccount%></td>
</tr>
<tr>
<td width=70 align=right>会员总数:</td><td width=30 align=center><%=zusercount%></td><td width=20 align=center>|</td><td width=60 align=center>新会员:</td><td align=left> <a href="user_display.asp?userno=<%=newuserno%>" target=_blank><%=newusercode%></a></td>
</tr>
</table>
</td>
</tr>
</table>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td background="images/shadow1.jpg" height="20"> </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">
<%
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
%>
<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/arrow_title.gif"></td>
<td><a href="forum.asp"><%=forumtitle%></a> > 论坛列表</td>
<td width="100" align="right">
<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")%>" <%if classcode=rs2("classcode") then Response.Write("selected")%>><%=trim(rs2("classname"))%></option>
<%
rs2.MoveNext
loop
rs2.close
%>
</select>
</td>
<td width="10"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="images/title_bg.jpg">
<tr>
<td width="40" align="center" height="22"><font color="<%=titlecolor1%>">符号</font></td>
<td align="center"><font color="<%=titlecolor1%>">主题</font></td>
<td align="center" width=50><font color="<%=titlecolor1%>">主题帖</font></td>
<td align="center" width=50><font color="<%=titlecolor1%>">发帖数</font></td>
<td width="220" align="center"><font color="<%=titlecolor1%>">最后更新</font></td>
<td width="90" align="center"><font color="<%=titlecolor1%>">版主</font></td>
</tr>
</table>
<%
sql="select classcode,classname from forum_basclass where state='1' order by sortnum"
rs1.Open sql,cn,1,1
do while not rs1.EOF
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#FFFFff">
<tr>
<td bgcolor="#CC0000" height="22"> <img src="images/icon1.gif" width="15" height="15" align="absmiddle"><font color="#FFFFFF"><b><%=trim(rs1("classname"))%></b></font></td>
</tr>
</table>
<%
basclass=trim(rs1(0))
select case Session("userflag")
case "1" '内部用户
if databaseflag="access" then
sql="select * from forum_class where state='1' and basclass='"+basclass+"' and mid(flag,2,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and basclass='"+basclass+"' 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 basclass='"+basclass+"' and mid(flag,3,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and basclass='"+basclass+"' 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 basclass='"+basclass+"' and mid(flag,1,1)>'0' order by sortnum "
else
sql="select * from forum_class where state='1' and basclass='"+basclass+"' 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' and basclass='"+basclass+"' order by sortnum "
end if
'Response.Write sql
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
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="ffffff">
<%
i=1
do while not rs.EOF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -