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

📄 board.asp

📁 柠檬树聊天服务器
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<%Response.Expires=0
DIM Cookie
Cookie=Session.SessionID
if Cookie="" then Response.Write "没有权限" : Response.end

Set rs = Conn.Execute("select username,grade,score,times from Chatuser where SessionID='"&Cookie&"'")
if rs.eof then
Session("usernickname")="您是未注册用户"
Session("class")=0
Session("score")=0
Session("times")=0
else
Session("usernickname")=rs("username")
Session("class")=rs("grade")
Session("score")=rs("score")
Session("times")=rs("times")
end if
rs.close%>

<!--#include file="adovbs.inc" --->

 <%Dim Class1,username
  class1=Session("class")
  username=Session("usernickname")
 if class1="" then Response.Write "没有权限" : Response.end
 self=Request.QueryString("mm")

 Const NumPerPage = 10  '设置你一页要显示多少记录        
 Dim CurPage            '取得当前所在页

    If Request.QueryString("CurPage") = "" then
        CurPage = 1 
    Else
        CurPage = Request.QueryString("CurPage")
    End If


    '设置游标属性
    conn.CursorLocation = adUseClient

    '设置缓存大小 = 每页需显示的记录数目
    conn.CacheSize = NumPerPage

    Dim strSQL
     IF self<>"1" then
	set rs=conn.execute("Update board set havesee='1' where towho='"&username&"'")
	rs.close
        strSQL = "select * from board where private<>'1' or towho='"&username&"' order by time1 DESC"
     Else
        strSQL = "select * from board where towho='"&username&"' order by time1 DESC"
     End If
    set rs=conn.execute(strSQL)

    if not rs.eof then  'Response.Write "没有记录" : Response.end
    rs.MoveFirst
    rs.PageSize = NumPerPage

    '计算最多有多少页
    Dim TotalPages,recdcount
    TotalPages = rs.PageCount
    recdcount= rs.recordcount
    rs.AbsolutePage = CurPage
    end if
    Dim count
%>


<html>
<head>
<title>留言簿</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
a{color:blue;text-decoration:none}
a:hover{color:red;text-decoration:none}
a:active{text-decoration:none}
a:visited{text-decoration:none}
td{font-size:9pt}
body{font-size:9pt}
.l1{color:3366FF;line-height:170%}
</style>
</head>
<body contextmenu=self.event.returnValue=false bgcolor="#ffffff" leftmargin="5" topmargin="5">
<div align=center><br>
<table width="440" border="0" cellspacing="0">
<tr> 
<td> 
<table border="0" width="100%" cellspacing="0">
<tr> 
<td align=center>共 <font color=red><%=recdcount%></font> 条留言 每页 10 条 共 <font color=red><%=TotalPages%></font> 页 

<%if CurPage=1 then
Response.Write("<font color=666666>[上一页</font>")
else
Response.Write("[<a href=board.asp?curpage=" &CurPage-1& ">上一页</a>")
end if

if CurPage=cstr(TotalPages) then
Response.Write("<font color=666666> 下一页</font>")
else
Response.Write(" <a href=board.asp?curpage=" &CurPage+1& ">下一页</a>")
end if%>

 <a href=javascript:history.go(0) title=刷新本页>第<%=CurPage%>页</a>]</td>

</tr>
</table>
</td>
</tr>
</table>
<hr noshade size="1" color=009900 width=98%>
<table width=98% border=0 cellpadding=1 bgcolor=#333333>
<tr bgColor=#333333>
<td width=60><a href="gbwrite.asp"><font color=#00cc99>书写留言</font></a></td>
<%IF self="1" then%>
<td width=60>与我有关</td>
<td width=60><a href="board.asp"><font color=#00cc99>所有留言</font></a></td>
<%Else%>
<td width=60><a href="board.asp?mm=1"><font color=#00cc99>与我有关</font></a></td>
<td width=60>所有留言</td>
<%End if
IF Class1>8 then%>
<td align="right"><a href=delgb.asp?timeout=1><font color=#00cc99>[清除100条前的留言]</font></a></td>
<%Else%>
<td></td>
<%End IF%>
</tr>
</table><br>

<%Do While Not rs.EOF And Count < rs.PageSize%>
<table width=98% border=1 cellspacing=0 bordercolorlight=999999 bordercolordark=FFFFFF cellpadding=0>
<tr><td><table width=100% border=0 cellpadding=4 cellspacing=0>
<tr>
<td width=32 bgcolor=#CCffCC>写给:</td>
<td bgcolor=#CCffCC>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td>
<%=rs("towho")%>
<%
IF rs("private")="1" then
response.Write("<font color=red> [秘信]</font>")
End if
%>

</td>
<td align="right">
<%IF (Class1>8) or (Session("usernickname")=rs("towho")) then%>
<a href=delgb.asp?title=<%=rs("title")%>&fromwho=<%=rs("fromwho")%>&towho=<%=rs("towho")%>><font color=red>[删除]</font></a>
<%End IF%>
<a href=gbwrite.asp?towho=<%=rs("fromwho")%>&title=RE:<%=rs("title")%>>[回复]</a>
<%=rs("time1")%></td>
</tr>
</table>
</table>

<table width=100% border=0 bordercolorlight=999999 bordercolordark=FFFFFF bgcolor=#f0f0f0>
<tr> 
<td width=32 align=center>主题:</td>
<td><b><%=rs("title")%></b></td>
</tr><tr>
<td align=center>内容:</td>
<td><font color=0066FF class=l1><%=rs("detail")%></font></td></tr>
<tr><td align=center>姓名:</td>
<td><table width=100% border=0 cellspacing=0 cellpadding=0>
<tr><td><font color=FF0000><%=rs("fromwho")%></font></td>
<td align=right>

<%IF rs("mail")=" " then
Response.Write("<font color=666666>信箱</font>")
Else
Response.Write("<a href=mailto:" & rs("mail") & ">信箱</a>")
End IF

IF rs("url")=" " then
Response.Write(" <font color=666666>主页</font></td>")
Else
Response.Write("&nbsp; <a href=" & rs("url") & " target=_new>主页</a>")
End IF%>

</tr></table>
</td></tr></table>
</td>
</tr>
</table><br>
<%Count = Count + 1
 rs.MoveNext
    Loop
rs.Close%>
</body><html>

⌨️ 快捷键说明

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