<%
dim Site_Name,Site_Url,Site_Memo,Site_Pass,Site_Div,Site_Copyright,Site_AdminDiv,Site_ClassSkinId
set rs=server.createobject("adodb.recordset")
   rs.open"select * from ConFig",conn,1,3
   Site_Name=rs("Site_Name")
   Site_ClassSkinId=int(rs("Site_ClassSkinId"))
   Site_Url=rs("Site_Url")
   Site_Pass=rs("Site_Pass")
   Site_Div=rs("Site_Div")
   Site_AdminDiv=rs("Site_AdminDiv")
   Site_Copyright=rs("Site_Copyright")
   Site_Memo=rs("Site_Memo")
   rs.close
set rs=nothing
//网站主要标签
Sub SiteLable()
    strOut=Replace(strOut,"$Site_Name$",Site_Name)
	strOut=Replace(strOut,"$Site_Url$",Site_Url)
	strOut=Replace(strOut,"$Site_Memo$",Site_Memo)
	strOut=Replace(strOut,"$Site_Pass$",Site_Pass)
	strOut=Replace(strOut,"$Site_Copyright$",Site_Copyright)
	strOut=Replace(strOut,"$Site_Div$",Site_Div)
	strOut=Replace(strOut,"$Site_Tjl$",Site_Tjl)
end Sub
//网站单个标签
Sub ClassLabel()
	   StrClass=StrClass & "<table width='960' border='0' cellpadding='0' cellspacing='0'>"
       rs.open"select UrlClass_Id,UrlClass_Name,UrlClass_Search from UrlClass where UrlClass_ClassId="&Class_Id&" order by UrlClass_Id",conn,1,3
	   while not rs.eof and not rs.bof
	   Search_Html=""
	   StrClass=StrClass & "<tr><td width='100%' height='20' align='center' class='classtitle'>"&rs("UrlClass_Name")&"</td></tr><tr><td class='urlt1'><table width='100%'  border='0' cellspacing='1' cellpadding='5'>"
	   
	   rss.open "select Url_Name,Url_Url from Url where Url_UrlClassId="&rs("UrlClass_Id")&" order by Url_TopId desc,Url_Id",conn,1,3
	   jishu=1
while not rss.eof
	if jishu=1 or jishu mod 4 = 1 then
		StrClass=StrClass & "<tr class='urlt2'><td width='25%'><a href='"&rss("Url_Url")&"' class='imagesdiv'>"&rss("Url_Name")&"</a></td>"
		else
		StrClass=StrClass & "<td width='25%'><a href='"&rss("Url_Url")&"' class='imagesdiv'>"&rss("Url_Name")&"</a></td>"
	end if
	if jishu mod 4 =0  then StrClass=StrClass & "</tr>"
	jishu=jishu+1
	rss.movenext
wend
jishu=jishu-1
if jishu mod 4 <> 0 then
for i= 1 to 4-(jishu mod 4)
	StrClass=StrClass & "<td width='25%'>&nbsp;</td>"
	if  i = 4-(jishu mod 4) then StrClass=StrClass & "</tr>"
next
end if
rss.close
UrlClass_Search=Trim(rs("UrlClass_Search"))
if UrlClass_Search<>"" then
   GetSearch=Split(UrlClass_Search, ",")
   For s = 0 To UBound(GetSearch)
       Search_Name=GetSearch(s)
       Search_Html=Search_Html & "&nbsp;&nbsp;<a href=http://www.baidu.com/s?tn=hao251_pg&wd="&Search_Name&"><font color='#0066FF'>"&Search_Name&"</font></a>"
   Next
    StrClass=StrClass & "<tr class='urlt2'><td colspan='4' class='fieldsetf12 f13px'>&nbsp;&nbsp;<B>相关搜索：</B>"& Search_Html &"</td></tr></table>"
else
   StrClass=StrClass & "</table>"
end if
rs.movenext
wend
rs.close
StrClass=StrClass & "</td></tr></table>"
strOut=Replace(strOut,"$StrClass$",StrClass)
end Sub
//网站全部标签
Sub ClassAllLabel()
       StrClass=""
	   StrClass=StrClass & "<table width='960' border='0' cellpadding='0' cellspacing='0'>"
       rs.open"select UrlClass_Id,UrlClass_Name,UrlClass_Search from UrlClass where UrlClass_ClassId="&ClassArray(i,0)&" order by UrlClass_Id",conn,1,3
	   while not rs.eof and not rs.bof
	   Search_Html=""
	   StrClass=StrClass & "<tr><td width='100%' height='20' align='center' class='classtitle'>"&rs("UrlClass_Name")&"</td></tr><tr><td class='urlt1'><table width='100%'  border='0' cellspacing='1' cellpadding='5'>"
	   
	   rss.open "select Url_Name,Url_Url from Url where Url_UrlClassId="&rs("UrlClass_Id")&" order by Url_TopId desc,Url_Id",conn,1,3
	   jishu=1
while not rss.eof
	if jishu=1 or jishu mod 4 = 1 then
		StrClass=StrClass & "<tr class='urlt2'><td width='25%'><a href='"&rss("Url_Url")&"' class='imagesdiv'>"&rss("Url_Name")&"</a></td>"
		else
		StrClass=StrClass & "<td width='25%'><a href='"&rss("Url_Url")&"' class='imagesdiv'>"&rss("Url_Name")&"</a></td>"
	end if
	if jishu mod 4 =0  then StrClass=StrClass & "</tr>"
	jishu=jishu+1
	rss.movenext
wend
jishu=jishu-1
if jishu mod 4 <> 0 then
for k= 1 to 4-(jishu mod 4)
	StrClass=StrClass & "<td width='25%'>&nbsp;</td>"
	if  k = 4-(jishu mod 4) then StrClass=StrClass & "</tr>"
next
end if
rss.close
UrlClass_Search=Trim(rs("UrlClass_Search"))
if UrlClass_Search<>"" then
   GetSearch=Split(UrlClass_Search, ",")
   For s = 0 To UBound(GetSearch)
       Search_Name=GetSearch(s)
       Search_Html=Search_Html & "&nbsp;&nbsp;<a href=http://www.baidu.com/s?tn=hao251_pg&wd="&Search_Name&"><font color='#0066FF'>"&Search_Name&"</font></a>"
   Next
    StrClass=StrClass & "<tr class='urlt2'><td colspan='4' class='fieldsetf12 f13px'>&nbsp;&nbsp;<B>相关搜索：</B>"& Search_Html &"</td></tr></table>"
else
   StrClass=StrClass & "</table>"
end if
rs.movenext
wend
rs.close
StrClass=StrClass & "</td></tr></table>"
strOut=Replace(strOut,"$StrClass$",StrClass)
end Sub

Function IsExists(byref filespec) 
	If (FSO.FileExists(server.MapPath(filespec))) Then
	IsExists = True
	Else
	IsExists = False
	End If
End Function
Function IsFolder(byref Folder)
	If FSO.FolderExists(server.MapPath(Folder)) Then  
	IsFolder = True
	Else
	IsFolder = False
	End If
End Function

Function CreateFolder(byref fldr) 
	Dim f
	Set f = FSO.CreateFolder(Server.MapPath(fldr))
	CreateFolder=f.Path
	Set f=nothing
End Function
Sub Createfiles(byref filedata) 
	Dim f
	Set f = FSO.CreateTextFile(Server.MapPath(strFile))
	f.write filedata
	Set f=nothing
End sub
Function Openfiles(oldFile) 
	Dim f
	Set f = FSO.OpenTextFile(Server.MapPath(oldFile))
	Openfiles=f.Readall
	Set f=nothing
End Function
%>
