<%
'******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'******************************************************
	set rs = server.createobject("adodb.recordset")
	sql="select wait_masan,wait_masi from book_management"
	rs.open sql,dbok,1,1
	
	if trim(rs("wait_masan")) = 302 then
	 response.write rs("wait_masi")
	 response.end
	end if
	
	rs.Close
	set conn=nothing
	sys_title = "{sys:title}"

function Memu(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Memu:\{(.+?)\}>([\s\S]*?)<Memu>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	Language=nbq(bq,"Language")
	Row=nbq(bq,"Row")
	Ysort=nbq(bq,"Ysort")
	str=replace(str,match,Getmemu(Language,Row,nr,Ysort))
	next
	Memu=str
end function

function Getmemu(Language,Row,yida_cms,Ysort)
  set rs = server.createobject("adodb.recordset")
  sql="select top "&Row&" * from shuaiweb_navigation where wait_nasi = 0 and yida_language = '" & Language & "' order by sort asc"
  rs.open sql,dbok,1,1
  do while not rs.eof

	yidacms_tag_nv = replace(rs("url"),"{yidacms:webpath}",webpath)

if Ysort = ""&rs("sort")&"" then
 d_sort = "class='TXW_nv'"
  else
 d_sort = ""
end if

yida_cms1=replace(yida_cms,"{Memu:name}",rs("title"))
yida_cms2=replace(yida_cms1,"{Memu:target}",rs("wait_nayi"))
yida_cms3=replace(yida_cms2,"{Memu:url}",yidacms_tag_nv)
yida_cms4=replace(yida_cms3,"{Memu:sort}",d_sort)
tt=tt+yida_cms4
  rs.movenext
  loop
	rs.Close
	set rs=nothing
Getmemu=tt
end Function

function Y_Memu(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Y_Memu:\{(.+?)\}>([\s\S]*?)<Y_Memu>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	Language=nbq(bq,"Language")
	Row=nbq(bq,"Row")
	Ysort=nbq(bq,"Ysort")
	str=replace(str,match,Y_Getmemu(Language,Row,nr,Ysort))
	next
	Y_Memu=str
end function

function Y_Getmemu(Language,Row,yida_cms,Ysort)
yida_cms = yida_cms & "<DIV class=navigation>"&vbLf
 yida_cms = yida_cms & "<UL class=menu id=menu-mainmenu>"&vbLf
  set rs = server.createobject("adodb.recordset")
  sql="select TOP "&Row&" * from shuaiweb_navigation where wait_nasi = 0 and yida_language = '" & Language & "' order by sort asc"
  rs.open sql,dbok,1,1
	do while not rs.eof

	yidacms_tag_nv1 = replace(rs("url"),"{yidacms:webpath}",webpath)

if Ysort = ""&rs("sort")&"" then
 d_sort = "class='TXW_nv'"
  else
 d_sort = ""
end if

    yida_cms = yida_cms & "<LI id=menu-item-382><a href='"&yidacms_tag_nv1&"' target='"&rs("wait_nayi")&"' "&d_sort&">"&rs("title")&"</a>"&vbLf
		set rss = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_navigation where wait_nasi = " & rs("id") & " and yida_language = '" & Language & "' order by sort asc"
		rss.open sql,dbok,1,1
				yida_cms = yida_cms & "		<UL>"&vbLf

				do while not rss.eof

					yidacms_tag_nv2 = replace(rss("url"),"{yidacms:webpath}",webpath)


				yida_cms = yida_cms & "			<LI id=menu-item-376><a href='"&yidacms_tag_nv2&"' target='"&rs("wait_nayi")&"'>"&rss("title")&"</a></LI>"&vbLf
				rss.movenext
				Loop
				yida_cms = yida_cms & "		</UL>"&vbLf
			rss.close
			set rss = nothing
    yida_cms = yida_cms & "</LI>"&vbLf
	rs.movenext
	loop
 yida_cms = yida_cms & "</UL>"&vbLf
yida_cms = yida_cms & "</DIV>"&vbLf
tt=tt+yida_cms
Y_Getmemu = tt
end Function

function sys(a)
	dim qiao
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_system"
	rs.open sql,dbok,1,1
        a = replace(a,sys_title,sw_webtitle & Title)
        a = replace(a,"{sys:weburl}",sw_dizhi)
        a = replace(a,"{sys:gongsibiaoti}",co_name)
        a = replace(a,"{sys:gongsidizhi}",sw_gongsidizhi)
        a = replace(a,"{sys:dianhua}",sw_dianhua)
        a = replace(a,"{sys:yidongdianhua}",sw_yidongdianhua)
        a = replace(a,"{sys:chuanzhen}",sw_chuanzhen)
        a = replace(a,"{sys:qq}",sw_qq)
        a = replace(a,"{sys:lianxiren}",sw_lianxiren)
        a = replace(a,"{sys:beian}",sw_beian)
        a = replace(a,"{sys:tongji}",rs("statistics"))
        a = replace(a,"{sys:youxiang}",sw_youxiang)
        a = replace(a,"{sys:youbian}",sw_youbian)
        a = replace(a,"{sys:keywords}",rs("keywords"))
        a = replace(a,"{sys:descriptions}",rs("descriptions"))
        a = replace(a,"{sys:logo}",sw_dizhi & rs("wait_si"))
        a = replace(a,"{yidacms:webpath}",webpath)
        qiao = rs("wait_er")
        Sys=a
	rs.Close
	set rs=nothing
end function

function en_sys(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_system_en"
	rs.open sql,dbok,1,1
        a = replace(a,"{en_sys:title}",rs("en_webtitle"))
        a = replace(a,"{en_sys:gongsibiaoti}",rs("en_cotitle"))
        a = replace(a,"{en_sys:gongsidizhi}",rs("en_coaddress"))
        a = replace(a,"{en_sys:keywords}",rs("en_keywords"))
        a = replace(a,"{en_sys:descriptions}",rs("en_descriptions"))
        en_sys=a
	rs.Close
	set rs=nothing
end function

function Flash(str)
set reg=new regexp
reg.IgnoreCase = False 
reg.Global = True 
reg.Pattern = "{Flash:\{(.+?)\}}"
set aa=reg.execute(str)
FOR each match in aa
bq=match.submatches(0)
X=nbq(bq,"X")
Y=nbq(bq,"Y")
str=replace(str,match,GetFlash(X,Y))
NEXT
Flash=str
end function

	Function GetFlash(x,y)
	'dim flashswf,tag
	  set rs = server.createobject("adodb.recordset")
	  sql="select top "&TXW_flashnumber&" * from shuaiweb_flash order by id desc"
	  rs.open sql,dbok,1,1
	  if rs.bof and rs.eof then
		tag = zanwuflash
	  else
		do
			flash1 = flash1&"files+='|"& sw_dizhi & rs("shuaiweb_pic") &"';links+='|" & rs("shuaiweb_picurl") & "'" &vbcrlf
		 rs.movenext
		loop until rs.eof
	  end if
	rs.Close
	set rs=nothing
			tag = tag&"<SCRIPT type=text/javascript> "&vbLf
			tag = tag&"var swf_width="&x&"; "&vbLf
			tag = tag&"var swf_height="&y&"; "&vbLf
			tag = tag&"var config='5|0xffffff|0x333333|80|0xffffff|0x666666|0xff0000';"&vbLf
			tag = tag&"var files='',links='', texts=''; "&vbLf
			tag = tag&""&flash1&"; "&vbLf
			tag = tag&"files=files.substring(1);links=links.substring(1);texts=texts.substring(1); "&vbLf
			tag = tag&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width="&x&" height="&y&">'); "&vbLf
			tag = tag&"document.write('<param name=""movie"" value="""&sw_dizhi&"images/focus.swf"" />'); "&vbLf
			tag = tag&"document.write('<param name=""quality"" value=""high"" />'); "&vbLf
			tag = tag&"document.write('<param name=""menu"" value=""false"" />'); "&vbLf
			tag = tag&"document.write('<param name=wmode value=""opaque"" />'); "&vbLf
			tag = tag&"document.write('<param name=""FlashVars"" value=""config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'""/>'); "&vbLf
			tag = tag&"document.write('<embed src="""&sw_dizhi&"images/focus.swf"" wmode=""opaque"" FlashVars=""config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'""& menu=""false"" quality=""high"" width="&x&" height="&y&" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />'); document.write('</object>');"&vbLf
			tag = tag&"</SCRIPT> "&vbLf
GetFlash=tag
	end Function 


	Function Fanhui(a)
        fanhuiup = "<a href=""javascript:history.go(-1)""><font color=""#0099FF"">"&fanhuishangyiye&"</font></a>"
        a = replace(a,"{Fanhui:up}",fanhuiup)
        Fanhui = a
	End Function

	Function Swsy(a)
        tswsy = "<a href=# onclick=""this.style.behavior='url(#default#homepage)';this.setHomePage('"&sw_dizhi&"');"" target=""_parent"">"&sheweishouye&"</a>"
        a = replace(a,"{Swsy:y}",tswsy)
        Swsy = a
	End Function

	Function Scbz(a)
        tscbz = "<a href=""javascript:window.external.AddFavorite('" & sw_dizhi & "','" & co_name & "')"" target=""_parent"">"&shoucangbenzhan&"</a>"
        a = replace(a,"{Swsy:c}",tscbz)
        Scbz = a
	End Function

	Function Buy(a)
        yidabuy = "<a href=""#"" onClick=""window.open('" & sw_dizhi & "buy.asp?id={Products:id}','go','scrollbars=no,resizable=no,width=590,height=530,left=180,top=100,screenX=50,screenY=50')""><img src=""" & sw_dizhi & "images/vip_10.gif""></a>"
        a = replace(a,"{Yidacms:Buy}",yidabuy)
        Buy = a
	End Function

	Function shijian(a)
	tshijian = tshijian & "<script type=""text/javascript"" src="""&sw_dizhi&"images/shuaiweb_time.js""></script>"
	tshijian = tshijian & "<SCRIPT>CalConv();</SCRIPT>"
	a = replace(a,"{time:t}",tshijian)
	shijian = a
	End Function

	Function gb_music(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from book_management"
	rs.open sql,dbok,1,1
	  if trim(rs("wait_mayi")) = 101 then
	   tgb_music = tgb_music & "<bgsound src="""&rs("shuaiweb_mp3")&""" loop=1>"
	  end if
	a = replace(a,"{gb:music}",tgb_music)
	gb_music = a
	End Function

	Function kefu()
			set rs = server.createobject("adodb.recordset")
			sql="select * from book_management"
			rs.open sql,dbok,1,1
				if trim(rs("tang_qq"))= "off" then 
					kefu = kefu &("")
	elseif trim(rs("tang_qq")) = "no" then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_qq ORDER BY shuaiweb_qqsort ASC"
	rs.open sql,dbok,1,1
			kefu = kefu & "<link type=""text/css"" rel=""stylesheet"" media=""all"" href="""&sw_dizhi&"images/qq.css"">"&vbcrlf
			kefu = kefu & "<div class=""qqbox"" id=""divQQbox"">"&vbcrlf
			kefu = kefu & "  <div class=""qqlv"" id=""meumid"" onmouseover=""show()""><img src="""&sw_dizhi&"images/qq.gif""></div>"&vbcrlf
			kefu = kefu & "<div class=""qqkf"" style=""display:none;"" id=""contentid"" onmouseout=""hideMsgBox(event)"">"&vbcrlf
			'kefu = kefu&("<div class=""qqkfbt"" >QQ在线交谈</div>"&vbcrlf
                        kefu = kefu & "<div class=""qqkfhm bgdh"">"&vbcrlf
				i=1
				Do While Not rs.EOF
			'kefu = kefu&("<div id=""K"&i&""">")&vbcrlf					
			kefu = kefu & "<li><a href=""tencent://message/?uin="&rs("shuaiweb_qqnumber")&""" ><img src="""&rs("shuaiweb_picture")&""" border=""0""> "&rs("shuaiweb_qqname")&"　["&rs("shuaiweb_qqtitle")&"]</a></li>"&vbcrlf
				i=i+1
				rs.movenext
				Loop		
					kefu = kefu & "</div></div></div>"&vbcrlf	
			kefu = kefu & "<script type=""text/javascript"" src="""&sw_dizhi&"inc/qq.js""></script>"&vbcrlf
				rs.Close
				set rs=nothing
		end if
	End Function
function qqkefu(a)
         a = replace(a,"{qqkefu:qq}",kefu())
qqkefu = a
end function


function Yidong(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Yidong:\{(.+?)\}>([\s\S]*?)<Yidong>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
        Language=nbq(bq,"Language")
	Row=nbq(bq,"Row")
	Data=nbq(bq,"Data")
	Paixu=nbq(bq,"Paixu")
	Lift=nbq(bq,"Lift")
	Tlen=nbq(bq,"Tlen")
	str=replace(str,match,Yidongmemu(Language,Row,nr,Data,Paixu,Lift,Tlen))
	next
	Yidong=str
end function

function Yidongmemu(Language,Row,yida_cms,Data,Paixu,Lift,Tlen)
set rs = server.createobject("adodb.recordset")
if Row = "" then
 sql="select * from shuaiweb_" & Data & " where yida_language = '" & Language & "' order by " & Paixu & " " & Lift & ""
  else
 sql="select top "&Row&" * from shuaiweb_" & Data & " where yida_language = '" & Language & "' order by " & Paixu & " " & Lift & ""
end if
rs.open sql,dbok,1,1
do while not rs.eof

if Data = "news" then

if Language = "ch" then
 if yida_url = "asp" then
  Getnewsurl = webpath & "zh_news_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Getnewsurl = webpath & "html/news/news_"&rs("id")&".html"
 end if
end if
	yida_cms1=replace(yida_cms,"{News:name}",left(rs("shuaiweb_newstitle"),Tlen))
	yida_cms2=replace(yida_cms1,"{News:name_color}","<font color='"&rs("wait_neyi")&"'>" & left(rs("shuaiweb_newstitle"),Tlen) & "</font>")
	yida_cms3=replace(yida_cms2,"{News:id}",rs("id"))
	yida_cms4=replace(yida_cms3,"{News:xinwenzuozhe}",rs("shuaiweb_newsAuthor"))
	yida_cms5=replace(yida_cms4,"{News:xinwenlaiyuan}",rs("shuaiweb_newsSource"))
	yida_cms6=replace(yida_cms5,"{News:xinwenshijian}",FormatDate(rs("time"),4))
	yida_cms7=replace(yida_cms6,"{News:url}",Getnewsurl)
	tt=tt+yida_cms7

elseif Data = "products" then

if Language = "ch" then
 if yida_url = "asp" then
  Productsurl = webpath & "zh_products_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Productsurl = webpath & "html/products/products_"&rs("id")&".html"
 end if
end if

if trim(rs("shuaiweb_productsminpic")) <> "" then
 productsxiaotu = sw_dizhi & rs("shuaiweb_productsminpic")
  else
 productsxiaotu = sw_dizhi & "images/Without.gif"
end if

if trim(rs("shuaiweb_productsmaxpic")) <> "" then
 productsdatu = sw_dizhi & rs("shuaiweb_productsmaxpic")
  else
 productsdatu = sw_dizhi & "images/Without.gif"
end if
	yida_cms1=replace(yida_cms,"{Products:name}",left(rs("shuaiweb_productsname"),Tlen))
	yida_cms2=replace(yida_cms1,"{Products:name_color}","<font color='"&rs("wait_prer")&"'>" & left(rs("shuaiweb_productsname"),Tlen) & "</font>")
	yida_cms3=replace(yida_cms2,"{Products:id}",rs("id"))
	yida_cms4=replace(yida_cms3,"{Products:riqi}",FormatDate(rs("time"),4))
	yida_cms5=replace(yida_cms4,"{Products:bianhao}",rs("shuaiweb_productsno"))
	yida_cms6=replace(yida_cms5,"{Products:xinghao}",rs("shuaiweb_productsmodel"))
	yida_cms7=replace(yida_cms6,"{Products:caizhi}",rs("wait_pryi"))
	yida_cms8=replace(yida_cms7,"{Products:biaozhunjia}",rs("shuaiweb_productsbprice"))
	yida_cms9=replace(yida_cms8,"{Products:youhuijia}",rs("shuaiweb_productsprice"))
	yida_cms10=replace(yida_cms9,"{Products:kucunliang}",rs("shuaiweb_productsLibrary"))
	yida_cms11=replace(yida_cms10,"{Products:jijiadanwei}",rs("shuaiweb_productsunits"))
	yida_cms12=replace(yida_cms11,"{Products:chupingongsi}",rs("shuaiweb_productsco"))
	yida_cms13=replace(yida_cms12,"{Products:xiaotu}",productsxiaotu)
	yida_cms14=replace(yida_cms13,"{Products:datu}",productsdatu)
	yida_cms15=replace(yida_cms14,"{Products:url}",Productsurl)
	tt=tt+yida_cms15

elseif Data = "about" then
if Language = "ch" then
 if yida_url = "asp" then
 Abouturl = webpath & "zh_about.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
 Abouturl = webpath & "html/about/about_"&rs("id")&".html"
 end if
end if
 
	yida_cms1 = replace(yida_cms,"{Aboutclass:name}",rs("shuaiweb_cotitle"))
	yida_cms2 = replace(yida_cms1,"{Aboutclass:id}",rs("id"))
        yida_cms3 = replace(yida_cms2,"{Aboutclass:url}",Abouturl)
	tt=tt+yida_cms3

elseif Data = "photo" then

if Language = "ch" then
 if yida_url = "asp" then
  GetPhotourl = webpath & "zh_photo_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  GetPhotourl = webpath & "html/photo/photo_"&rs("id")&".html"
 end if
elseif Language = "en" then
 if yida_url = "asp" then
  GetPhotourl = webpath & "en_photo_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  GetPhotourl = webpath & "html/en_photo/photo_"&rs("id")&".html"
 end if
end if

yida_cms1=replace(yida_cms,"{Photo:id}",rs("id"))
yida_cms2=replace(yida_cms1,"{Photo:name}",left(rs("shuaiweb_photoname"),Tlen))
yida_cms3=replace(yida_cms2,"{Photo:img1}",rs("shuaiweb_photoimg1"))
yida_cms4=replace(yida_cms3,"{Photo:img2}",rs("shuaiweb_photoimg2"))
yida_cms5=replace(yida_cms4,"{Photo:img3}",rs("shuaiweb_photoimg3"))
yida_cms6=replace(yida_cms5,"{Photo:img4}",rs("shuaiweb_photoimg4"))
yida_cms7=replace(yida_cms6,"{Photo:img5}",rs("shuaiweb_photoimg5"))
yida_cms8=replace(yida_cms7,"{Photo:tuwenshijian}",FormatDate(rs("time"),4))
yida_cms9=replace(yida_cms8,"{Photo:url}",GetPhotourl)
tt=tt+yida_cms9

end if

rs.movenext
loop
Yidongmemu=tt
end Function

function Connect(str)
set reg=new regexp
reg.IgnoreCase = False 
reg.Global = True 
reg.Pattern = "<Connect:\{(.+?)\}>([\s\S]*?)<Connect>"
set aa=reg.execute(str)
for each match in aa
bq=match.submatches(0)
nr=match.submatches(1)
Row=nbq(bq,"Row")
leixing=nbq(bq,"leixing")
str=replace(str,match,youqing(Row,nr,leixing))
next
Connect=str
end function

	Function youqing(Row,yida_cms,leixing)
	set rs = server.createobject("adodb.recordset")
	sql="select top "&Row&" * from shuaiweb_weblink where webclass = " & leixing & " ORDER BY id DESC"
	rs.open sql,dbok,1,1	
	Do While Not rs.EOF
        yida_cms1=replace(yida_cms,"{list:webname}",rs("webname"))
        yida_cms2=replace(yida_cms1,"{list:weburl}",rs("weburl"))
        yida_cms3=replace(yida_cms2,"{list:weblistpic}",rs("webpic"))
        tt=tt+yida_cms3
	rs.movenext
	Loop
	youqing = tt
	rs.Close
	set rs=nothing			
	End Function

function Liuyan(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Liuyan:\{(.+?)\}>([\s\S]*?)<Liuyan>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	Row=nbq(bq,"Row")
	Tlen=nbq(bq,"Tlen")
	str=replace(str,match,TBook(Row,nr,Tlen))
	next
	Liuyan=str
end function

Function TBook(Row,yida_cms,Tlen)
set rs = server.createobject("adodb.recordset")
sql="select top "&Row&" * from shuaiweb_book ORDER BY id desc"
rs.open sql,dbok,1,1
Do While Not rs.EOF
        yida_cms1=replace(yida_cms,"{Liuyan:id}",rs("id"))
        yida_cms2=replace(yida_cms1,"{Liuyan:bookname}",rs("booktitle"))
        yida_cms3=replace(yida_cms2,"{Liuyan:bookxingming}",rs("bookname"))
        yida_cms4=replace(yida_cms3,"{Liuyan:booktel}",rs("booktel"))
        yida_cms5=replace(yida_cms4,"{Liuyan:bookqq}",rs("bookqq"))
        yida_cms6=replace(yida_cms5,"{Liuyan:bookmail}",rs("bookemail"))
        yida_cms7=replace(yida_cms6,"{Liuyan:bookgongzuo}",rs("bookunits"))
        yida_cms8=replace(yida_cms7,"{Liuyan:bookdizhi}",rs("bookaddress"))
        yida_cms9=replace(yida_cms8,"{Liuyan:bookneirong}",left(rs("bookcontent"),Tlen))
        yida_cms10=replace(yida_cms9,"{Liuyan:bookriqi}",FormatDate(rs("booktime"),4))
        tt=tt+yida_cms10
rs.movenext
Loop
rs.Close
set rs=nothing
TBook = tt
End Function

function Dingdan(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Dingdan:\{(.+?)\}>([\s\S]*?)<Dingdan>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	Row=nbq(bq,"Row")
	str=replace(str,match,Tbuy(Row,nr))
	next
	Dingdan=str
end function

Function Tbuy(Row,yida_cms)
set rs = server.createobject("adodb.recordset")
sql="select top "&Row&" * from shuaiweb_buy ORDER BY id desc"
rs.open sql,dbok,1,1	
Do While Not rs.EOF
        yida_cms1=replace(yida_cms,"{Dingdan:id}",rs("id"))
        yida_cms2=replace(yida_cms1,"{Dingdan:buyname}",rs("shuaiweb_buyname"))
        yida_cms3=replace(yida_cms2,"{Dingdan:buyshuliang}",rs("shuaiweb_buyamount"))
        yida_cms4=replace(yida_cms3,"{Dingdan:buytel}",rs("shuaiweb_buytel"))
        yida_cms5=replace(yida_cms4,"{Dingdan:buydizhi}",rs("shuaiweb_buyaddress"))
        yida_cms6=replace(yida_cms5,"{Dingdan:buyneirong}",rs("shuaiweb_content"))
        yida_cms7=replace(yida_cms6,"{Dingdan:buymingcheng}",rs("shuaiweb_buyprname"))
        yida_cms8=replace(yida_cms7,"{Dingdan:buyriqi}",FormatDate(rs("time"),4))
        tt=tt+yida_cms8
rs.movenext
Loop
rs.Close
set rs=nothing
Tbuy = tt
End Function

function Yidacms_tag(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_tag"
	rs.open sql,dbok,1,1
	Do While Not rs.EOF

	yidacms_tag_html = replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(rs("shuaiweb_taghtml"),"{sys:weburl}",sw_dizhi),"{sys:title}",sw_webtitle),"{sys:gongsibiaoti}",co_name),"{sys:gongsidizhi}",sw_gongsidizhi),"{sys:dianhua}",sw_dianhua),"{sys:yidongdianhua}",sw_yidongdianhua),"{sys:chuanzhen}",sw_chuanzhen),"{sys:qq}",sw_qq),"{sys:lianxiren}",sw_lianxiren),"{sys:beian}",sw_beian),"{sys:youxiang}",sw_youxiang),"{sys:youbian}",sw_youbian)

	shuaiweb_tagt = rs("shuaiweb_tagt")
        a = replace(a,"{Yidacms_t:" & shuaiweb_tagt & "}",yidacms_tag_html)
	rs.movenext
	Loop
        Yidacms_tag=a
	rs.Close
	set rs=nothing
end function

%>