<%
'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************
function Down(str)
set reg=new regexp
reg.IgnoreCase = False 
reg.Global = True 
reg.Pattern = "<Down:\{(.+?)\}>([\s\S]*?)<Down>"
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,yidacmsdown(Row,nr))
next
Down=str
end function

Function yidacmsdown(Row,yida_cms)
set rs = server.createobject("adodb.recordset")
sql="select top "&Row&" * from shuaiweb_down ORDER BY id DESC"
rs.open sql,dbok,1,1	
Do While Not rs.EOF

	yida_cms1=replace(yida_cms,"{down:name}",rs("shuaiweb_downname"))
	yida_cms2=replace(yida_cms1,"{down:version}",rs("shuaiweb_downversion"))
	yida_cms3=replace(yida_cms2,"{down:size}",rs("shuaiweb_downsize"))
	yida_cms4=replace(yida_cms3,"{down:xp}",rs("shuaiweb_downxp"))
	yida_cms5=replace(yida_cms4,"{down:number}",rs("shuaiweb_downnumber"))
	yida_cms6=replace(yida_cms5,"{down:content}",rs("shuaiweb_downcontent"))
	yida_cms7=replace(yida_cms6,"{down:download}","<a href='"&webpath&"down.asp?id="&rs("id")&"' target='_blank'><img src='"&webpath&"images/down.png'></a>")

	tt=tt+yida_cms7
rs.movenext
Loop
yidacmsdown = tt
rs.Close
set rs=nothing			
End Function

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

Function gongsi(leixing,yida_cms,leibie,Tlen)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_co where id = " & leixing & ""
	rs.open sql,dbok,1,1
        if rs.eof then
	 zanwu = zanwuneirong
	  else
          if leibie = 1 then
           yida_cms = replace(yida_cms,"{About:neirong}",left(RemoveHTML(rs("shuaiweb_cocontent")),Tlen))
            elseif leibie = 2 then
           yida_cms = replace(yida_cms,"{About:neirong}",left(rs("shuaiweb_cocontent"),Tlen))
          end if
        end if
        tt=tt+yida_cms
	rs.Close
	set rs=nothing
        gongsi = tt & zanwu
End Function

Function Gongsiview(a)
        about_id = cint(request("id"))
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_co WHERE id= "&about_id&""
	rs.open sql,dbok,1,3

	yidacms_tag_about = yidacms_tag_about &_ 

	(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(rs("shuaiweb_cocontent"),"{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))

        a = replace(a,"{Gongsiview:name}",rs("shuaiweb_cotitle"))
        a = replace(a,"{Gongsiview:miaochu}",rs("shuaiweb_codescription"))
        a = replace(a,"{Gongsiview:neirong}",yidacms_tag_about)
        If Not(rs.bof and rs.eof) Then
        a = replace(a,"{Gongsiview:liulan}",rs("wait_coer"))
        rs("wait_coer") = rs("wait_coer") +1
        Rs.UPDATE
        end if
	rs.Close
	set rs=nothing
Gongsiview = a
End Function

function Aboutclass(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Aboutclass:\{(.+?)\}>([\s\S]*?)<Aboutclass>"
	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")
	str=replace(str,match,gongsifenlei(Language,Row,nr))
	next
	Aboutclass=str
end function

Function gongsifenlei(Language,Row,yida_cms)
	set rs = server.createobject("adodb.recordset")
	sql="select top "&Row&" * from shuaiweb_co where wait_cowu = 1 and yida_language = '" & Language & "' ORDER BY shuaiweb_cosort ASC"
	rs.open sql,dbok,1,1
	Do While Not rs.EOF

        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
        elseif Language = "en" then
         if yida_url = "asp" then
          Abouturl = webpath & "en_about.asp?id=" & rs("id")
           elseif yida_url = "html" or yida_url = "asphtml" then
          Abouturl = webpath & "html/en_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
	rs.movenext
	Loop
	rs.Close
	set rs=nothing
        gongsifenlei = tt
End Function
%>