3.0增加上一篇、下一篇功能_風(fēng)訊Cms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      使用方法:在需要調(diào)用的地方直接調(diào)用“{FS_上一篇}”和{FS_下一篇}標(biāo)簽就行了。

      最終效果如:

      上一篇:6日IT:賽門鐵克公布完成Veritas收購交易
      下一篇:日本政府出售中日本鐵路價(jià)值46億美元的股份

      修改方法:

      打開修改/admin/Refresh/Function.asp文件

      第一步,在第一行<%后(也就是第二行)增加

      dim NextTempStr,PreviousTempStr

      第二步,在Content = GetVisionStr & Content這一行

      在下面增加

      Content = Replace(Content,"{FS_上一篇}",PreviousTempStr)
      Content = Replace(Content,"{FS_下一篇}",NextTempStr)

      第三步,找到Function RefreshNews(NewsRecordSetObj)

      在下面增加

      '生成上一篇下一篇
      dim NowNewsID,NowClassID
      NowNewsID = NewsRecordSetObj("ID")
      NowClassID = NewsRecordSetObj("ClassID")
      dim NextSql,NextRs,NextClassRs
      '上一篇
      NextSql = "Select TOP 1 id,NewsID,ClassID,Title,Path,FileName,FileExtName From News where ID < " & NowNewsID & " and ClassID = '" & NowClassID & "' order by id desc"
      Set NextRs = Conn.Execute(NextSql)
      If NextRs.eof or NextRs.bof Then
      PreviousTempStr = "上一篇:沒有了"
      Else
      Set NextClassRs = Conn.Execute("Select SaveFilePath,ClassEName from NewsClass where ClassID='" & NowClassID & "'")
      If not NextRs.eof then PreviousTempStr = "上一篇:<a href='" & NextClassRs(0) & "/" & NextClassRs(1) & "/" & NextRs(5) & "." & NextRs(6) & "' title ='"&NextRs(3)&"'>"&NextRs(3)&"</a>"
      NextClassRs.Close
      Set NextClassRs = nothing
      NextRs.Close
      Set NextRs = nothing
      End If
      '下一篇
      NextSql = "Select TOP 1 id,NewsID,ClassID,Title,Path,FileName,FileExtName From News where ID > " & NowNewsID & " and ClassID = '" & NowClassID & "' order by id"
      Set NextRs = Conn.Execute(NextSql)
      If NextRs.eof or NextRs.bof Then
      NextTempStr = "下一篇:沒有了"
      Else
      Set NextClassRs = Conn.Execute("Select SaveFilePath,ClassEName from NewsClass where ClassID='" & NowClassID & "'")
      If not NextRs.eof then NextTempStr = "下一篇:<a href='" & NextClassRs(0) & "/" & NextClassRs(1) & "/" & NextRs(5) & "." & NextRs(6) & "' title ='"&NextRs(3)&"'>"&NextRs(3)&"</a>"
      NextClassRs.Close
      Set NextClassRs = nothing
      NextRs.Close
      Set NextRs = nothing
      End If
      '完成

      討論區(qū): http://bbs.foosun.net/dispbbs.asp?boardID=22&ID=5366&page=1

      查看更多 風(fēng)訊cms教程  風(fēng)訊cms模板

      來源:模板無憂//所屬分類:風(fēng)訊Cms教程/更新時(shí)間:2006-06-16
      相關(guān)風(fēng)訊Cms教程