'=================================================
'过程名:ShowNewArticle2
'作 用:显示最新文章
'参 数:ClassID2 -----栏目ID
' ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNewArticle2(ClassID2,ArticleNum,TitleLen)
dim sqlNew,rsNew
if ArticleNum>0 and ArticleNum<=100 then
sqlNew="select top " & ArticleNum
else
sqlNew="select top 10 "
end if
sqlNew=sqlNew & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True and A.ClassID="&ClassID2& " order by A.articleid desc"
Set rsNew= Server.CreateObject("ADODB.Recordset")
rsNew.open sqlNew,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsNew.bof and rsNew.eof then
response.write "<li>没有文章</li>"
else
do while not rsNew.eof
response.Write "<li><a href='" & rsNew("LayoutFileName") & "?ArticleID=" & rsNew("articleid") &"' title='文章标题:" & rsNew("Title") & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "点击次数:" & rsNew("Hits") & "' target='_blank'>" & gotTopic(rsNew("title"),TitleLen) & "</a>[<font color=red>" & formatdatetime(rsNew("UpdateTime"),2) & "</font>]</li><br>"
rsNew.movenext
loop
end if
rsNew.close
set rsNew=nothing
end sub
'过程名:ShowNewArticle2
'作 用:显示最新文章
'参 数:ClassID2 -----栏目ID
' ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNewArticle2(ClassID2,ArticleNum,TitleLen)
dim sqlNew,rsNew
if ArticleNum>0 and ArticleNum<=100 then
sqlNew="select top " & ArticleNum
else
sqlNew="select top 10 "
end if
sqlNew=sqlNew & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True and A.ClassID="&ClassID2& " order by A.articleid desc"
Set rsNew= Server.CreateObject("ADODB.Recordset")
rsNew.open sqlNew,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsNew.bof and rsNew.eof then
response.write "<li>没有文章</li>"
else
do while not rsNew.eof
response.Write "<li><a href='" & rsNew("LayoutFileName") & "?ArticleID=" & rsNew("articleid") &"' title='文章标题:" & rsNew("Title") & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "点击次数:" & rsNew("Hits") & "' target='_blank'>" & gotTopic(rsNew("title"),TitleLen) & "</a>[<font color=red>" & formatdatetime(rsNew("UpdateTime"),2) & "</font>]</li><br>"
rsNew.movenext
loop
end if
rsNew.close
set rsNew=nothing
end sub
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}