% Dim DBC,Conn Set DBC = New DataBaseClass Set Conn = DBC.OpenConnection() Set DBC = Nothing n=request.querystring("n")'调用新闻数量 nu=request.querystring("nu")'调用字数 d=request.querystring("d")'时间调用,0表示不调用时间,1表示调用时间 ds=request.querystring("ds")'时间显示格式 t=request.querystring("t")'调用类型,1为最新新闻,2为推荐新闻,3为点击排行新闻 cl=request.querystring("cl")'调用栏目的栏目ClassID datesize=request.querystring("datesize")'日期显示大小 datecolor=Replace(Trim(Request.querystring("datecolor")),"'","''")'日期显示大小 al=request.querystring("al") if cint(t)=1 then orders="Newsid" orders1="" elseif cint(t)=2 then orders="Newsid" orders1=" and RecTF=1" elseif cint(t)=3 then orders="ClickNum" elseif t="" then orders="Newsid" orders1="" else response.write "document.write ('错误的新闻类型参数,调用被中止!');" response.end end if if n="" then n1=10 else n1=cint(n) end if if al="" then al1=0 else al1=Cint(al) end if if d="" then d1=0 else d1=Cint(d) end if if ds="" then ds1=1 else ds1=Cint(ds) end if if nu="" then titlenumber=30 else titlenumber=cint(nu) end if if request.querystring("cl")="" then classtf="" else classtf=" and ClassID="& cint(cl) &"" end if if datesize="" then datesize1=9 else datesize1=cint(datesize) end if if datecolor="" then datecolor1="#FF0000" else datecolor1=datecolor end if Function GetNewsDateStr(Flag,DateRule,AddDate,DateSize1,datecolor1) Dim DataRule if Flag = 1 then GetNewsDateStr = "(" if DateRule = 1 then GetNewsDateStr = GetNewsDateStr & "" & year(AddDate) & "-" & month(AddDate) & "-" & day(AddDate) & "" elseif DateRule=2 then GetNewsDateStr = GetNewsDateStr & "" & month(AddDate) & "/" & day(AddDate) & "" elseif DateRule=3 then GetNewsDateStr = GetNewsDateStr & "" & month(AddDate) & "月" & day(AddDate) & "日" elseif DateRule=4 then GetNewsDateStr = GetNewsDateStr & "" & day(AddDate) & "日" elseif DateRule=5 then GetNewsDateStr = GetNewsDateStr & "" & day(AddDate) & "日" & hour(AddDate) & "时" else GetNewsDateStr = GetNewsDateStr & "" & hour(AddDate) &"时" & minute(AddDate) & "分" end if GetNewsDateStr = GetNewsDateStr & ")" else GetNewsDateStr = "" end if End Function if Not(IsNumeric(n) or IsNumeric(nu) or IsNumeric(d) or IsNumeric(t) or IsNumeric(cl)) then response.write "document.write ('错误的参数,调用被中止!');" response.end else set rs=conn.execute("select top "&cint(n1)&" title,HeadNews,HeadNewsPath,FileName,AddNewsDate,ClickNum,RecTF,PicNewsTF,ClassID,NewsPath,FileExtName from News where Audit = 1 and DelFlag=0 "& orders1 &"" &classtf &" ORDER BY "&orders&" desc") Newslist = "
·"&CovtTitle(GotTopic(Rs("Title"),titlenumber))&""& DateStr &" | |
·"&CovtTitle(GotTopic(Rs("Title"),titlenumber))&""& DateStr &" | |
·"&CovtTitle(GotTopic(Rs("Title"),titlenumber))&" | "& DateStr &" |
·"&CovtTitle(GotTopic(Rs("Title"),titlenumber))&" | "& DateStr &" |