<!--#include file="conn.asp"-->
<!--#include file="inc/char.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!--#include file="inc/theme2.asp"-->
<title>新新百篇</title>
<body oncontextmenu=window.location.reload();event.returnValue=false>
<% dim maxperpage
	'on error resume next
	dim currentpage,page_count,Pcount
	dim totalrec,endpage
	stats="新新百篇"

	if isempty(request("page")) or isNull(request("page")) or (request("page")="")  then
		currentPage=1
	else
		if isInteger(request("page")) then
			currentPage=cint(request("page"))
        	else
			currentPage=1
        	end if
        	if err.number<>0 then 
			err.clear
            		currentPage=1
        	end if
	end if
	
	call headline(1)
	if founderr then
		call error()
	else
		call search()
		if founderr then call error()
	end if
	call endline()
	sub search()

	sql="select top 100 a.boardid,a.isbest,a.rootid,a.announceid,a.body,a.Expression,a.topic,a.username,a.child,a.hits,a.dateandtime,b.indexIMG,b.boardType from bbs1 a inner JOIN board b ON a.boardid=b.boardid where not a.locktopic=2 ORDER BY a.announceID desc"
	set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,1

	if err.number<>0 then 
		Errmsg=Errmsg+"<br>"+"<li>数据库出错，查询失败。"
		founderr=true
	else
		if rs.eof and rs.bof then
		Errmsg=Errmsg+"<br>"+"<li>没有找到您要查询的内容。"
		founderr=true
		else 
		
		maxperpage=25
			rs.PageSize = maxperpage
			rs.AbsolutePage=currentpage
			page_count=0
      			totalrec=rs.recordcount
           		call searchinfo()
			call listPages3()
		end if
	end if
		rs.close
	set rs=nothing
	end sub

	sub searchinfo()
%>
             
            <table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" bgcolor=<%=Tablebackcolor%> align=center>
            <tr><td height=1>
		</td>
            </tr>
            </table>
<TABLE   border=0 cellPadding=0 cellSpacing=0 width="<%=tablewidth%>" align=center>
  <TBODY> 
  <TR > 
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td>
    <TD align=middle  bgColor="<%=Tabletitlecolor%>" width=106 class=coolbg><font color=<%=TableFontcolor%>>栏目</font></TD>
	<td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td>
    <td bgcolor=<%=Tabletitlecolor%> valign=middle align=center class=coolbg> <font color=black> <span style="color:#330000;font-family:arial;font-size:9pt" id="ti"><a href="#;" onclick="location.reload()"><%=now()%></a></span>[<font color=red>右键刷新</font>]</font></td>
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td><TD align=middle bgColor="<%=Tabletitlecolor%>" width=75 class=coolbg><font color=<%=TableFontcolor%>><a href="best100.asp"><img src="<%=picurl&P_Tisbest%>" border=0 alt=百篇精华></a></font></TD>
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td>
  </TR>
  </TBODY> 
</TABLE>
            <table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" bgcolor=<%=Tablebackcolor%> align=center>
            <tr><td height=1>
		</td>
            </tr>
            </table>
            <table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" bgcolor=<%=Tabletitlecolor%> align=center>
            <tr><td height=1>
		</td>
            </tr>
            </table>
<%
       while (not rs.eof) and (not page_count = rs.PageSize)
%>
<TABLE bgColor="<%=Tablebackcolor%>" border=0 cellPadding=0 cellSpacing=0 width="<%=tablewidth%>" align=center>
  <TBODY>
  <TR> 
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1  ></td>
    <TD align=left bgColor="<%=Tablebodycolor%>" width=106 height=18><font color=<%=TableContentcolor%>>
&nbsp;<%if len(rs(11))>0 then%><a href="announce.asp?boardid=<%=rs(0)%>" target=_blank><img src=<%=rs(11)%> border=0></a><%end if%>&nbsp;<a target='_blank' href='list.asp?boardid=<%=rs(0)%>'><font color=#330000><%=rs(12)%> </font></a>
</font>
    </TD> 
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td>
    <TD bgColor=<%=Tablebodycolor%> width=*><font color=<%=TableContentcolor%>>&nbsp;<a href='dispbbs.asp?boardID=<%=rs(0)%>&RootID=<%=rs(2)%>&ID=<%=rs(3)%>&skin=1&viewone=1' target='_blank' title=<%=FormatDateTime(rs(10),2)&"&nbsp;"&FormatDateTime(rs(10),4)&"&nbsp;阅读次数："&rs(9)%>><%if rs(6)="" then%><font color=black><%=left(replace(rs(4),chr(4)," "),20)%>...</font><%else%><font color=black><%if len(rs(6))>18 then%><%=left(replace(rs(6),"&nbsp;",""),18)&"..."%><%else%><%=rs(6)%><%end if%> </font><%end if%></a></font><%
 if rs(1)=1 then%>
 <img src="pic/best.gif" style="filter:chroma(color=white);" alt="精华帖子">
 <%else
   if rs(9)>20 then 
%>

<img src="<%=picurl&P_hotTopic%>" alt="热门帖子">
 
<%end if
end if%>   </TD> 
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td>
    
    <TD bgColor=<%=Tablebodycolor%> width=75><font color=<%=TableContentcolor%>><a href="dispuser.asp?name=<%=htmlencode(rs(7))%>" target="_blank"><font color=#330033><%=htmlencode(rs(7))%></font></a><font color="<%=alertfontcolor%>"> </font>
 

</FONT></TD>
    <td bgcolor=<%=Tablebackcolor%> valign=middle width=1></td></TR> 
</TBODY></TABLE>
            <table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" bgcolor=<%=Tablebackcolor%>  align=center>
            <tr><td height=1>
		</td>
            </tr>
            </table>
<%
	  page_count = page_count + 1
          rs.movenext
        wend
	end sub

	sub listPages3()

	Pcount=rs.PageCount
	response.write "<table border=0 cellpadding=0 cellspacing=3 width="""&tablewidth&""" align=center>"&_
			"<tr><td valign=middle nowrap>"&_
			"<font color="&bodyfontcolor&">页次：<b>"&currentpage&"</b>/<b>"&Pcount&"</b>页"&_
			"每页<b>"&maxperpage&"</b> 帖子数<b>"&totalrec&"</b></font></td>"&_
			"<td valign=middle nowrap><font color="&bodyfontcolor&"><div align=right><p>分页： "

	if currentpage > 4 then
	response.write "<a href=""?page=1"">[1]</a> ..."
	end if
	if Pcount>currentpage+3 then
	endpage=currentpage+3
	else
	endpage=Pcount
	end if
	for i=currentpage-3 to endpage
	if not i<1 then
		if i = clng(currentpage) then
        response.write " <font color="&AlertFontColor&">["&i&"]</font>"
		else
        response.write " <a href=""?page="&i&""">["&i&"]</a>"
		end if
	end if
	next
	if currentpage+3 < Pcount then 
	response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
	end if
	response.write "</p></div></font></td></tr></table>"
	end sub
%>
<!--#include file="footer.asp"-->