'=================================================
'过程名:ShowPrevArticle
'作 用:显示上一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowPrevArticle(TitleLen)
dim rsPrev,sqlPrev
sqlPrev="Select Top 1 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName From Article A inner join Layout L on A.LayoutID=L.LayoutID Where Deleted=False and Passed=True and ClassID=" & rs("ClassID") & " and ArticleID<" & rs("ArticleID")& " order by ArticleID DESC"
Set rsPrev= Server.CreateObject("ADODB.Recordset")
rsPrev.open sqlPrev,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsPrev.Eof then
response.write "没有了"
else
response.write "<a href='" & rsPrev("LayoutFileName") & "?ArticleID=" & rsPrev("ArticleID")& "' title='文章标题:" & rsPrev("Title") & vbcrlf & "作 者:" & rsPrev("Author") & vbcrlf & "更新时间:" & rsPrev("UpdateTime") & vbcrlf & "点击次数:" & rsPrev("Hits") &"'>" & gotTopic(rsPrev("Title"),TitleLen) & "</a>"
end if
rsPrev.close
set rsPrev=nothing
end sub
'=================================================
'过程名:ShowNextArticle
'作 用:显示上一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNextArticle(TitleLen)
dim rsNext,sqlNext
sqlNext="Select Top 1 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName From Article A inner join Layout L on A.LayoutID=L.LayoutID Where Deleted=False and Passed=True and ClassID=" & rs("ClassID") & " and ArticleID>" & rs("ArticleID")& " order by ArticleID ASC"
Set rsNext= Server.CreateObject("ADODB.Recordset")
rsNext.open sqlNext,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsNext.Eof then
response.write "没有了"
else
response.write "<a href='"& rsNext("LayoutFileName") & "?ArticleID="&rsNext("ArticleID")& "' title='文章标题:" & rsNext("Title") & vbcrlf & "作 者:" & rsNext("Author") & vbcrlf & "更新时间:" & rsNext("UpdateTime") & vbcrlf & "点击次数:" & rsNext("Hits") &"'>" & gotTopic(rsNext("Title"),TitleLen) & "</a>"
end if
rsNext.close
set rsNext=nothing
end sub
参考一下。
中国人的财富网:http://www..cn/