在后台文章管理界面里,可通过修改文章添加时间来重新对文章顺序进行排列,但现在问题来了,在后台对文章重新拍寻后,前台{$GetNextArticle}和{$GetPrevArticle}生成的顺和后台的顺不一致,因为这两个标签是按照文章的ID号排序的,我已经找到了相关函数,请问能否修改一下,让这两个标签也按照文章的“时间”顺序排列。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 = "No More"
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