<!-- #include file=conn.asp-->
<!-- #include file="inc/const.asp" -->
<SCRIPT src="inc/title.js" type=text/javascript></SCRIPT>
<%
'====================================
'程序名称：精华百分百
'程序作者：痴心无语
'程序内容：调用论坛最近100精华帖
'程序说明：呵呵，无聊之时写的垃圾程序
'程序出自：空谷寻梦社区 www.koomv.com
'====================================
        Dvbbs.LoadTemplates("")
        If Not IsObject(Conn) Then ConnectionDatabase
        Dim SQL,Rs,i,Founderr,Errmsg,aconn
        Founderr=False
	If not Dvbbs.Founduser Then
               Errmsg="<li>你无权查看<b>精华百分百</b>，请先登录或注册后查看！！</li>"
               Response.redirect "showerr.asp?ErrCodes="&errmsg&"&action=OtherErr"
	ELSE
               Dvbbs.Stats="社区精华100帖列表"
               Dvbbs.Nav()
               Dvbbs.Head_var 0,"","精华百分百","Koomv_J.asp"		
	       Call Koomv_Best()	
	END If
	Set aconn=nothing
	Dvbbs.footer()

Sub koomv_Best()
	Response.Write"<div class=""th"" style=""padding-left:20px;"">精华百分百&nbsp;&nbsp;※社区精华帖列表※</div>"
	Response.Write"<table cellspacing=""1"" cellpadding=""3"" border=""0""  class=""tableborder1""><tr class=""tablebody2"" align=""center""><td><font color=red>出自版块</font></td><td><font color=red>表情</font></td><td><font color=red>文&nbsp;&nbsp;章&nbsp;&nbsp;标&nbsp;&nbsp;题</font></td><td width=""85""><font color=red>作&nbsp;&nbsp;&nbsp;&nbsp;者</font></td><td><font color=red>浏览</font></td><td width=""200""><font color=red>最后回复及时间</font></td></tr>"

	DIM n,Boardtype,Expression,LastInfo,LastPostName,LastPostTime
	i=0
	n=100
	SQL="Select top "&n&" A.Topicid,A.Title,A.Boardid,A.postusername,A.lastpost,A.Lastposttime,A.Dateandtime,A.Hits,A.Expression,A.LastPostTime,B.Boardtype from DV_Topic A,DV_Board B Where A.Boardid<>444 and B.Boardid=A.Boardid and A.Isbest=1 order by dateandtime desc"
	Set RS = Dvbbs.Execute(sql)
	If Not RS.Eof then
		SQL = Rs.GetRows(-1)
	ELSE
		Response.Write "本社区暂时还没有精华帖子！"
		Exit Sub
	End If
	RS.Close:Set Rs=nothing
	For i=0 To Ubound(SQL,2)
		Expression = SQL(8,i)
		If Instr(SQL(8,i)&"","|") Then
			Expression = Split(SQL(8,i),"|")(1)
		End If
			If SQL(4,i)<>"" then
				LastInfo=split(SQL(4,i),"$")
				LastPostName = LastInfo(0)
				LastPostTime = LastInfo(2)
			End If
		Response.Write"<tr class=""tablebody1""><td align=""center""><a href=index.asp?boardid="&sql(2,i)&">"&SQL(10,i)&"</a></td>"
		Response.Write"<td align=""center"" class=""tablebody2""><img src='Skins/Default/topicface/"&Expression&"' align=""absmiddle""></td>"
		Response.Write"<td><li></li><a href=dispbbs.asp?boardid="&sql(2,i)&"&id="&sql(0,i)&" target=""_blank"" Title='文章标题："&sql(1,i)&"&#13;&#10;发帖时间："&SQL(6,i)&"'>"&left(sql(1,i),20)&"</a></td>"
		Response.Write"<td align=""center"" class=""tablebody2""><a href='dispuser.asp?name="&SQL(3,i)&"' Title='查看<b>"&SQL(3,i)&"</b>的资料'>"&SQL(3,i)&"</a></td>"
		Response.Write"<td align=""center""><font color=red>"&SQL(7,i)&"</font></td>"
		Response.Write"<td class=""tablebody2""><table width=""195"" cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center""><tr><td width=""120"">"&LastPostTime&"</td><td><font color=red>|&nbsp;</font><a href='dispuser.asp?name="&LastPostName&"'  Title='查看<b>"&LastPostName&"</b>的资料'>"&LastPostName&"</a></td></tr></td></table></tr>"
	NEXT
	Response.Write"</table>"
End Sub
%>