<%
'===================================================
' CreateLive CMS Version 3.1
'							Powered by Aspoo.CoM
'===================================================
' File: Cl_GetLabel.asp
' Date: 2005-10-31
' Mail: aspoo@126.com, Info@aspoo.cn
' Q  Q: 3315263, 596197794
' Msn : aspoo@126.com, Clw866@hotmail.com
' Web : http://www.aspoo.com, http://www.aspoo.net
' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net
' Copyright (C) 2005 Aspoo.CoM All Rights Reserved.
'===================================================

'ReplacePublicFlag(sTrC)
'公共标签处理部分
Public Function ReplacePublicFlag(Byval sTrC)
	sTrC = Replace(Replace(sTrC,"<!--{%","{%"),"%}-->","%}")
	sTrC = Replace(sTrC,"{%width%}",Cl.mainsetting(0))
	sTrC = Replace(sTrC,"{%webname%}",Cl.Web_info(0))
	sTrC = Replace(sTrC,"{%generator%}",Cl.Web_Version(2))
	sTrC = Replace(sTrC,"{%keyword%}",Replace(Cl.Keywords,"|",","))
	sTrC = Replace(sTrC,"{%description%}",Cl.DeScriptIon)
	sTrC = Replace(sTrC,"{%weburl%}",Cl.Web_info(4))
	sTrC = Replace(sTrC,"{%picurl%}",Cl.WebDir&Cl.Web_PicUrl)
	sTrC = Replace(sTrC,"{%webmastemail%}",Cl.Web_info(8))
	sTrC = Replace(sTrC,"{%channelid%}",ChannelID)
	sTrC = Replace(sTrC,"{%title%}",Cl.Title)
	sTrC = Replace(sTrC,"{%channelname%}",Cl.ChannelName)
	sTrC = Replace(sTrC,"{%showdate%}","<script language=""JavaScript"" src="""&InstallDir&"inc/js/date.js"" type=""text/javascript""></script>")
	sTrC = Replace(sTrC,"{%currentpath%}",Cl.Path)
	sTrC = Cl.ReplaceDir(sTrC)
	sTrC = Cl.ReplaceItem(sTrC)
	ReplacePublicFlag = sTrC
End Function

Public Function GetLabelContent(Byval LabelStr,Byref sTrC)
	On Error Resume next
	Dim ArrayStr,Tn
	GetLabelContent = "标签("&LabelStr&")错误，请检查标签代码。"
	ArrayStr = Split(LabelStr,",")
	Select Case LCase(ArrayStr(0))
'=========================公共部分=====================================
	Case "showlogo"
		GetLabelContent = ShowLogo(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showbanner"
		GetLabelContent = ShowBanner(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showannounce"
		GetLabelContent = ShowAnnounce(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5))
	Case "openannounce"
		if Cl.Web_Info(15) = "1" then
			GetLabelContent = "<script language = ""JavaScript"" type=""text/javascript"" src="""&Cl.WebDir&"Js/Announce/"&ChannelID&"_3.Js"" ></script>"
		else
			GetLabelContent = "<script language = ""JavaScript"" type=""text/javascript"">" & Vbcrlf & OpenAnnounce(ArrayStr(1)) & Vbcrlf & "</script>"
		end if
	Case "showchannelmenu"
		if Cl.Web_Info(15) = "1" then
			GetLabelContent = "<script language = ""JavaScript"" type=""text/javascript"" src="""&Cl.WebDir&"Js/ChannelMenu/ChannelMenu_"&ArrayStr(1)&".Js""></script>"
		else
			GetLabelContent = Cl.ShowChannelMenu(ArrayStr(1))
		end if
	Case "showclassmenu"
		if Cl.Web_Info(15) = "1" then
			GetLabelContent = "<script language = ""JavaScript"" type=""text/javascript"" src="""&Cl.WebDir&"Js/ClassMenu/ClassMenu_"&Clng(ArrayStr(1))&".Js""></script>"
		else
			GetLabelContent = "<script language = ""JavaScript"" type=""text/javascript"">"&Cl.GetClassMenu(Clng(ArrayStr(1)))&"</script>"
		end if
'======================文章部分========================================
	Case "showarticle"
		GetLabelContent = ShowArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
	Case "showpicarticle"
		GetLabelContent = ShowPicArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
	Case "showclassarticle"
		GetLabelContent = ShowClassArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showtoparticle"
		GetLabelContent = ShowTopArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6))
	Case "showcorrelativearticle"
		GetLabelContent = ShowCorrelativeArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showneararticle"
		GetLabelContent = ShowNearArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5))
'===========================下载部分===================================
	Case "showsoft"
		GetLabelContent = ShowSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
	Case "showpicsoft"
		GetLabelContent = ShowPicSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
	Case "showclasssoft"
		GetLabelContent = ShowClassSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showtopsoft"
		GetLabelContent = ShowTopSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6))
	Case "showcorrelativesoft"
		GetLabelContent = ShowCorrelativeSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
'===========================图片部分===================================
	Case "showphoto"
		GetLabelContent = ShowPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
	Case "showpicphoto"
		GetLabelContent = ShowPicPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
	Case "showclassphoto"
		GetLabelContent = ShowClassPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showtopphoto"
		GetLabelContent = ShowTopPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6))
	Case "showcorrelativephoto"
		GetLabelContent = ShowCorrelativePhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
'============================影视部分==================================
	Case "showmovie"
		GetLabelContent = ShowMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
	Case "showpicmovie"
		GetLabelContent = ShowPicMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
	Case "showclassmovie"
		GetLabelContent = ShowClassMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showtopmovie"
		GetLabelContent = ShowTopMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6))
	Case "showcorrelativemovie"
		GetLabelContent = ShowCorrelativeMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
'===========================商城部分===================================
	Case "showproduct"
		GetLabelContent = ShowProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
	Case "showpicproduct"
		GetLabelContent = ShowPicProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
	Case "showclassproduct"
		GetLabelContent = ShowClassProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showtopproduct"
		GetLabelContent = ShowTopProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6))
	Case "showcorrelativeproduct"
		GetLabelContent = ShowCorrelativeProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8))
'=========================公共部分=====================================
	Case "showspecial"
		GetLabelContent = ShowSpecial(ArrayStr(1),ArrayStr(2))
	Case "showchildclass"
		GetLabelContent = ShowChildClass(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4))
	Case "showclassnavigation"
		GetLabelContent = ShowClassNavigation(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showcomment"
		GetLabelContent = ShowComment(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showsearchform"
		if Cint(ArrayStr(2))>=3 and Cl.Web_Info(15) = "1" then
			GetLabelContent = "<script type=""text/javascript"" src="""&Cl.WebDir&"Js/Search/Search"&ArrayStr(1)&"_"&ArrayStr(2)&".Js""></script>"
		else
			GetLabelContent = ShowSearchForm(ArrayStr(1),ArrayStr(2))
		end if
	Case "showvote"
		if Ubound(ArrayStr)<2 then ReDim ArrayStr(2)
		GetLabelContent = ShowVote(ArrayStr(1),ArrayStr(2))
	Case "showad"
		if Ubound(ArrayStr)<5 then ReDim ArrayStr(5)
		GetLabelContent = ShowAd(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5))
	Case "showwebcount"
		GetLabelContent = ShowWebCount(ArrayStr(1),ArrayStr(2))
	Case "channelcount"
		if Cl.Web_Info(15) = "1" then
			GetLabelContent = "<script type=""text/javascript"" src="""&Cl.WebDir&"Js/Count/Count_"&ArrayStr(1)&".Js""></script>"
		else
		GetLabelContent = Cl.ReplaceFlag(Replace(Cl.CountConfig,"{%channelid%}",ChannelID),"ShowWebCount","")
		GetLabelContent = Cl.ReplaceItem(Replace(GetLabelContent,VbCrLf,"<br />"))
		end if
	Case "showlinksite"
		GetLabelContent = ShowLinkSite(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5))
	Case "showtopuser"
		GetLabelContent = ShowTopUser(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showguest"
		GetLabelContent = ShowGuest(ArrayStr(1),ArrayStr(2),ArrayStr(3))
	Case "showuserlogin"
		if Ubound(ArrayStr) < 1 then
		Redim ArrayStr(1)
		ArrayStr(1)=0
		end if
		GetLabelContent = Cl.ShowUserLogin(ArrayStr(1))
	Case "showjs"
		Randomize
		Tn=Int(9999*Rnd)+10000
		GetLabelContent = "<div id=""T"&Tn&""">" & ArrayStr(1) & "</div>"
		Dim TempsTr
		TempsTr="<div id=""Text"&Tn&""" style=""display:none"">"&ArrayStr(2)&"</div>"
		TempsTr=TempsTr & Vbcrlf & "<script type=""text/javascript"">"
		TempsTr=TempsTr & Vbcrlf & "document.getElementById('T"&Tn&"').innerHTML=document.getElementById('Text"&Tn&"').innerHTML;"
		sTrC=Replace(sTrC,"</body>",TempsTr & Vbcrlf & "</script>" & Vbcrlf & "</body>")
	Case "web_info"
		GetLabelContent = Cl.Web_Info(ArrayStr(1))
	Case "mainsetting"
		GetLabelContent = Cl.mainsetting(ArrayStr(1))
	Case "mainpic"
		GetLabelContent = Cl.mainpic(ArrayStr(1))
	Case "mainhtml"
		GetLabelContent = Cl.mainhtml(ArrayStr(1))
	Case "powered"
		GetLabelContent = Cl.lanstr(2) & "<a href="""&Cl.Web_Version(0)&""" target=""_blank"">"&Cl.Web_Version(1)&"</a>"
	Case "copyright"
		GetLabelContent = Cl.Web_info(9)
	Case "runtime"
		if Trim(Cl.Web_Setting(0))="Yes" then
			GetLabelContent = Replace(Cl.lanstr(3),"{%runtime%}",Right(0&FormatNumber(Timer-BeginTime,3),5))' & "&nbsp&nbsp" & Replace(Cl.lanstr(4),"{%querynum%}",Cl.SqlQueryNum))
		else
			GetLabelContent = ""
		end if
	Case "stylename"
		GetLabelContent = Replace(Cl.lanstr(5),"{%stylename%}",Cl.StyleName)
	Case Else
		Exit Function
	End Select
End Function
%>
