GetSiteListFunction.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:3k
- <!-- #include file="head.asp" -->
- <%dbcate="admin"%>
- <!-- #include file="conn.asp" -->
- <!-- #include file="RegExpFunction.asp" -->
- <%
- If NOT ISEMPTY(Request.querystring("ID")) then
- If Not IsEmpty(Request.querystring("RemoveID")) then
- If not isempty(Session(SessionStr&"SiteList")) then
- Session(SessionStr&"SiteList")=Replace(Session(SessionStr&"SiteList"),Request.querystring("ID")&"|","")
- End IF
-
- Else
- Set conn=ConnectDB()
- Response.write GenerateCateLogList(Request.querystring("ID"),Request.querystring("Order"),Request.querystring("LeftNumber"))
- CloseDB(conn)
- If isempty(Session(SessionStr&"SiteList")) then
- Session(SessionStr&"SiteList")=Request.querystring("ID")&"|"
- Else
- If Instr(Session(SessionStr&"SiteList"),Request.querystring("ID")&"|")<=0 then Session(SessionStr&"SiteList")=Session(SessionStr&"SiteList")&Request.querystring("ID")&"|"
- End IF
- End If
- End If
- Function GenerateCateLogList(ID,Order,LeftNumber)
-
- call CheckParameter(LeftNumber,"int",0)
- call CheckParameter(ID,"int",0)
- Set objRS=Server.CreateObject("ADODB.Recordset")
- objRS.CursorType = 1
- objRS.LockType = 1
- objRS.ActiveConnection=Conn
- objRS.Source="SELECT * FROM [Linkxml] where [Category_id]="&ID&" and [ShenHe]=1 order by "&Order&" desc"
- objRS.Open()
- If (Not objRS.bof) And (Not objRS.eof) Then
-
- Application.Lock
- TFolder=Application(SessionStr&"TFolder")
- Application.UnLock
- Set objStream = Server.CreateObject("ADODB.Stream")
- With objStream
- .Type = 2
- .Mode = 3
- .Open
- .Charset="utf-8"
- .Position = objStream.Size
- .LoadFromFile Server.MapPath("../TEMPLATE/"&TFolder&"/SiteList.html")
- txtcontent=.ReadText
- .Close
- End With
- Set objStream=nothing
- For i=1 to objRS.recordcount
- cache_xmllist2=Replace(txtcontent,"<#siteid#>",objRS("id"))
- cache_xmllist2=Replace(cache_xmllist2,"<#SiteTitle#>",left(objRS("title"),LeftNumber))
- cache_xmllist2=Replace(cache_xmllist2,"<#SiteArticleNumber#>",ArticleInURL(objRS("id"),conn))
- cache_xmllist=cache_xmllist&cache_xmllist2
- objRS.MoveNext
- If objRS.eof Then Exit For
- Next
- End If
- objRS.Close
- Set objRS=Nothing
- GenerateCateLogList=cache_xmllist
-
-
- End Function
- Function ArticleInURL(ID,conn)
- Set objrs2=Server.CreateObject("ADODB.Recordset")
- objrs2.CursorType = 1
- objrs2.LockType = 1
- objrs2.ActiveConnection=conn
- objrs2.Source="SELECT * FROM [Article] WHERE [xmlid]="&ID
- objrs2.Open()
- If objrs2.recordcount=0 then
- ArticleInURL=0
- else
- ArticleInURL=objrs2.recordcount
- end if
- objrs2.close
- set objrs2=nothing
- End Function
- %>