<!--#include file="conn.asp"-->
<!--#include file="inc/CHAR.asp"-->
<!--#include file="forum_css.asp"-->
 
<% 
sub endConnection()
conn.close
set conn=nothing
end sub

function changechr(str) 
changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")," "," ") 
end function

function online()
tmprs=conn.execute("Select count(id) from online") 
online=tmprs(0) 
set tmprs=nothing 
if isnull(online) then online=0
end function 
function gettipnum() 
dim tmprs 
tmprs=conn.execute("Select Count(announceID) from bbs1") 
gettipnum=tmprs(0) 
set tmprs=nothing 
if isnull(gettipnum) then gettipnum=0 
end function 

function allusers() 
dim tmprs 
tmprs=conn.execute("Select count(userid) from [user]") 
allusers=tmprs(0) 
set tmprs=nothing 
if isnull(allusers) then allusers=0 
end function 
%>

<!--#include file="inc/const.asp"-->
<!-- #include file="chkuser.asp" -->
<!--#include file="inc/theme.asp"-->
<%
	stats="热门帖子"
	call nav()
	call headline(1)
	call main()
	 call endline()  '读取footer.asp
	sub main()
%>
<head>
</head>
  <table border="0" align=center width="95%" cellspacing="0" cellpadding="0"     >
    <tr>
      <td bgcolor="#8c5900" width="100%" height=1 colspan="5"  ></td>
    </tr>
	<tr>
        <td bgcolor="#f7d7b5" width="100%" align=center colspan="5" background="PIC/refresh.gif" height="24"  >
   <font color="#FF0000">热 门 帖 子</font></td>
    </tr>
	<tr>
      <td bgcolor="#8c5900" width="100%" height=1 colspan="5"  ></td>
    </tr>
    <tr>
      
	  <td bgcolor="#ffe3ce" width="17%">
        <p align="center">版块</p>
      </td>
      <td bgcolor="#ffe3ce" width="37%">
       主&nbsp;&nbsp; 题      
      </td>      
	  <td bgcolor="#ffe3ce" width="10%">
        <p align="center">点击</p>
      </td>
      <td bgcolor="#ffe3ce" width="17%">          
         作 者            
      </td>                          
      <td bgcolor="#ffe3ce" width="25%">           
         日 期                         
    </tr> 
	<tr>
      <td bgcolor="#8c5900" width="100%" height=1 colspan="5"  ></td>
    </tr>
	
  <%                        

sql="SELECT top "&TopUserNum&" board.boardtype,bbs1.username,bbs1.dateandtime,bbs1.topic,bbs1.expression,bbs1.announceid,bbs1.boardid,bbs1.rootid,bbs1.hits FROM bbs1,board where board.boardid=bbs1.boardid ORDER BY bbs1.hits DESC"                         
set rs=server.createobject("adodb.recordset")                        
rs.open sql,conn,1,1                         
%>                        
<%do while Not RS.Eof%> 

    <tr height=20>      
      
	  <td bgcolor="#E6F4FD" width="17%">                      
  <p align="center"><%=changechr(rs("boardtype"))%></font>   
      </td> 
      <td bgcolor="#E6F4FD" width="37%">     
<font style=line-height:120%>                       
 <a href=dispbbs.asp?boardid=<%=rs("boardid")%>&RootID=<%=cstr(rs("RootID"))%>&ID=<%=Cstr(rs("announceID"))%> target=_blank title="<%=changechr(rs("topic"))%> [作者：<%=changechr(rs("username"))%>]">                       
              <%if rs("topic")<>"" then%>                      
              <%if len(changechr(rs("topic")))>16 then%>                      
               <%=left(changechr(rs("Topic")),32)%>...                                      
              <%else%>                                     
             <%=changechr(rs("topic"))%>                                       
              <%end if%><%end if%>                                    
 </a>    
</font>    
      </td>      
	  <td bgcolor="#E6F4FD" width="10%"><font color=red>     
  <p align="center"><%=rs("hits")%></font>   
      </td> 
      <td bgcolor="#E6F4FD" width="17%" >         
   <font style=line-height:120%>
   <a href=javascript:openScript('dispuser.asp?name=<%=changechr(rs("username"))%>',500,310)><%=changechr(rs("username"))%></a> </font>            
      </td>                         
      <td bgcolor="#E6F4FD" width="25%">     
   <%=rs("dateandtime")%>             
</td>                        
    </tr>     
	<tr>
      <td bgcolor="#8c5900" width="100%" height=1 colspan="5"  ></td>
    </tr>
<%                                   
RS.MoveNext                                   
Loop                                   
rs.close                                  
%>                                  
                       
<%end sub%>                     
       
  </table>                        
  </center>                        
                 
 <!--#include file="footer.asp"-->                      
   
