ks_cls/ks.rcls.asp
'函数名:ReplacePrevNext
'作 用:上一篇、下一篇
'参 数:NowID 现在ID,Tid 目录ID,TypeStr类型
'*********************************************************************************************************
Function ReplacePrevNext(ChannelID,NowID, Tid, TypeStr)
Dim SqlStr
Select Case KS.C_S(ChannelID,6)
Case 1:SqlStr="SELECT Top 1 ID,Title,Tid,InfoPurview,ReadPoint,Fname,Changes"
Case 2,3,4,7:SqlStr="SELECT Top 1 ID,Title,Tid,InfoPurview,ReadPoint,Fname,0"
Case 8:SqlStr="SELECT Top 1 ID,Title,Tid,0,0,Fname,0"
Case 5:SqlStr=" SELECT Top 1 ID,Title,Tid,0,0,Fname,0"
Case Else :ReplacePrevNext="":Exit Function
End Select
SqlStr=SqlStr & " From " & KS.C_S(ChannelID,2) & " Where Tid='" & Tid & "' And ID" & TypeStr & NowID & " And Verific=1 and DelTF=0 Order By ID"
If TypeStr=">" Then SqlStr=SqlStr & " asc" else SqlStr=SqlStr & " desc"
Dim RS:Set RS=Conn.Execute(SqlStr)
If RS.EOF And RS.BOF Then
ReplacePrevNext = "没有了"
Else
ReplacePrevNext = "<a href=""" & KS.GetInfoUrl(KS.C_S(ChannelID,0),RS(2),RS(0),RS(5),RS(4),RS(3),RS(6)) & """ title=""" & RS(1) & """>" & RS(1) & "</a>"
End If
RS.Close:Set RS = Nothing
End Function