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

📄 business.asp

📁 xml缓存类试用版用于ASP
💻 ASP
字号:
<%



Rem 根据classid取列表数据
Function GetListarr(classid,curpage,PageSize,CachePageNum,ByRef RecordCount)
	openConn
	Dim sql
	sql = "select thmid,thmname,picfileurl,win_theme.adddate from win_theme where  win_theme.ClassID="&classid&" order by thmid desc"
	Dim cache
	Set cache = new XmlCacheCls
	cache.PageSize = PageSize			  '每页N条记录
	cache.CachePageNum = CachePageNum		  '一个xml文件缓存M页的数据量
	cache.XmlFile = Server.Mappath("xmlcache/classxml/list_"&classid&".xml")
	cache.Sql = sql
	cache.CurPage = curpage
	cache.CacheType = 1
	Set cache.Conn = conn	
	cache.ReadData
	Dim SqlArr
	SQLArr = cache.SQLArr
	RecordCount = cache.RecordCount
	Set cache = Nothing 
	GetListarr = SqlArr
End Function 


Rem 根据classid生成xml缓存
Function CreateListxml(classid,curpage,PageSize,CachePageNum,CacheTime)
	Dim sql
	sql = "select thmid,thmname,picfileurl,win_theme.adddate from win_theme where  win_theme.ClassID="&classid&" order by thmid desc"
	Dim cache
	Set cache = new XmlCacheCls
	cache.CacheTime = CacheTime '缓存时间
	cache.PageSize = PageSize			  '每页N条记录
	cache.CachePageNum = CachePageNum		  '一个xml文件缓存M页的数据量
	cache.XmlFile = Server.Mappath("xmlcache/classxml/list_"&classid&".xml")
	cache.Sql = sql
	cache.CurPage = curpage
	cache.CacheType = 1
	Set cache.Conn = conn
	cache.WriteDataToXml
	Set cache = Nothing 
End Function 


Rem 根据keyword取列表数据
Function GetSearcharr(keyword,curpage,PageSize,CachePageNum,ByRef RecordCount)
	openConn
	Dim sql
	Dim sqlkey
	sqlkey = Replace(keyword,"'","")
	sql = "select thmid,thmname,picfileurl,win_theme.adddate from win_theme where  ThmName like '%"&sqlkey&"%' or ThmRange  like '%"&sqlkey&"%' or ThmInstro  like '%"&sqlkey&"%'  order by thmid desc"
	Dim cache
	Set cache = new XmlCacheCls
	cache.PageSize = PageSize			  '每页N条记录
	cache.CachePageNum = CachePageNum		  '一个xml文件缓存M页的数据量
	cache.XmlFile = Server.Mappath("xmlcache/searchxml/list_"&Server.URlEncode(Replace(keyword,"'",""))&".xml")
	cache.Sql = sql
	cache.CurPage = curpage
	cache.CacheType = 1
	Set cache.Conn = conn	
	cache.ReadData
	Dim SqlArr
	SQLArr = cache.SQLArr
	RecordCount = cache.RecordCount
	Set cache = Nothing 
	GetSearcharr = SqlArr
End Function 






Rem 根据keyword生成xml缓存
Function CreateSearchxml(keyword,curpage,PageSize,CachePageNum,CacheTime)
	Dim sql
	Dim sqlkey
	sqlkey = Replace(keyword,"'","")
	sql = "select thmid,thmname,picfileurl,win_theme.adddate from win_theme where  ThmName like '%"&sqlkey&"%' or ThmRange  like '%"&sqlkey&"%' or ThmInstro  like '%"&sqlkey&"%'  order by thmid desc"
	Dim cache
	Set cache = new XmlCacheCls
	cache.CacheTime = CacheTime '缓存时间
	cache.PageSize = PageSize			  '每页N条记录
	cache.CachePageNum = CachePageNum		  '一个xml文件缓存M页的数据量
	cache.XmlFile =  Server.Mappath("xmlcache/searchxml/list_"&Server.URlEncode(Replace(keyword,"'",""))&".xml")
	cache.Sql = sql
	cache.CurPage = curpage
	cache.CacheType = 1
	Set cache.Conn = conn
	cache.WriteDataToXml
	Set cache = Nothing 
End Function 

Rem 根据classid取列表数据
Function GetDetailarr(thmid)
	openConn
	Dim sql
	sql = "select a.thmid,a.thmname,a.classid,b.classname,a.picfileurl,a.thmver,a.thmsize,a.thminstro,a.thmrange,a.thmfileurl,a.adddate from win_theme a,Win_Classify b where a.classid=b.classid and  a.thmid="&thmid&""
	Dim thmidmod
	thmidmod = thmid Mod 100
	
	Dim cache
	Set cache = new XmlCacheCls
	cache.XmlFile = Server.Mappath("xmlcache/detailxml/"&thmidmod&"/"&thmid&".xml")
	cache.Sql = sql
	cache.CacheType = 2
	Set cache.Conn = conn	
	cache.ReadData
	Dim SqlArr
	SQLArr = cache.SQLArr
	Set cache = Nothing 
	GetDetailarr = SqlArr
End Function 

Rem 根据keyword生成xml缓存
Function CreateDetailxml(thmid,CacheTime)
	Dim sql
	sql = "select a.thmid,a.thmname,a.classid,b.classname,a.picfileurl,a.thmver,a.thmsize,a.thminstro,a.thmrange,a.thmfileurl,a.adddate from win_theme a,Win_Classify b where a.classid=b.classid and  a.thmid="&thmid&""
	Dim thmidmod
	thmidmod = thmid Mod 100
	Dim cache
	Set cache = new XmlCacheCls
	cache.CacheTime = CacheTime '缓存时间
	cache.XmlFile =  Server.Mappath("xmlcache/detailxml/"&thmidmod&"/"&thmid&".xml")
	cache.Sql = sql
	cache.CacheType = 2
	Set cache.Conn = conn
	cache.WriteDataToXml
	Set cache = Nothing 
End Function


Rem 检测动态数组是否已分配
Function   ismalloc(a)
	On   Error Resume Next 
	Dim   i   
	i   =   UBound(a)
	If Err Then 
	ismalloc = False 
	Else
	ismalloc   =   True   
	End If  
End   Function  



Function showData(SQLArr)

	If Not  ismalloc(SQLArr) Then Exit Function 
	Dim i,k
	Dim num
	num = 0
	i = UBound(SQLArr,1)
	k = UBound(SQLArr,2)
	Dim m,n
	For m = 0 To k
		num = num+1
	%>	
 <ul class="listbox" onMouseOver="overtb(this)" onMouseOut="outtb(this)">
<li>
<a title="<%=SQLArr(1,m)%>" href="detail.asp?id=<%=SQLArr(0,m)%>" target="_blank">
  <img height="140" alt="<%=SQLArr(1,m)%>" src="http://www.shouji138.com<%=SQLArr(2,m)%>" width="107" border="0"></a>
</li>
<li class="green bold">
<a title="<%=SQLArr(1,m)%>" href="detail.asp?id=<%=SQLArr(0,m)%>" target="_blank">
<%=walkgottopic(Trim(SQLArr(1,m)),18)%></a>
</li>
 <li><%=DateValue(SQLArr(3,m))%></li>
 </ul>
	<%
	next
End Function 



Rem 右侧推荐
Function ShowRightTj
	openconn
	Dim sql,rs
	sql = "select top 6 thmid,thmname,picfileurl,adddate from win_theme where isBest=-1 order by thmid desc"
	Set rs = conn.execute(sql)
	While Not rs.eof 
%>
<ul class="listbox2" onMouseOver="overtb(this)" onMouseOut="outtb(this)">
<li>
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>" target="_blank">
<img height="104" alt="<%=rs("thmname")%>" src="http://www.shouji138.com<%=rs("picfileurl")%>" width="80" border="0"></a>
</li>
</ul>
<%
	rs.movenext
Wend
rs.close
Set rs = Nothing 
End Function 



Rem 右侧热门
Function ShowRightHot
	openconn
	Dim sql,rs
	sql = "select top 4 thmid,thmname,picfileurl,adddate from win_theme   order by hits desc"
	Set rs = conn.execute(sql)	
	While Not rs.eof 
%>
<ul class="listbox2" onMouseOver="overtb(this)" onMouseOut="outtb(this)">
<li>
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>" target="_blank">
<img height="104" alt="<%=rs("thmname")%>" src="http://www.shouji138.com<%=rs("picfileurl")%>" width="80" border="0"></a>
</li>
</ul>
<%
	rs.movenext
Wend
rs.close
Set rs = Nothing 
End Function 


Rem 首页按类别显示
Function ShowIndexClass(classid)
	openconn
	Dim sql,rs
	sql = "select top 10 thmid,thmname,picfileurl,adddate from win_theme where classid="&classid&" order by thmid desc"
	Set rs = conn.execute(sql)	
	While Not rs.eof 
%>
 <ul class="listbox" onMouseOver="overtb(this)" onMouseOut="outtb(this)">
<li>
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>" target="_blank">
  <img height="140" alt="<%=rs("thmname")%>" src="http://www.shouji138.com<%=rs("picfileurl")%>" width="107" border="0"></a>
</li>
<li class="green bold">
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>" target="_blank">
<%=walkgottopic(Trim(rs("thmname")),18)%></a>
</li>
 <li><%=DateValue(rs("adddate"))%></li>
 </ul>
<%
	rs.movenext
Wend
rs.close
Set rs = Nothing 
End Function 



Rem 详细页面推荐
Function ShowDetailtj
	openconn
	Dim sql,rs
	sql = "select top 15 thmid,thmname,picfileurl,adddate from win_theme where isBest=-1 order by thmid desc"
	Set rs = conn.execute(sql)	
	While Not rs.eof 
%>
 <ul class="listbox" onMouseOver="overtb(this)" onMouseOut="outtb(this)">
<li>
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>">
  <img height="140" alt="<%=rs("thmname")%>" src="http://www.shouji138.com<%=rs("picfileurl")%>" width="107" border="0"></a>
</li>
<li class="green bold">
<a title="<%=rs("thmname")%>" href="detail.asp?id=<%=rs("thmid")%>">
<%=walkgottopic(Trim(rs("thmname")),18)%></a>
</li>
 <li><%=DateValue(rs("adddate"))%></li>
 </ul>
<%
	rs.movenext
Wend
rs.close
Set rs = Nothing 
End Function 
%>

⌨️ 快捷键说明

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