<%Option Explicit%>
<!--#include file="conn.asp"-->
<%Dim pageno,re,rc,totalrec,mpage
    pageno=request.querystring("pageno")    
    SqlData="select id,istop,name,face,SubMain,writetime,report,counter,lastname,lasttime from Data where SubMainNumber=0 order by istop desc,lasttime desc"
    Rs.open SqlData,conn,1,1
DoWhat="首页"
call HeadHtml()'头过程
response.write "<table width=780 border=1 cellspacing=1 cellpadding=2 align=center bordercolor=#FFFFFF><tr bordercolor=#FFFFFF><td width=30 align=cetner bgcolor=#DEE5EF>公告</td>"&_
"<td width=550 colspan=3 align=center><marquee width=""96%"" onMouseOver=this.stop() onMouseOut=this.start() direction=left scrollamount=3>"&_
MainNote & "</marquee></td><td width=200 align=right><a href=""" & HomePage & """ target=_blank><img src=""images/homepage1.gif"" border=0 alt=""主页""></a>"&_
" <a href=""upfile.asp""><img src=""images/newpage.gif"" border=0 alt=""签写留言""></a> " & IsLogin()	'管理链接
if Rs.eof and Rs.bof then
	response.write "</td></tr><tr bordercolor=#ffffff><td height=50 colspan=5 align=center>暂时还没有留言！"
else
		totalrec=rs.recordcount
		Rs.pagesize=HomePageNO
    mpage=Rs.pagecount
    if isempty(pageno) or (not isnumeric(pageno)) then 
    	pageno=1
    elseif cint(pageno)<1 or cint(pageno)>mpage then 
    	pageno=1
    end if
    Rs.absolutepage=pageno
response.write "</td></tr><tr bordercolor=#ffffff>"&_
    "<td width=30 align=center bgcolor=#DEE5EF><B>状态</B></td>"&_
    "<td width=400 align=center bgcolor=#FFFFFF><B>主题</B></td>"&_
    "<td width=85 align=center bgcolor=#DEE5EF><B>作者</B></td>"&_
    "<td width=65 align=center bgcolor=#FFFFFF><B>回复/人气</B></td>"&_
    "<td width=200 bgcolor=#DEE5EF align=center><B>最后更新/回复人</B></td></tr>"
rc=Rs.pagesize
re=1
do while not Rs.eof and rc>0
response.write "<tr bordercolor=#ffffff><td align=center bgcolor=#DEE5EF><img src=""images/"
		if Rs("istop")=1 then
    	response.write "folder_top.gif"" border=0 alt=""置顶主题"">"
    elseif Rs("report")>=HotPageNO then 
    	response.write "folder_hot.gif"" border=0 alt=""热门主题"">"
	  elseif year(Rs("writetime"))=year(Now()) and (month(Rs("writetime"))=month(Now()) and int(day(Rs("writetime")))+2>int(day(Now()))) then
	    response.write "folder_new.gif"" border=0 alt=""新发表的主题"">"
    else
   		response.write "folder_old.gif"" border=0 alt=""开放主题"">"
    end if
response.write "</td><td bgcolor=#FFFFFF><img src=""images/"
    if Rs("report")>0 then response.write "plus.gif"" border=0 alt=""有回复"">" else response.write "minus.gif"" border=0 alt=""无回复"">"
response.write "<img src=""face/face" & Rs("face") & ".gif"" border=0> <a href=""dis.asp?id=" & Rs("id") & """>"
    if len(Rs("SubMain"))>23 then
    	response.write ChkBadWords(left(Rs("SubMain"),23)) & "..."
    else
    	response.write ChkBadWords(Rs("SubMain"))
    end if
response.write "</a></td><td align=center bgcolor=#DEE5EF>" & Rs("name") & "</td><td align=center bgcolor=#FFFFFF>" & Rs("report") & "/" & Rs("counter") & "</td>"&_
    	"<td bgcolor=#DEE5EF align=center>" & Rs("lasttime") & "/" & Rs("lastname") & "</td></tr>"
Rs.movenext
re=re+1
rc=rc-1
loop
response.write "<tr><td colspan=2>页次：" & pageno & "/" & mpage & "页 每页" & HomePageNO & "条留言 总共" & totalrec & "条留言</td>"&_
"<td align=right colspan=3>分页：[ "
for ii=1 to mpage
  If ii=cint(pageno) then
    response.write "<font color=#808080>" & ii & "</font> "
  Else
    response.write "<b><a href=""?pageno=" & ii & """>" & ii & "</a></b> "
	End If
next
response.write " ]"
end if
Rs.close
set Rs=nothing
conn.close
set conn=nothing
response.write "</td></tr><form method=post action=""serch.asp"" target=_blank name=""serchform""><tr><td colspan=5><a href=""serch.asp"" target=_blank>"&_
"<img src=""images/serch.gif"" border=0 alt=""留言搜索""></a><input type=text szie=25 name=""keywords"" maxlength=20> <input type=submit name=""submit"" value=""快速搜索""></td></tr></form></table>"
call FootHtml()		'网页尾过程
%>