<% '************************************** '** index.asp '** '** 文件说明:留言首页 '** 修改日期:2005-11-02 '************************************** dim currentpage,page_count,Pcount dim totalrec,endpage if Request.QueryString("page")="" then currentPage=1 else currentPage=cint(Request.QueryString("page")) end if if login then pagename="管理留言" else pagename="查看留言" end if call bodySkin() sub pageContent() showMsg() end sub function showMsg() if login then sql="select * from [topic] order by top desc,usertime desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 else sql="select * from [topic] where checked=1 order by top desc,usertime desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 end if if rs.eof and rs.bof then rs.close set rs=nothing errinfo="
  • 还没有任何留言。" call showError() end if rs.pagesize = perpage rs.absolutepage=currentpage page_count=0 totalrec=rs.recordcount if not totalrec mod perpage=0 then if currentPage > (totalrec/perpage)+1 then response.redirect "?page=" & Int((totalrec/perpage))+1 else if currentPage > (totalrec/perpage) then response.redirect "?page=" & Int((totalrec/perpage)) end if call pages() while (not rs.eof) and (not page_count = rs.pagesize) dim username,userURL,usermail,userqq,usertitle,usertime,usercontent,recontent,retime username = HTMLencode(rs("username")) userURL = HTMLencode(rs("userURL")) usermail = HTMLencode(rs("usermail")) userqq = HTMLencode(rs("userqq")) usertitle = HTMLencode(rs("usertitle")) usertime = rs("usertime") usercontent = UBBCode(rs("usercontent"),rs("top")) recontent = UBBCode(rs("recontent"),1) retime = rs("retime") %> ">
    <%if rs("whisper")="1" and (not login) then%>
    • 悄悄话
    • <%=username%>
    悄悄话留言
    <%=usertime%>
    此留言仅管理员可见。
    <%if rs("replycode")<>"" then%> <%if rs("reply")=1 then call viewreply(rs("id")) else%>状态:未被回复。<%end if else%>状态:无法被回复。<%end if%>
    <%else%>
    • <%if rs("top")=1 then%>管理员<%else%>.gif" alt="<%=username%>" /><%end if%>
    • <%if rs("top")=1 then%>管理员<%else%><%=username%><%end if%>
    <%if rs("top")=1 then%>公告:<%else%>标题:<%end if%>

    <%=usertitle%>

    <%=usertime%>
    <%if not rs("userURL")="" then%>访问“<%=username%>”的网站 <%else%> <%end if%> <%if not rs("usermail")="" then%>给“<%=username%>”发送电子邮件 <%else%> <%end if%> <%if not rs("userqq")="" then%>向“<%=username%>”的QQ发起临时会话(QQ软件须开启) <%else%> <%end if%>
    <%=usercontent%>
    <%if rs("reply")=1 then%>
    管理员回复 : ( <%=retime%> )
    <%=recontent%>
    <%end if%>
    <%if login then%> <%end if%> <%end if%>
    <% page_count = page_count + 1 rs.movenext wend %>
    <% call pages() rs.close set rs=nothing end function sub viewreply(id) '//////// 查看回复的表单 %>
    回复查看码:  
    <% end sub sub pages() '//////// 分页代码 %>
    <% dim ii,p,n if totalrec mod perpage=0 then n= totalrec \ perpage else n= totalrec \ perpage+1 end if p=(currentpage-1) \ 5 %> 页次:<%=currentpage%>/<%=n%>页,每页<%=rs.pagesize%>条,共<%=totalrec%>条    <%if currentpage=1 then%>首页  <%else%>首页  <%end if%> <%if p*5>0 then%> 上翻  <%end if for ii=p*5+1 to p*5+5 if ii=currentpage then%><%=cstr(ii)%> <%else%><%=cstr(ii)%> <%end if if ii=n then exit for next if ii 下翻<%end if%> <%if currentpage=n then%> 尾页 <%else%> 尾页 <%end if%>
    <% end sub %>