我把程序贴出来给你看看吧。
%
dim shu,news,bigclassid,smallclassid,specialid,order,time,path,click,title
bigclassid=request.querystring("bigclassid")
typeid=request.querystring("typeid")
smallclassid=request.querystring("smallclassid")
specialid=request.querystring("specialid")
shu=request.querystring("shu")
order=request("order")
time=request.querystring("time")
title=request.querystring("title")
click=request.querystring("click")
Path = "./"
if shu<>"" then '显示数目,不加为10
ss=shu
else
ss=10
end if
if order="click" then '排序方式,click为按点击率
oo="click"
else
oo="newsid"
end if
if time="0" then '显示时间,0为不显示
tt=0
else
tt=1
end if
if click="0" then '显示点击数,0为不显示
cc=0
else
cc=1
end if
if title<>"" then '显示数目,不加为10
nn=title
else
nn=20
end if
if typeid<>"" then
set rs=conn.execute("SELECT top "&ss&" * FROM news where typeid="&typeid&" and checkked=1 order by "&oo&" desc")
else
if bigclassid<>"" then
set rs=conn.execute("SELECT top "&ss&" * FROM news where bigclassid="&bigclassid&" and checkked=1 order by "&oo&" desc")
else
if smallclassid<>"" then
set rs=conn.execute("SELECT top "&ss&" * FROM news where smallclassid="&smallclassid&" and checkked=1 order by "&oo&" desc")
else
if specialid<>"" then
set rs=conn.execute("SELECT top "&ss&" * FROM news where specialid="&specialid&" and checkked=1 order by "&oo&" desc")
else
set rs=conn.execute("SELECT top "&ss&" * FROM news where checkked=1 order by "&oo&" desc")
end if
end if
end if
end if
if rs.eof and rs.bof then %>
document.write('没有');
<% else
do while not rs.eof
title=trim(rs("title"))
title=replace(title,"<br>","")
if strcomp(gotTopic(title,nn),title)<0 then
%>
document.write('<LINK href=news.css rel=stylesheet><li><font class=class><A class=class href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=gotTopic(title,nn)%></A><%if tt=1 then%><FONT color="#666666">(<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>)</FONT><%end if%><%if date()-rs("updatetime")<2 then%><FONT color="#ff0000">新!</FONT><%end if%><%if cc=1 then%><FONT color="#666666">(<%=rs("click")%>)</FONT><%end if%></font>');
<%else%>
document.write('<LINK href=news.css rel=stylesheet><li><font class=class><A class=class href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=gotTopic(title,nn)%></A><%if tt=1 then%><FONT color="#666666">(<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>)</FONT><%end if%><%if date()-rs("updatetime")<2 then%><FONT color="#ff0000">新!</FONT><%end if%><%if cc=1 then%><FONT color="#666666">(<%=rs("click")%>)</FONT><%end if%></font>');
<%
end if
rs.movenext
loop
end if
Rs.Close
set Rs=nothing
%>