2005/07/31 | ShowNewArticle2
类别(web) | 评论(0) | 阅读(92) | 发表于 08:42
'=================================================
'过程名: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
0

评论Comments

日志分类
首页[297]
asp.net[10]
web[118]
未来[2]
开发[28]
资源链接[40]
time[4]
ftp[5]
java[89]
xhtml+div[0]
网页设计[0]
asp[0]
flash[1]