⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 js.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
字号:
<!--#include file="Conn.asp"-->
<!--#Include File="Inc/Cl_ClsSysTem.asp"-->
<!--#include file="Inc/Cl_ClsTemplate.asp"-->
<!--#include file="Inc/Cl_Function_Article.asp"-->
<!--#include file="Inc/Cl_Function_Soft.asp"-->
<!--#include file="Inc/Cl_Function_Photo.asp"-->
<!--#include file="Inc/Cl_Function_Movie.asp"-->
<!--#include file="Inc/Cl_Function_Product.asp"-->
<!--#include file="Inc/Cl_Function_Public.asp"-->
<!--#include file="Inc/Cl_GetJsContent.asp"-->
<%
Dim JsID,Rs
Dim XMLCache,NodeCache,OutJsHTML

Call Page_Load()
Call CloseAllObj()

Sub Page_Load()
	JsID = Cl.GetClng(Request.QueryString("ID"))
	If JsID<=0 Then
		Call OutJs("参数错误,调用已中止!")
		Exit Sub
	End If
	Cl.Get_WebSetting()
	If Not IsObject(Application(Cl.CacheName & "_jslist")) Then
		Set XMLCache = Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
		XMLCache.appendChild(XMLCache.createElement("Root"))
		Application.Lock
		Set Application(Cl.CacheName & "_jslist") = XMLCache
		Application.UnLock
		Set XMLCache = Nothing
	End If
	Set XMLCache = Application(Cl.CacheName & "_jslist")
	Set NodeCache = XMLCache.DocumentElement.SelectSingleNode("Item[@JsID='"&JsID&"']")
	If NodeCache Is Nothing Then
		Call UpdateCountCache()
	Else
		Dim RefreshTime,LastTime
		RefreshTime = Cl.GetClng(NodeCache.selectSingleNode("@RefreshTime").text)
		LastTime = NodeCache.selectSingleNode("@LastTime").text
		If RefreshTime>0 and IsDate(LastTime) Then
			If CLng(Datediff("n",LastTime,now())) > RefreshTime Then
				Call UpdateCountCache()
			Else
				OutJsHTML = NodeCache.selectSingleNode("Show").text
			End If
		Else
			Call UpdateCountCache()
		End If
	End if
	Call OutJs(FixJs(OutJsHTML))
	'XMLCache.Save Server.MapPath(InstallDir & DatabaseDir & "count_temp.xml")
	Set XMLCache = Nothing
End Sub

Sub UpdateCountCache()
	Dim Attributes,ChildNode,createCDATASection
	Set Rs = Cl.Execute("Select * From Cl_Js Where ID=" & JsID)
	If Rs.Eof Then
		Call OutJs("找不到指定记录!")
		Rs.Close : Set Rs = Nothing
		Response.end
	End If
	If Rs("JsType")=0 then
		OutJsHTML = Template.ReplaceAllFlag(Rs("Config"))
	Else
		Dim Config
		Config		= Split(Rs("Config"),"@@")
		Config(0)	= Split(Config(0),"||")
		Config(1)	= Split(Config(1),"||")
		OutJsHTML	= GetJsContent(Rs("ModuleID"),Rs("ChannelID"), _
		Config(0)(1),Config(0)(2),Config(0)(3),Config(0)(4),Config(0)(5), _
		Config(0)(6),Config(0)(7),Config(0)(8),Config(0)(9),Config(0)(10), _
		Config(1)(0),Config(1)(1),Config(1)(2),Config(1)(3))
		Config		= Null
	End if
	If Not (NodeCache Is Nothing) Then
	XMLCache.DocumentElement.RemoveChild(NodeCache)
	End if
	Rem 创建节
	Set NodeCache = XMLCache.createNode(1,"Item","")
	Set Attributes = XMLCache.createAttribute("JsID")
	Attributes.text = Rs("ID")
	NodeCache.Attributes.setNamedItem(Attributes)
	Set Attributes = XMLCache.createAttribute("LastTime")
	Attributes.text = Now()
	NodeCache.Attributes.setNamedItem(Attributes)
	Set Attributes = XMLCache.createAttribute("RefreshTime")
	Attributes.text = Rs("RefreshTimes")
	NodeCache.Attributes.setNamedItem(Attributes)
	Set ChildNode = XMLCache.createNode(1,"Show","")
	Set createCDATASection = XMLCache.createCDATASection(OutJsHTML)
	ChildNode.appendChild(createCDATASection)
	NodeCache.appendChild(ChildNode)
	XMLCache.documentElement.appendChild(NodeCache)
	Rem 更新缓存
	Application.Lock
	Set Application(Cl.CacheName & "_jslist") = XMLCache
	Application.UnLock
	Rs.Close : Set Rs = Nothing
End Sub

Function FixJs(ByVal Str)
	Str = Replace(Str,vbCrlf,"\n")
	Str = Replace(Str,Chr(10),"\n")
	Str = Replace(Str,Chr(13),"")
	Str = Replace(Str,"'", "\'")
	FixJs = Str
End Function
Rem 输出JS
Sub OutJs(Str)
	Response.Write("document.write ('" & Str & "');")
End Sub

'==================================================
'CreateLive CMS Version 4.0
'							Powered by Aspoo.Net
'
'邮箱: support@aspoo.cn		Info@aspoo.cn
'QQ: 3315263				596197794
'网站: www.aspoo.cn			www.aspoo.com
'论坛: bbs.aspoo.cn			bbs.aspoo.com
'
'Copyright (C) 2005-2007 Aspoo.Net All Rights Reserved.
'==================================================
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -