<!--#include file="conn.asp"-->
<%
' TopNum为列出最新帖子的数目,默认为14
dim topnum,wzcolor,bgc,bgd,rs,rs1,strsql,i,rootid,parentid,boardid,ID,topic,dateandtime,username,s_topic,replyusername
TopNum=14
wzcolor="yellow"
bgc="#85C2E0"
bgd="#DFEFFF"

 set rs = server.CreateObject("ADODB.RecordSet")
 set rs1 = server.CreateObject("ADODB.RecordSet")

 strsql = "Select top "&TopNum&" boardid,rootid,AnnounceID,parentid,username,topic,dateandtime,child  from bbs1  where parentid=0 order by times desc,announceid desc "
 rs.Open strSql, conn, 1, 1
 If rs.Eof or rs.Bof then
   Response.Write "无任何帖子"
 Else
  i=1
  %>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>BODY { 
 SCROLLBAR-FACE-COLOR: #663333; SCROLLBAR-HIGHLIGHT-COLOR: #666666; SCROLLBAR-SHADOW-COLOR: #cccccc; SCROLLBAR-3DLIGHT-COLOR: #fafdfd; SCROLLBAR-ARROW-COLOR: #fafdfd; SCROLLBAR-TRACK-COLOR: #fafdfd; SCROLLBAR-DARKSHADOW-COLOR: #808080 
} 
A:link { 
 FONT-SIZE: 9pt; COLOR: #562323; TEXT-DECORATION: none 
} 
A:visited { 
 FONT-SIZE: 9pt; COLOR: #562323; TEXT-DECORATION: none 
} 
A:active { 
 FONT-SIZE: 9pt; COLOR: #562323; TEXT-DECORATION: none 
} 
A:hover { 
 FONT-SIZE: 9pt; COLOR: #865353; TEXT-DECORATION: underline 
} 
BODY { 
 FONT-SIZE: 9pt 
} 
TABLE { 
 FONT-SIZE: 9pt 
} 
.input1 { 
 BORDER-RIGHT: #663333 1px solid; BORDER-TOP: #663333 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #663333 1px solid; COLOR: #663333; BORDER-BOTTOM: #663333 1px solid; HEIGHT: 16px; BACKGROUND-COLOR: #e2c7ab 
} 
.button1 { 
 border:medium none; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url('images/button1.gif'); WIDTH: 50px; COLOR: #ffffff; HEIGHT: 16px 
} 
INPUT { 
 FONT-SIZE: 12px; COLOR: #3e3e3e; LINE-HEIGHT: 130%; FONT-FAMILY: 宋体,arial 
} 
A { 
 FONT-SIZE: 12px; COLOR: #000000; LINE-HEIGHT: 150%; TEXT-DECORATION: underline 
} 
</STYLE>
<title>New</title>
<link href="images/hc3w_main.css" rel="stylesheet" type="text/css">
</head>

<body background="http://www.wuyi88.com/images/bjxt.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0" oncontextmenu='window.event.returnValue=false' onselectstart='return false' class="coolfont_2">
  <tr>
    <td width="4">&nbsp;</td>
    <td width="*"  align=center><font color="#666666">论坛新帖</font></td>
    <td width="70"><font color="#666666">主题作者</font></td>
    <td width="70"><font color="#666666">最后回复</font></td>
    <td width="130"  align=center><font color="#666666">更新时间</font></td>
  </tr>

         

  <%

  do until rs.Eof or i>TopNum
  
	rootid=rs("rootid")
	parentid=rs("parentid")
	boardid=rs("boardid")
	ID=rs("AnnounceID")
	topic=rs("topic")
        dateandtime=rs("dateandtime")
	username=rs("username")
	if len(topic)>10 then
		s_topic=left(topic,10)+"…"
	else
		s_topic=topic
	end if
	replyusername="---"
	if rs("child")>0 then
          strsql = "Select top 1 username,dateandtime from bbs1  where rootid="&rootid&" and parentid<>0 order by announceid desc "
          rs1.Open strSql, conn, 1, 1
          If not rs1.Eof  then
            replyusername=rs1("username")
            dateandtime=rs1("dateandtime")
          else
            replyusername="---"
  	  end if
  	  rs1.close
  	end if
%>
  <tr>
    <td width="4"><img height="16" src="images/write.gif" width="16" border="0"></td>
    <td width="*"><a href='dispbbs.asp?boardID=<%=boardid%>&RootID=<%=rootid%>&ID=<%=id%>' title='内容提要：<%=topic%>' target=_blank><%=s_topic%></a> </td>
    <td width="70"><font color="#666666"><a href="dispuser.asp?name=<%=username%>" target=_blank><%=username%></a></font></td>
    <td width="70"><font color="#666666"><a href="dispuser.asp?name=<%=replyusername%>" target=_blank><%=replyusername%></a></font></td>
    <td width="130"><font color="#666666"><%=dateandtime%></font></td>
  </tr>


 <%
'    Response.Write  & rs("f_name") & "<i>" & rs("T_Last_Post") & "</i><br>"
    i=I+1
    rs.MoveNext
  loop
 rs.close
 set rs=nothing
 set rs1=nothing
 conn.Close
 set conn = nothing
 end if
%>
</table>

</body>
</html>
