GetSiteListFunction.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:3k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <!-- #include file="head.asp" -->
  2. <%dbcate="admin"%>
  3. <!-- #include file="conn.asp" -->
  4. <!-- #include file="RegExpFunction.asp" -->
  5. <%
  6. If NOT ISEMPTY(Request.querystring("ID")) then
  7. If Not IsEmpty(Request.querystring("RemoveID")) then
  8.     If not isempty(Session(SessionStr&"SiteList")) then
  9. Session(SessionStr&"SiteList")=Replace(Session(SessionStr&"SiteList"),Request.querystring("ID")&"|","")
  10. End IF
  11.    
  12. Else
  13. Set conn=ConnectDB()
  14. Response.write GenerateCateLogList(Request.querystring("ID"),Request.querystring("Order"),Request.querystring("LeftNumber"))
  15. CloseDB(conn)
  16. If isempty(Session(SessionStr&"SiteList")) then
  17. Session(SessionStr&"SiteList")=Request.querystring("ID")&"|"
  18. Else
  19. If Instr(Session(SessionStr&"SiteList"),Request.querystring("ID")&"|")<=0 then Session(SessionStr&"SiteList")=Session(SessionStr&"SiteList")&Request.querystring("ID")&"|"
  20. End IF
  21. End If
  22. End If
  23. Function GenerateCateLogList(ID,Order,LeftNumber)
  24.     
  25. call CheckParameter(LeftNumber,"int",0)
  26. call CheckParameter(ID,"int",0)
  27. Set objRS=Server.CreateObject("ADODB.Recordset")
  28. objRS.CursorType = 1
  29. objRS.LockType = 1
  30. objRS.ActiveConnection=Conn
  31. objRS.Source="SELECT * FROM [Linkxml] where [Category_id]="&ID&" and [ShenHe]=1 order by "&Order&" desc"
  32. objRS.Open()
  33. If (Not objRS.bof) And (Not objRS.eof) Then
  34.     
  35. Application.Lock
  36. TFolder=Application(SessionStr&"TFolder")
  37. Application.UnLock
  38.     Set objStream = Server.CreateObject("ADODB.Stream")
  39. With objStream
  40. .Type = 2
  41. .Mode = 3
  42. .Open
  43. .Charset="utf-8"
  44. .Position = objStream.Size
  45. .LoadFromFile Server.MapPath("../TEMPLATE/"&TFolder&"/SiteList.html")
  46. txtcontent=.ReadText
  47. .Close
  48. End With
  49. Set objStream=nothing
  50. For i=1 to objRS.recordcount
  51.          cache_xmllist2=Replace(txtcontent,"<#siteid#>",objRS("id"))
  52. cache_xmllist2=Replace(cache_xmllist2,"<#SiteTitle#>",left(objRS("title"),LeftNumber))
  53.          cache_xmllist2=Replace(cache_xmllist2,"<#SiteArticleNumber#>",ArticleInURL(objRS("id"),conn))
  54.     cache_xmllist=cache_xmllist&cache_xmllist2
  55. objRS.MoveNext
  56. If objRS.eof Then Exit For
  57. Next
  58. End If
  59. objRS.Close
  60. Set objRS=Nothing
  61. GenerateCateLogList=cache_xmllist
  62.   
  63. End Function
  64. Function ArticleInURL(ID,conn)
  65. Set objrs2=Server.CreateObject("ADODB.Recordset")
  66. objrs2.CursorType = 1
  67. objrs2.LockType = 1
  68. objrs2.ActiveConnection=conn
  69. objrs2.Source="SELECT * FROM [Article] WHERE [xmlid]="&ID
  70. objrs2.Open()
  71. If objrs2.recordcount=0 then
  72. ArticleInURL=0
  73. else
  74. ArticleInURL=objrs2.recordcount
  75. end if
  76. objrs2.close
  77. set objrs2=nothing
  78. End Function
  79. %>