|
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim a,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<%
sql="select * from guest where tongguo<>0 order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " 还 没 有 任 何 留 言 "
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*listnum>totalput then
if (totalPut mod listnum)=0 then
currentpage=totalPut \ listnum
else
currentpage=totalPut \ listnum + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,listnum,"index.asp"
else
if (currentPage-1)*listnum
<%
if rs("contenttop")<>"" then
if rs("guestcontent")<>"" then
contop=rs("contenttop")
Response.Write contop
else
contop=rs("contenttop") & "(无内容)"
Response.Write contop
end if
else
contop=rs("guestname") & "留言说(无主题)"
Response.Write contop
end if
%>
|
|
姓 名
|
<%
if rs("sex")<>"不想说" then
guestname=rs("guestname") & "(" & rs("sex") & ")"
else
guesname=rs("guestname")
end if
Response.Write guestname
%>
|
来 自
|
<%=rs("from")%> |
电 话 |
<%=rs("dianhua")%> |
<%
if rs("email")<>"" then
%>
邮 箱
|
"><%=rs("email") %> |
<%
end if
if rs("homepage")<>"" and rs("homepage")<>"http://" then
%>
|
网 址
|
" target="_blank">
<% =rs("homepage") %>
|
<%
end if
%>
时 间
|
<% =rs("guestdate")%>
|
留 言
|
<%
=rs("guestcontent") %>
|
<%
if rs("guestreply")<>"" then%>
回复留言 |
<%
=rs("guestreply")
%>
|
<%
end if
%>
<%
a=a+1
if a>=listnum then exit do
rs.movenext
loop
end sub
function showpage(totalnumber,listnum,filename)
dim n
if totalnumber mod listnum=0 then
n=totalnumber \ listnum
else
n=totalnumber \ listnum + 1
end if
response.write ""
end function
%>
|
|
|