<%@ codepage ="936" %>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''
TopicCount=cint(trim(request("TopicCount"))) '调用TOP几条
TitleCount=cint(trim(request("TitleCount"))) '每行贴子的调用字符数
NewUrl="bbs/" '为空则为当前目录
icon=trim(request("icon")) '标题栏前面的图标，支持HTML代码
'''''''以下无需修改''''''''
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr=Application("bbs_connstr")
Conn.Open connstr
dim rs,sql
set rs=server.createobject("adodb.recordset")
if Request("forumid") = "" then
sql="select top "&TopicCount&" id,forumid,topic,lasttime,Views,deltopic from forum where deltopic=0 order by lasttime desc"
else
sql="select top "&TopicCount&" id,forumid,topic,lasttime,Views,deltopic from forum where forumid="&Request("forumid")&" and deltopic=0 order by lasttime desc"
end if
rs.open sql,conn,1,1
do while Not RS.Eof
topic=rs("Topic")
if len(topic)>TitleCount then
	topic = left(topic,TitleCount)&"..."
end if
list=list&""&icon&" <a href="&NewUrl&"showtopic.asp?id="&rs("id")&"&forumid="&rs("forumid")&" target=_blank>"&topic&"</a><br>"
RS.MoveNext
Loop
if list="" then list="·<a href="&NewUrl&" target=_blank>暂无新贴,请登录论坛!</a>"
response.write "document.write('"&list&"');"
response.end
rs.close
set rs=nothing
conn.close
set conn=nothing
%>