%
Dim SqlStr, Rs, IsErr, ErrMsg, CurrentPage, CurrentNum
Dim TotalNum, MaxPerPage, j, OffSet
Dim Url, Index, FileName, Action
MaxPerPage = AppMaxPerPage
Url = Request.ServerVariables("URL")
index = InstrRev(Url, "/")
FileName = Right(Url, Len(Url) - index)
CurrentPage = Trim(Request("Page"))
if CurrentPage = "" then CurrentPage = 1
Set Rs = Server.CreateObject("ADODB.Recordset")
%>
<%=AppTitle%>
<%
if Session("SysAdmin") = "Yes" then
SqlStr = "Select * From Message Where ReplyID = 0 order by ID Desc"
else
SqlStr = "Select * From Message Where Opened = true And ReplyID = 0 order by ID Desc"
end if
Rs.Open SqlStr, conn, 1, 3
TotalNum = Rs.RecordCount
CurrentNum = (CurrentPage - 1) * MaxPerPage
if TotalNum > 0 then
if CurrentNum > TotalNum then
if TotalNum mod MaxPerPage = 0 then
CurrentPage = TotalNum \ MaxPerPage
else
CurrentPage = TotalNum \ MaxPerPage + 1
end if
end if
j = 1
CurrentNum = (CurrentPage - 1) * MaxPerPage
Rs.Move CurrentNum
Do While not rs.eof
%>
留言者:<%=Trim(Rs("Name"))%> 时间 [<%=Rs("AddTime")%>]
<%
if Session("SysAdmin") = "Yes" then
%>
">回复此条">删除此条
<%
elseif AppReplyOpen = true then
%>
">回复此条删除此条
<%
else
%>
回复此条
删除此条
<%
end if
%>
" width="75" height="75">
<%=Trim(Rs("Content"))%>
No.<%=j%>
<%
Dim Rss
Set Rss = Server.CreateObject("ADODB.RecordSet")
SqlStr = "Select * From Message Where ReplyID = " & Rs("ID")
Rss.Open SqlStr, conn, 1, 3
While not Rss.eof
%>
<%
Rs.MoveNext
j = j + 1
if j > MaxPerPage then
exit do
end if
loop
end if
Rs.Close
%>
<%
call ShowPage(FileName, CurrentPage, TotalNum, MaxPerPage, true, true, "条留言")
%>