28,408
社区成员




<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/bookd.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Dim Recordset1_liuyanID
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_bookd_STRING
Recordset1.Source = "SELECT * FROM liuyan ORDER BY date DESC"
Recordset1.CursorType = 1
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
Recordset1.pagesize=5
if request.QueryString("pagenum")="" then
pagenum=1
else
pagenum=clng(request.QueryString("pagenum"))
end if
<!--recordset1.absolutepage=pagenum-->
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last
Dim Recordset1_pagecount
' set the record count
Recordset1_total = Recordset1.RecordCount
Recordset1_pagecount=recordset1.PageCount
' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
If (Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
End If
%>
<script language="vbscript">
sub gopage()
if windows.event.keycode=13 then
page=document.formpage.pagenum.value
windows.location.href="guestbook.asp?pagenum=<%=page%>"
end if
end sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<p> </p>
<table width="100%" height="20" border="0" align="center">
<tr>
<td>
<%
response.Write"共 "&Recordset1.recordcount&"条记录,第"&pagenum&"/"&Recordset1.pagecount&"页"
%>
第
<input name="pagenum" type="text" id="pagenum" size="3" onKeyPress="gopage()"/>
頁 </td>
<td><a href="write.asp">發表留言</a></td>
</tr>
</table>
<%
recordset1.absolutepage=pagenum
%>
<table width="448" height="100%" border="1" align="center" cellspacing="0" bordercolor="#0000FF">
<%
for i=1 to recordset1.pagesize
if recordset1.eof then exit for
%>
<tr>
<td><table width="100%" height="10%" border="0">
<tr>
<td><div align="center"><%=(Recordset1.Fields.Item("author").Value)%></div></td>
</tr>
<tr>
<td><div align="center"><a href="mailto:<%=(Recordset1.Fields.Item("email").Value)%>">聯系我</a></div></td>
</tr>
<tr>
<td><% Recordset1_liuyanID=(Recordset1.Fields.Item("ID").Value)%></td>
</tr>
<tr>
<td><%response.Write Recordset1_liuyanID %></td>
</tr>
</table></td>
<td><table width="100%" height="100%" border="0">
<tr>
<td>發表于:<%=(Recordset1.Fields.Item("date").Value)%></td>
</tr>
<tr>
<td>主題:<%=(Recordset1.Fields.Item("title").Value)%></td>
</tr>
<%
Dim Recordset2__liuyanID
Recordset2__liuyanID = "13"
If (Recordset1_liuyanID <> "") Then
Recordset2__liuyanID = Recordset1_liuyanID
End If
response.Write Recordset2__liuyanID
%>
<%
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_bookd_STRING
Recordset2.Source = "SELECT * FROM reply WHERE id=" + Replace(Recordset2__liuyanID, "'", "''") + ""
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()
Recordset2_numRows = 0
%>
<tr>
<td><p>內容:</p>
<p> </p>
<p><%=(Recordset1.Fields.Item("content").Value)%></p>
<table width="100%" border="1">
<tr>
<td><%=(Recordset2.Fields.Item("author").Value)%></td>
</tr>
<tr>
<td><%=(Recordset2.Fields.Item("content").Value)%></td>
</tr>
</table>
<p> </p></td>
</tr>
<tr>
<td><a href="reply.asp?liuyanID=<%=Recordset1("ID")%>&liuyantitle=<%=Recordset1("title")%>">給我留言</a></td>
</tr>
</table>
<p> </p></td>
</tr>
<%
recordset1.moveNext
Next
%>
</table>