<%
'**************************************************
'函数名：gotTopic
'作  用：截字符串，汉字一个算两个字符，英文算一个字符
'参  数：str   ----原字符串
'       strlen ----截取长度
'返回值：截取后的字符串
'**************************************************
function gotTopic(str,strlen)
	dim ret
	if str="" then
		ret=""
		exit function
	end if
	
	dim l,t,c, i	
	l=len(str)
	t=0
	for i=1 to l
		c=Abs(Asc(Mid(str,i,1)))
		if c>255 then
			t=t+2
		else
			t=t+1
		end if
		if t>Cint(strlen) then
			ret=left(str,i)+".."
			exit for		
		end if
	next
	if(t<=Cint(strlen)) then
		ret=str
	end if
	gotTopic=ret
end function
'===========================================================================
'函数：RemoveHTML(strHTML)
'功能：去除HTML标记
'参数：strHTML		--要去除HTML标记的字符串
'==========================================================================
Function RemoveHTML(strHTML) 
Dim objRegExp, Match, Matches 
Set objRegExp = New Regexp 

objRegExp.IgnoreCase = True 
objRegExp.Global = True 
'取闭合的<> 
objRegExp.Pattern = "<.+?>" 
'进行匹配 
Set Matches = objRegExp.Execute(strHTML) 

' 遍历匹配集合，并替换掉匹配的项目 
For Each Match in Matches 
strHtml=Replace(strHTML,Match.Value,"") 
Next 
RemoveHTML=strHTML 
RemoveHTML=replace(RemoveHTML,VbCrLf,"")
 RemoveHTML=replace(RemoveHTML,vbNewLine,"")
 RemoveHTML=replace(RemoveHTML," ","")
 RemoveHTML=replace(RemoveHTML," ","")
 RemoveHTML=replace(RemoveHTML,"&nbsp;","") 
 RemoveHTML=replace(RemoveHTML,"\n","") 
 RemoveHTML=replace(RemoveHTML,chr(10),"")
 RemoveHTML=replace(RemoveHTML,chr(13),"")

Set objRegExp = Nothing 
End Function 

function ReadFromTextFile (f_savepath)
 dim str
 set stm=server.CreateObject("adodb.stream")
 stm.Type=2 '以本模式读取
 stm.mode=3 
 stm.charset="gb2312"
 stm.open
 stm.loadfromfile f_savepath
 str=stm.readtext
 stm.Close
 set stm=nothing
 ReadFromTextFile=str
end function

Sub	SaveTextFile(f_savepath,f_content)   
  Dim st   
  Set st=Server.CreateObject("ADODB.Stream")   
  st.Type=2   
  st.Mode=3   
  st.Charset="gb2312"   
  st.Open()   
  st.WriteText   f_content
  st.SaveToFile  f_savepath,2   
  st.Close()   
  Set   st=Nothing   
End   Sub

'=======================================================================
'函数：AddAndModifyClass(ParentID,ClassCName,Contr,AddTime,ClassTemp,SaveDir)
'作用：添加分类
'参数：ParentID     ---父节点ID号
'      ClassCName        ---分类名称
'      Contr        ---是否允许投稿
'      AddTime        ---添加时间
'      ClassTemp        ---分类模板
'      SaveDir        ---保存路径
'=====================================================================

Function AddAndModifyClass(Catalogid,ParentID,ClassCName,Contr,AddTime,ClassTemp,SaveDir,SortId)
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 1 * from catalogs order by id desc",conn,3,3
rs.addnew
rs("id")=Catalogid
rs("parentid")=ParentID
rs("title")=ClassCName
rs("flag")=Contr
rs("moditime")=AddTime
rs("templet")=ClassTemp
rs("savedir")=SaveDir
rs("sortid")=SortId
rs.update
rs.close
set rs=nothing
conn.execute("update catalogs set childnum=childnum+1 where id="&ParentID)
if Err.Number<>0 then
	AddAndModifyClass=false
else
	AddAndModifyClass=true
end if
end Function

'=======================================================================
'函数：ModifyClass(ParentID,ClassCName,Contr,AddTime,ClassTemp,SaveDir)
'作用：修改分类
'参数：ClassID      ---修改分类的ID
'      ParentID     ---父节点ID号
'      ClassCName        ---分类名称
'      Contr        ---是否允许投稿
'      AddTime        ---添加时间
'      ClassTemp        ---分类模板
'      SaveDir        ---保存路径
'=====================================================================

Function ModifyClass(ClassID,ParentID,ClassCName,flags,AddTime,ClassTemp,SaveDir,SortId)
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from catalogs where id="&ClassID,conn,3,3
if not rs.eof and not rs.bof then
	rs("parentid")=ParentID
	rs("title")=ClassCName
	rs("flag")=flags
	rs("moditime")=AddTime
	rs("templet")=ClassTemp
	rs("savedir")=SaveDir
	rs("sortid")=SortId
	rs.update
	rs.close
	set rs=nothing
else
	rs.close
	set rs=nothing
	response.Write("<script>alert(""没有找到要修改的栏目!"");</script>")
end if
if Err.Number <> 0 then
	ModifyClass=false
else
	ModifyClass=true
end if
end Function

'=======================================================================
'函数：DeleInfo(colume,values,tablename,types)
'作用：删除指定表中某个字段指定值的信息
'参数：colume      ---字段
'      values     ---值
'      tablename  ---表名称
'      type  ---类型，1为字符型，2为数字型
'=====================================================================

Function DeleInfo(colume,values,tablename,types)
'set rs=server.CreateObject("adodb.recordset")
if(types=1) then
	sql="delete from "&tablename&" where "&colume&"='"&values&"'"
else
	sql="delete from "&tablename&" where "&colume&"="&values
end if
conn.execute(sql)
'if Err.Number = 0 then
	DeleInfo=true
'end if
end Function

'=======================================================================
'函数：alert(str)
'作用：弹出对话框信息
'参数：str      ---要弹出的信息
'参数：nexti    ---弹出后的动作0=无,1=返回,2=关闭
'=====================================================================

Function alertstr(str,nexti)
	dim nextStr
	select case(nexti)
			case(0)
				response.Write("<script>alert("""&str&""");</script>")
				response.End()
			case(1)
				response.Write("<script>alert("""&str&""");history.back();</script>")
				response.End()
			case(2)
				response.Write("<script>alert("""&str&""");window.close();</script>")
				response.End()
	end select	
end Function

function tohtml(from)
	s=from
    s = Replace(s,"&","&amp;")
    s = Replace(s,"<","&lt;")
    s = Replace(s,">","&gt;")
    s = Replace(s,"\t","    ")
    s = Replace(s,"\r\n","\n")
    s = Replace(s,"\n","<br>")
    s = Replace(s,"  "," &nbsp;")
    s = Replace(s,"'","&#39;")
    s = Replace(s,"\\","&#92;")
	s=replace(s," ","&nbsp;")
    s=replace(s,chr(13)&chr(10),"<Br>")
	tohtml=s
end function
'
function htmlto(from)
	ss=from
    ss=Replace(ss,"<br>",chr(10))
    ss=Replace(ss,"<Br>",chr(10))
	ss=replace(ss,"&nbsp;"," ")
	htmlto=ss
end function

'===================================================================
'                           时间转换函数
'===================================================================
function chan_file(shijian)
	s_year=year(shijian)
	if len(s_year)=2 then s_year="20"&s_year
	s_month=month(shijian)
	if s_month<10 then s_month="0"&s_month
	s_day=day(shijian)
	if s_day<10 then s_day="0"&s_day
	s_hour=hour(shijian)
	if s_hour<10 then s_hour="0"&s_hour
	s_minute=minute(shijian)
	if s_minute<10 then s_minute="0"&s_minute
	s_ss=second(shijian)
	if s_ss<10 then s_ss="0"&s_ss

	chan_file =s_year & s_month & s_day & s_hour & s_minute & s_ss
	
end function
'===================================================================
'                           时间转换函数2
'===================================================================
function chan_data(shijian)
	s_year=year(shijian)
	if len(s_year)=2 then s_year="20"&s_year
	s_month=month(shijian)
	if s_month<10 then s_month="0"&s_month
	s_day=day(shijian)
	if s_day<10 then s_day="0"&s_day
	s_hour=hour(shijian)
	chan_data =s_year & s_month 
	
end function
''''''''''''''''''''''''''''''
'格式化日期函数
'''''''''''''''''''''''''''''
function FormatDate(shijian,localtype)
	dim s_year,s_month,s_day
	s_year=year(shijian)
	if len(s_year)=2 then s_year="20"&s_year
	s_month=month(shijian)
	if s_month<10 then s_month="0"&s_month
	s_day=day(shijian)
	if s_day<10 then s_day="0"&s_day
	select case(localtype)
		case 1
			FormatDate =s_year&"-"&s_month&"-"&s_day
		case 2
			FormatDate =s_year&"/"&s_month&"/"&s_day
		case 3
			FormatDate =s_year&"-"&s_month
		case 4
			FormatDate =s_month&"-"&s_day
	end select	
end function
'===================================================================
'                           时间转换函数3
'===================================================================
function chan_day(shijian)	
	
	s_day=day(shijian)	
	chan_day=s_day 
	
end function
'===================================================================
'                           字符转换函数
'===================================================================
function get_pass(pass)

	pass=cstr(pass)
	pass=replace(pass," ","")
	pass=replace(pass," ","")
	pass=replace(pass,"-","")
	pass=replace(pass," ","")
	pass=replace(pass,":","")
	pass=replace(pass,".","")
	pass=replace(pass,"+","")
	pass=replace(pass,"_","")
	pass=replace(pass,"<","")
	pass=replace(pass,">","")
	pass=replace(pass,"!","")
	pass=replace(pass,"@","")
	pass=replace(pass,"#","")
	pass=replace(pass,"$","")
	pass=replace(pass,"%","")
	pass=replace(pass,"^","")
	pass=replace(pass,"&","")
	pass=replace(pass,"*","")
	pass=replace(pass,"(","")
	pass=replace(pass,")","")
	pass=replace(pass,"=","")
	pass=replace(pass,"/","")
	pass=replace(pass,"/","")
	pass=replace(pass,"|","")
	get_pass=pass

end function

Function getRndNum
 	dim rndStr,ranNum1,ranNum2
 	randomize
 	ranNum1=int((9000*rnd)+1000)
	ranNum2=int((9000*rnd)+1000)
	getRndNum=ranNum1&ranNum2
end Function
'=======================================================================
'函数：GetNews(tablewidth,lineheight,tdStyle,n,tablename,classid,orders,key,titlePrefix,max,linkStyle)
'作用：据条件获得N条新闻
'参数：tablewidth    ---表格宽度
'	   tdStyle		 ---行样式
'      lineheight    ---行高
'      n  	         ---取记录数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      key           ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'	   titlePrefix   ---标题前辍
'      max           ---最大字数
'      linkStyle     ---链接样式
'事例：getnews("99%",20,10,"news",79,"id","top1",50,"wlink")
'=====================================================================
function GetNews(tablewidth,lineheight,tdStyle,n,tablename,classid,orders,key,titlePrefix,max,linkStyle,isTime)
	dim getNewsReturnStr,newsii,newsHref,tprefix
	getNewsReturnStr=""
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top "&n&" title,pagepath,moditime,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing
	getNewsReturnStr=getNewsReturnStr&"<table width="&""""&tablewidth&""""&"  border="&""""&"0"&""""&" align="&""""&"center"&""""&" cellpadding="&""""&"0"&""""&" cellspacing="&""""&"0"&""""&">"&chr(13)
	for newsii=0 to ubound(TempArr,2)
		if(TempArr(4,newsii)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,newsii)
		else
			newsHref=TempArr(1,newsii)
		end if
		if(titlePrefix="auto") then
			tprefix=newsii+1
		else
			tprefix=titlePrefix
		end if
		getNewsReturnStr=getNewsReturnStr&"<tr>"&chr(13)
    		getNewsReturnStr=getNewsReturnStr&"<td class="""&tdStyle&""" height="&""""&lineheight&""""&"><div align=""left"">"&tprefix&" <a href="&""""&newsHref&""""&" class="""&linkStyle&""" title="""&TempArr(0,newsii)&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,newsii)&""">"&gotTopic(TempArr(0,newsii),max)&"</span></a></div></td>"&chr(13)
    		if(Cint(isTime=1)) then
				getNewsReturnStr=getNewsReturnStr&"<td class="""&tdStyle&""" width=""17%""><div align=""center"" style=""color: #999999""><div align=""center"">"&month(TempArr(2,newsii))&"-"&day(TempArr(2,newsii))&"</div></div></td>"
			end if
		getNewsReturnStr=getNewsReturnStr&"</tr>"&chr(13)
	next
	getNewsReturnStr=getNewsReturnStr&"</table>"&chr(13)
	else
		getNewsReturnStr="暂时没有记录"
		'response.Write(getNewsReturnStr)
		rs.close
		set rs=nothing
	end if	
	GetNews=getNewsReturnStr
end function

function GetNewsLi(classid,n,tablename,orders,key,titlePrefix,max,isTime)
	dim GetNewsLiReturnStr,newsii,newsHref,tprefix
	GetNewsLiReturnStr=""
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top "&n&" title,pagepath,moditime,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing	
	for newsii=0 to ubound(TempArr,2)
		if(TempArr(4,newsii)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,newsii)
		else
			newsHref=TempArr(1,newsii)
		end if
		if(titlePrefix="auto") then
			tprefix=newsii+1
		else
			tprefix=titlePrefix
		end if
		GetNewsLiReturnStr=GetNewsLiReturnStr&"<li>"&chr(13)
			if(Cint(isTime=1)) then
				GetNewsLiReturnStr=GetNewsLiReturnStr&"<span class=""col_right"">"&FormatDate(TempArr(2,newsii),4)&"</span>"
			end if
    		GetNewsLiReturnStr=GetNewsLiReturnStr&tprefix&" <a href="&""""&newsHref&""""&" title="""&TempArr(0,newsii)&""" class="""&linkStyle&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,newsii)&""">"&gotTopic(TempArr(0,newsii),max)&"</span></a>"&chr(13)
    		
		GetNewsLiReturnStr=GetNewsLiReturnStr&"</li>"&chr(13)
	next
	
	else
		GetNewsLiReturnStr="暂时没有记录"		
		rs.close
		set rs=nothing
	end if	
	GetNewsLi=GetNewsLiReturnStr
end function

'=======================================================================
'函数：GetRelateNews(relateKeys)
'作用：据条件获得N条新闻
'参数：relateKeys	--相关新闻关键字
'=======================================================================
Function GetRelateNews(relateKeys,tablewidth,lineheight,n,tablename,orders,key,max,linkStyle,isTime)
	dim tempkeyArr,tempsqlStr,j,newsii
	tempkeyArr=split(relateKeys,"|")
	tempsqlStr="select top "&n&" title,pagepath,moditime,title_color,isoutlink from "&tablename&" where checked=true"
	if(ubound(tempkeyArr)>=0) then
		tempsqlStr=tempsqlStr&" and "
		for j=0 to ubound(tempkeyArr)
			tempsqlStr=tempsqlStr&" title like '%"&tempkeyArr(j)&"%'"
			if(ubound(tempkeyArr)>j) then
				tempsqlStr=tempsqlStr&" or "
			end if
		next
	end if
	tempsqlStr=tempsqlStr&" order by id desc"
	'response.Write(tempsqlStr)
	set rs=conn.execute(tempsqlStr)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing
	GetRelateNews=GetRelateNews&"<table width="&""""&tablewidth&""""&"  border="&""""&"0"&""""&" align="&""""&"center"&""""&" cellpadding="&""""&"0"&""""&" cellspacing="&""""&"0"&""""&">"&chr(13)
	for newsii=0 to ubound(TempArr,2)
		if(TempArr(4,newsii)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,newsii)
		else
			newsHref=TempArr(1,newsii)
		end if
		GetRelateNews=GetRelateNews&"<tr>"&chr(13)
    		GetRelateNews=GetRelateNews&"<td style=""line-height:20px;"" height="&""""&lineheight&""""&"><div align=""left"">·<a href="&""""&newsHref&""""&" title="""&TempArr(0,newsii)&""" class="""&linkStyle&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,newsii)&""">"&gotTopic(TempArr(0,newsii),max)&"</span></a></div></td>"&chr(13)
    		if(Cint(isTime=1)) then
				GetRelateNews=GetRelateNews&"<td width=""17%""><div align=""center"" style=""color: #999999""><div align=""center"">"&month(TempArr(2,newsii))&"-"&day(TempArr(2,newsii))&"</div></div></td>"
			end if
		GetRelateNews=GetRelateNews&"</tr>"&chr(13)
	next
	else
		GetRelateNews="<table>暂时没有记录"
		rs.close
		set rs=nothing
	end if
	GetRelateNews=GetRelateNews&"</table>"&chr(13)
end Function
'=======================================================================
'函数：GetNewsAll(classid,tablewidth,lineheight,tdStyle,n,tablename,classid,orders,key,max,linkStyle)
'作用：据条件获得N条新闻
'参数：tablewidth    ---表格宽度
'      lineheight    ---行高
'	   tdStyle       ---行样式
'      n  	         ---取记录数
'      tablename     ---表名
'      orders        ---按排序
'      key           ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'      max           ---最大字数
'      linkStyle     ---链接样式
'事例：GetNewsAll("99%",20,10,"news","id","top1",50,"wlink",1,1,"")
'=====================================================================
function GetNewsAll(classid,tablewidth,lineheight,tdStyle,n,tablename,orders,key,max,linkStyle,isTime,isCatalog,catalogLinkStyle,titlePrefix)
	dim newsHref,childIds,catalogHref,tprefix
	if(classid=0) then
  		sql="select top "&n&" news.title,news.pagepath,news.moditime AS mtime,catalogs.title,catalogs.savedir,news.title_color,news.isoutlink,catalogs.flag from "&tablename&",catalogs where news.checked=true and news.classid=catalogs.id"
	else		
		sql="select top "&n&" news.title,news.pagepath,news.moditime AS mtime,catalogs.title,catalogs.savedir,news.title_color,news.isoutlink,catalogs.flag from "&tablename&",catalogs where news.checked=true and news.parentid="&classid&" and news.classid=catalogs.id"
	end if
	set rs=server.CreateObject("adodb.recordset")
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and news.top1=1"
		Case "totop"
			sql=sql&" and news.totop=1"
		Case "tohot"
			sql=sql&" and news.tohot=1"
		Case "recommend"
			sql=sql&" and news.recommend=true"
		Case "imgnews"
			sql=sql&" and news.imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by news."&orders&" desc"
	GetNewsAll=GetNewsAll&"<table width="&""""&tablewidth&""""&"  border="&""""&"0"&""""&" align="&""""&"center"&""""&" cellpadding="&""""&"0"&""""&" cellspacing="&""""&"0"&""""&">"&chr(13)
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing    	
	for i=0 to ubound(TempArr,2)
		if(TempArr(6,i)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,i)
		else
			newsHref=TempArr(1,i)
		end if
		if(TempArr(7,i)=true) then
			catalogHref="index.htm"
		else
			catalogHref="index_1.htm"
		end if
		if(titlePrefix="auto") then
			tprefix=newsii+1
		else
			tprefix=titlePrefix
		end if
		GetNewsAll=GetNewsAll&"<tr>"&chr(13)
    		GetNewsAll=GetNewsAll&"<td class="""&tdStyle&""" height="&""""&lineheight&""""&">"&chr(13)
			if(Cint(isCatalog=1)) then
				GetNewsAll=GetNewsAll&"<div align=""left"">"&"<a href="&""""&TempArr(4,i)&"/"&catalogHref&""""&" class="""&catalogLinkStyle&""" target="&""""&"_blank"&""""&">["&TempArr(3,i)&"]</a>"&chr(13)
			end if
			GetNewsAll=GetNewsAll&tprefix&" <a href="&""""&newsHref&""""&" title="""&TempArr(0,i)&""" class="""&linkStyle&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(5,i)&""">"&gotTopic(TempArr(0,i),max)&"</span></a>"&chr(13)
			GetNewsAll=GetNewsAll&"</div></td>"&chr(13)
    		if(Cint(isTime=1)) then
				GetNewsAll=GetNewsAll&"<td class="""&tdStyle&""" width=""17%""><div align=""center"" style=""color: #999999""><div align=""center"">"&month(TempArr(2,i))&"-"&day(TempArr(2,i))&"</div></div></td>"
			end if
		GetNewsAll=GetNewsAll&"</tr>"&chr(13)
	next
	GetNewsAll=GetNewsAll&"</table>"&chr(13)
	else
		GetNewsAll="暂时没有记录"
		rs.close
		set rs=nothing
	end if
end function

'======================================================================
'getNewsByPrimaryKey
'=====================================================================
function getNewsByPrimaryKey(id)
	dim rs,sql,newsHref
	set rs=server.CreateObject("adodb.recordset")
	sql="select title,pagepath,title_color,isoutlink from news where id="&id
	rs.open sql,conn,3,1
	if not rs.eof then
		if(rs(3)=0) then
			newsHref=SiteUrl&"/"&rs(1)
		else
			newsHref=rs(1)
		end if
		getNewsByPrimaryKey=getNewsByPrimaryKey&"<a title="""&rs(0)&""" href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"	
		getNewsByPrimaryKey=getNewsByPrimaryKey&"<span style=""color: "&rs(2)&""">"&rs(0)
		getNewsByPrimaryKey=getNewsByPrimaryKey&"</span></a>"
	else
		getNewsByPrimaryKey="没有了"
	end if
	rs.close
	set rs=nothing
end function
'=======================================================================
'函数：Get1Title(classid,orders,key,max,linkStyle)
'作用：获得头条新闻标题
'参数：classid     ---类别ID
'      orders        ---按排序
'      key           ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'      max           ---最大字数
'      linkStyle     ---链接样式
'      例：Get1Title(1,"id","top1",50,"wlink")
'=====================================================================
function Get1Title(classid,orders,key,max,linkStyle)
	dim newsHref
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top 1 title,pagepath,title_color,isoutlink from news where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing 
	if(TempArr(3,0)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,0)
		else
			newsHref=TempArr(1,0)
		end if
	Get1Title=Get1Title&"<a class="&""""&linkStyle&""""&" title="""&TempArr(0,0)&""" href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"	
	Get1Title=Get1Title&"<span style=""color: "&TempArr(2,0)&""">"&gotTopic(TempArr(0,0),max)
	Get1Title=Get1Title&"</span></a>"  
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：Get1Content(classid,orders,key,max,linkStyle)
'作用：获得头条新闻内容
'参数：classid     ---类别ID
'      orders        ---按排序
'      key           ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'      max           ---最大字数
'      linkStyle     ---链接样式
'      例：Get1Content(1,"id","top1",50,"wlink")
'=====================================================================
function Get1Content(classid,orders,key,max,linkStyle)
	dim newsHref
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top 1 content,pagepath from news where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing   
	Get1Content=Get1Content&"<a class="&""""&linkStyle&""""&" href="&""""&SiteUrl&"/"&TempArr(1,0)&""""&" target="&""""&"_blank"&""""&">"	
	Get1Content=Get1Content&gotTopic(RemoveHTML(TempArr(0,0)),max)
	Get1Content=Get1Content&"</a>"  
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：Get1Image(classid,orders,key,linkStyle,imgW,imgH)
'作用：获得头条新闻图片
'参数：classid     ---类别ID
'      orders      ---按排序
'      key         ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'      linkStyle   ---链接样式
'      imgw        ---图片宽度
'      imgh        ---图片高度
'      例：Get1Image(234,"id","","",205,200)注：当imgW或imgH也就是图片的长度或宽度之一被设置为0时刚显示图片自有的长度和高度。
'=====================================================================
function Get1Image(classid,orders,key,linkStyle,imgW,imgH)
	dim newsHref
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top 1 photo,pagepath,title_color,isoutlink from news where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"

			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing 
	dim imginfo
	if(imgW=0 or imgH=0) then
		imginfo=""
	else
		imginfo=" width="&imgW&" height="&imgH
	end if
	if(TempArr(3,0)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,0)
		else
			newsHref=TempArr(1,0)
		end if
	Get1Image=Get1Image&"<a class="&""""&linkStyle&""""&" href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"	
	Get1Image=Get1Image&"<img src="&""""&SiteUrl&"/"&Imgsavedir&"/"&TempArr(0,0)&""""&" ALT="&""""&" "&""""&imginfo&" border="&""""&"0"&""""&">"
	Get1Image=Get1Image&"</a>"  
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：GetImgNews(tablewidth,lineheight,n,tablename,classid,orders,max,imgW,imgH,linkStyle,key)
'作用：获得N条带图片、标题的新闻，图片在上，文字在下
'参数：tablewidth     ---表格宽度
'      lineheight    ---行高
'      n  	     ---取个数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      max           ---最大字数
'      imgH          ---图像高度
'      imgW          ---图像宽度
'      linkStyle     ---链接样式
'	   key		     ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
' 例：GetImgNews(241,"100%",20,2,"news","id",20,100,100,"red","")
'=====================================================================
function GetImgNews(classid,tablewidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
	dim newsHref
	if(imgW=0 or imgH=0) then
		imgW="100"
		imgH="100"
	end if
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top "&n&" title,pagepath,photo,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" and photo<>'' order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing 
	for i=0 to ubound(TempArr,2)
		if(TempArr(4,i)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,i)
		else
			newsHref=TempArr(1,i)
		end if
		TempLinkTitle=gotTopic(TempArr(0,i),max)
		GetImgNews=GetImgNews&"<table width="""&tablewidth&""" border=""0"" cellspacing=""0"" cellpadding=""0"">"&chr(13)
  GetImgNews=GetImgNews&"<tr>"&chr(13)
    GetImgNews=GetImgNews&"<td><div align=""center"">"&chr(13)
		GetImgNews=GetImgNews&"<a href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"
			GetImgNews=GetImgNews&"<img alt="""&TempArr(0,i)&""" style=""border:1px solid #000000;"" src="""&SiteUrl&"/"&Imgsavedir&"/"&TempArr(2,i)&""" width="""&imgW&""" height="""&imgH&""" border=""0"">"
		GetImgNews=GetImgNews&"</a>"&chr(13)
	GetImgNews=GetImgNews&"</div></td>"&chr(13)
  GetImgNews=GetImgNews&"</tr>"&chr(13)
  GetImgNews=GetImgNews&"<tr>"&chr(13)
    GetImgNews=GetImgNews&"<td height="""&lineheight&"""><div align=""center""><a href="&""""&newsHref&""""&" title="""&TempArr(0,i)&""" class="""&linkStyle&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,i)&""">"&TempLinkTitle&"</span></a></div></td>"&chr(13)
  GetImgNews=GetImgNews&"</tr>"&chr(13)
GetImgNews=GetImgNews&"</table>"&chr(13)
	next   
	else
		GetImgNews="暂时没有记录"
		rs.close
		set rs=nothing
	end if
end function
'==============================================================================================================
'函数：GetImgNews2(classid,tablewidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
'作用：获得N条带图片、标题、内容的新闻，图片在左，右上：标题，右下：内容
'参数：tablewidth     ---表格宽度
'      lineheight    ---行高
'      n  	     ---取个数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      max           ---最大字数
'      imgH          ---图像高度
'      imgW          ---图像宽度
'      linkStyle     ---链接样式
'	   key		     ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
'	例：GetImgNews2(241,"50%",20,2,"news","id",20,100,100,"red","")
'==============================================================================================================
function GetImgNews2(classid,tablewidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
	dim newsHref
	if(imgW=0 or imgH=0) then
		imgW="100"
		imgH="100"
	end if
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top "&n&" title,pagepath,photo,content,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" and photo<>'' order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()  
  	rs.close
	set rs=nothing 
	for i=0 to ubound(TempArr,2)
		if(TempArr(5,0)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,i)
		else
			newsHref=TempArr(1,i)
		end if
		GetImgNews2=GetImgNews2&"<table width="""&tablewidth&""" border=""0"" cellpadding=""0"" cellspacing=""0"">"&chr(13)
  GetImgNews2=GetImgNews2&"<tr>"&chr(13)
    GetImgNews2=GetImgNews2&"<td width=""40%""><div align=""center"">"&chr(13)
		GetImgNews2=GetImgNews2&"<a href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"
			GetImgNews2=GetImgNews2&"<img alt="""&TempArr(0,i)&""" src="""&SiteUrl&"/"&Imgsavedir&"/"&TempArr(2,i)&""" width="""&imgW&""" height="""&imgH&""" border=""0"">"
		GetImgNews2=GetImgNews2&"</a>"&chr(13)
	GetImgNews2=GetImgNews2&"</div></td>"&chr(13)
  GetImgNews2=GetImgNews2&"<td width=""60%"" height="""&lineheight&""" valign=""top""><p><a href="&""""&newsHref&""""&" class="""&linkStyel&""" title="""&TempArr(0,i)&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(4,i)&""">"&left(TempArr(0,i),max)&"</span></a></p>"&chr(13)
  GetImgNews2=GetImgNews2&"<p>"&gotTopic(RemoveHTML(TempArr(3,i)),max)&"</p>"&chr(13)
    GetImgNews2=GetImgNews2&"</td>"&chr(13)
  GetImgNews2=GetImgNews2&"</tr>"&chr(13)
GetImgNews2=GetImgNews2&"</table>"&chr(13)
	next   
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：GetImgNews3(classid,tablewidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
'作用：获得N条带图片、标题的新闻，图片在上，文字在下(repeat by td)
'参数：tablewidth     ---表格宽度
'      lineheight    ---行高
'      n  	     ---取个数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      max           ---最大字数
'      imgH          ---图像高度
'      imgW          ---图像宽度
'      linkStyle     ---链接样式
'	   key		     ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
' 例：GetImgNews3(241,"100%",20,2,"news","id",20,100,100,"red","")
'=====================================================================
function GetImgNews3(classid,tablewidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
	dim newsHref
	if(imgW=0 or imgH=0) then
		imgW="100"
		imgH="100"
	end if
	set rs=server.CreateObject("adodb.recordset")  
  	sql="select top "&n&" title,pagepath,photo,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" and photo<>'' order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  	TempArr=rs.GetRows()
	
  	rs.close
	set rs=nothing 
	GetImgNews3=GetImgNews3&"<table width="""&tablewidth&""" border=""0"" cellspacing=""1"" cellpadding=""5"">"&chr(13)
	GetImgNews3=GetImgNews3&"<tr>"&chr(13)
	for i=0 to ubound(TempArr,2)
    	if(TempArr(4,i)=0) then
			newsHref=SiteUrl&"/"&TempArr(1,i)
		else
			newsHref=TempArr(1,i)
		end if
		GetImgNews3=GetImgNews3&"<td align=""center""><div align=""center"">"&chr(13)
		GetImgNews3=GetImgNews3&"<a href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&">"
			GetImgNews3=GetImgNews3&"<img alt="""&TempArr(0,i)&""" src="""&SiteUrl&"/"&Imgsavedir&"/"&TempArr(2,i)&""" width="""&imgW&""" height="""&imgH&""" border=""0"">"
		GetImgNews3=GetImgNews3&"</a>"&chr(13)
	GetImgNews3=GetImgNews3&"</div><div style=""line-height:"&lineheight&"px"">"&chr(13)
  GetImgNews3=GetImgNews3&"<a href="&""""&newsHref&""""&" class="""&linkStyle&""" title="""&TempArr(0,i)&""" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,i)&""">"&gotTopic(TempArr(0,i),max)&"</span></a>"&chr(13)
  GetImgNews3=GetImgNews3&"</div></td>"&chr(13)
 	next 
 	GetImgNews3=GetImgNews3&"</tr>"&chr(13)
	GetImgNews3=GetImgNews3&"</table>"&chr(13)
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：GetMultiTxtNews(classid,lineheight,n,tablename,orders,max,linkStyle,key)
'作用：获得N条带图片、标题的新闻，图片在上，文字在下(repeat by td)
'参数：containwidth  ---容器宽度
'      lineheight    ---行高
'      n  	     ---取个数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      max           ---最大字数
'      imgH          ---图像高度
'      imgW          ---图像宽度
'      linkStyle     ---链接样式
'	   key		     ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
' 例：GetImgNews3(241,"100%",20,2,"news","id",20,100,100,"red","")
'=====================================================================
function GetMultiTxtNews(classid,tablewidth,lineheight,tdStyle,tablename,orders,titlePrefix,max,linkStyle,key,rowsNum,colsNum)
	dim newsHref,tprefix
	set rs=server.CreateObject("adodb.recordset")  
	n=rowsNum*colsNum
	'response.Write(n)
  	sql="select top "&n&" title,pagepath,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"	
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  		TempArr=rs.GetRows()	
  		rs.close
		set rs=nothing 
		TempImgNesCount=ubound(TempArr,2)+1	
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		GetMultiTxtNews=GetMultiTxtNews&"<table width="&tablewidth&"  border=0 align=center cellpadding=0 cellspacing=0>"&Chr(13)
		for rows=0 to rowsNum-1'rowsNum行
		
			GetMultiTxtNews=GetMultiTxtNews&"<tr>"&Chr(13)
			for cols=0 to colsNum-1'colsNum列
				if (rows*colsNum+cols>=TempImgNesCount) then
		  			exit for
		  		end if
				if(titlePrefix="auto") then
					tprefix=rows*colsNum+cols+1
				else
					tprefix=titlePrefix
				end if
				if(TempArr(3,(rows*colsNum)+cols)=0) then
					newsHref=SiteUrl&"/"&TempArr(1,(rows*colsNum)+cols)
				else
					newsHref=TempArr(1,(rows*colsNum)+cols)
				end if
				GetMultiTxtNews=GetMultiTxtNews&"<td class="""&tdStyle&""" height="&""""&lineheight&""""&">"&Chr(13)				
        		GetMultiTxtNews=GetMultiTxtNews&tprefix&" <a href="&""""&newsHref&""""&" title="""&TempArr(0,rows*colsNum+cols)&""" target="&""""&"_blank"&""""&">"&Chr(13)
				GetMultiTxtNews=GetMultiTxtNews&"<span style=""color: "&TempArr(2,rows*colsNum+cols)&""">"&gotTopic(TempArr(0,rows*colsNum+cols),max)&"</span>"&Chr(13)
				GetMultiTxtNews=GetMultiTxtNews&"</a></td>"&Chr(13)     			
			next
			GetMultiTxtNews=GetMultiTxtNews&"</tr>"&Chr(13)				
			
		next
		GetMultiTxtNews=GetMultiTxtNews&"</table>"&Chr(13)	
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''		
	else
		rs.close
		set rs=nothing
	end if
end function
'===================================================================
'获得专题新闻
'==================================================================
function GetSpecialNews(specialid,tablewidth,lineheight,tdStyle,tablename,orders,titlePrefix,max,linkStyle,key,rowsNum,colsNum)
	dim newsHref,tprefix
	set rs=server.CreateObject("adodb.recordset")  
	n=rowsNum*colsNum
	'response.Write(n)
  	sql="select top "&n&" title,pagepath,title_color,isoutlink from "&tablename&" where checked=true and specialid="&specialid
	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" order by "&orders&" desc"	
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  		TempArr=rs.GetRows()	
  		rs.close
		set rs=nothing 
		TempImgNesCount=ubound(TempArr,2)+1
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		GetSpecialNews=GetSpecialNews&"<table width="&tablewidth&"  border=0 align=center cellpadding=0 cellspacing=0>"&Chr(13)
		for rows=0 to rowsNum-1'rowsNum行
		
			GetSpecialNews=GetSpecialNews&"<tr>"&Chr(13)
			for cols=0 to colsNum-1'colsNum列
				if (rows*colsNum+cols>TempImgNesCount) then
		  			exit for
		  		end if
				if(titlePrefix="auto") then
					tprefix=rows*colsNum+cols+1
				else
					tprefix=titlePrefix
				end if
				if(TempArr(3,(rows*colsNum)+cols)=0) then
					newsHref=SiteUrl&"/"&TempArr(1,(rows*colsNum)+cols)
				else
					newsHref=TempArr(1,(rows*colsNum)+cols)
				end if
				GetSpecialNews=GetSpecialNews&"<td class="""&tdStyle&""" height="&""""&lineheight&""""&">"&Chr(13)				
        		GetSpecialNews=GetSpecialNews&tprefix&" <a href="&""""&newsHref&""""&" title="""&TempArr(0,rows*colsNum+cols)&""" target="&""""&"_blank"&""""&">"&Chr(13)
				GetSpecialNews=GetSpecialNews&"<span style=""color: "&TempArr(2,rows*colsNum+cols)&""">"&gotTopic(TempArr(0,rows*colsNum+cols),max)&"</span>"&Chr(13)
				GetSpecialNews=GetSpecialNews&"</a></td>"&Chr(13)     			
			next
			GetSpecialNews=GetSpecialNews&"</tr>"&Chr(13)				
			
		next
		GetSpecialNews=GetSpecialNews&"</table>"&Chr(13)	
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''		
	else
		rs.close
		set rs=nothing
	end if
end function
'=======================================================================
'函数：GetMultiImgNews(classid,containwidth,lineheight,n,tablename,orders,max,imgW,imgH,linkStyle,key)
'作用：获得N条带图片、标题的新闻，图片在上，文字在下(repeat by td)
'参数：containwidth  ---容器宽度
'      lineheight    ---行高
'      n  	     ---取个数
'      tablename     ---表名
'      classid       ---类别ID
'      orders        ---按排序
'      max           ---最大字数
'      imgH          ---图像高度
'      imgW          ---图像宽度
'      linkStyle     ---链接样式
'	   key		     ---类型，top1<=>头条，totop<=>置顶,tohot<=>热点,recommend<=>推荐,imgnews<=>图文
' 例：GetImgNews3(241,"100%",20,2,"news","id",20,100,100,"red","")
'=====================================================================
function GetMultiImgNews(classid,containwidth,lineheight,imgBorderW,imgBorderH,tablename,orders,max,imgW,imgH,linkStyle,key,rowsNum,colsNum)
	dim newsHref
	if(imgW=0 or imgH=0) then
		imgW="100"
		imgH="100"
	end if
	set rs=server.CreateObject("adodb.recordset")  
	n=rowsNum*colsNum
	'response.Write(n)
  	'sql="select top "&n&" title,pagepath,photo,title_color,isoutlink from "&tablename&" where checked=true and classid="&classid
	sql="select top "&n&" title,pagepath,photo,title_color,isoutlink from "&tablename&" where checked=true"
	if(classid>0) then
   	sql=sql&" and classid="&classid
	end if

	Select Case LCase(key)
		Case "top1"
			sql=sql&" and top1=1"
		Case "totop"
			sql=sql&" and totop=1"
		Case "tohot"
			sql=sql&" and tohot=1"
		Case "recommend"
			sql=sql&" and recommend=true"
		Case "imgnews"
			sql=sql&" and imgnews=true"
		Case Else				
	End Select
	sql=sql&" and photo<>'' order by "&orders&" desc"
  	set rs=conn.execute(sql)
	if not rs.eof and not rs.bof then
  		TempArr=rs.GetRows()	
  		rs.close
		set rs=nothing 
		TempImgNesCount=ubound(TempArr,2)+1
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		GetMultiImgNews=GetMultiImgNews&"<table width="&containwidth&"  border=0 align=center cellpadding=0 cellspacing=0>"&Chr(13)
		for rows=0 to rowsNum-1'rowsNum行
		
			GetMultiImgNews=GetMultiImgNews&"<tr>"&Chr(13)
			for cols=0 to colsNum-1'colsNum列
				if (rows*colsNum+cols>TempImgNesCount) then
		  			exit for
		  		end if
				if(TempArr(4,(rows*colsNum)+cols)=0) then
					newsHref=SiteUrl&"/"&TempArr(1,(rows*colsNum)+cols)
				else
					newsHref=TempArr(1,(rows*colsNum)+cols)
				end if
				GetMultiImgNews=GetMultiImgNews&"<td height="&""""&imgBorderW&""""&"><table width="&""""&imgBorderW&""""&" height="&""""&imgBorderH&""""&" border="&""""&"0"&""""&" align="&""""&"center"&""""&" cellpadding="&""""&"0"&""""&" cellspacing="&""""&"0"&""""&" style="&""""&"border:1px solid #BBBBBB; "&""""&">"&Chr(13)
				GetMultiImgNews=GetMultiImgNews&"<tr>"&Chr(13)
          		GetMultiImgNews=GetMultiImgNews&"<td style="&""""&"line-height:"&lineheight&";"&""""&"><div align=center><a href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&"><img width="&""""&imgW&""""&" height="&""""&imgH&""""&" src="&""""&SiteUrl&"/"&Imgsavedir&"/"&TempArr(2,rows*colsNum+cols)&""""&" alt="""&TempArr(0,rows*colsNum+cols)&""" border="&""""&"0"&""""&"></a></div></td>"&Chr(13)
        		GetMultiImgNews=GetMultiImgNews&"</tr>"&Chr(13)
      			GetMultiImgNews=GetMultiImgNews&"</table>"&Chr(13)
        		GetMultiImgNews=GetMultiImgNews&"<div style="&""""&"padding:5px;"&""""&" align="&""""&"center"&""""&"><a href="&""""&newsHref&""""&" target="&""""&"_blank"&""""&"><span style=""color: "&TempArr(3,rows*colsNum+cols)&""">"&gotTopic(TempArr(0,rows*colsNum+cols),max)&"</span></a></div></td>"&Chr(13)
     			
			next
			GetMultiImgNews=GetMultiImgNews&"</tr>"&Chr(13)				
			
		next
		GetMultiImgNews=GetMultiImgNews&"</table>"&Chr(13)	
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''		
	else
		rs.close
		set rs=nothing
	end if
end function
'====================================================================
'函数：getSpecialSelect(classid)
'作用：获得某个专题的所有子类
'参数：id 	---专题ID
'例：getSpecialSelect(32)
'===================================================================
function getSpecialSelect(classid)
dim ifselect,sql,rs
sql="select * from t_special order by id desc"
Set rs = conn.Execute(Sql)
if rs.eof or rs.bof then
	getSpecialSelect="<option value=""0"">暂时没有专题</option>"&Chr(13)
else
	getSpecialSelect="<option value=""0"">不属任何专题</option>"&Chr(13)
end if
while not rs.eof and not rs.bof
	if(Cint(rs("id"))=Cint(classid)) then
		ifselect=" selected"
	else
		ifselect=""
	end if
	getSpecialSelect=getSpecialSelect&"<option value="""&rs("id")&""" "&ifselect&">"&rs("title")&"</option>"&Chr(13)
	rs.movenext
wend
rs.close
set rs=nothing
end function
'====================================================================
'函数：getchildlist(id)
'作用：获得某个类的所有子类
'参数：id 	---类别ID
'linkStyle  ---链接样式
'例：arr=getchildlist(32,"|")
'===================================================================
function getchildlist(id,str,linkStyle)
dim relatePath,childList,rs,i
if(WebRootDir="/") then 
	relatePath=""
else
	relatePath=WebRootDir
end if
sql="select savedir,title,flag from catalogs where parentid="&id
Set rs = conn.Execute(Sql)
if not rs.eof and not rs.bof then
	childList=rs.GetRows()
	for i=0 to ubound(childList,2)
		if(childList(2,i)=true) then
			getchildlist=getchildlist&"<a class="""&linkStyle&""" href="""&relatePath&childList(0,i)&""">"&childList(1,i)&"</a>"&str
		else
			getchildlist=getchildlist&"<a class="""&linkStyle&""" href="""&relatePath&childList(0,i)&"/index_1.htm"">"&childList(1,i)&"</a>"&str
		end if
	next
	rs.close
	set rs=nothing
else
	rs.close
	set rs=nothing
end if
end function
'====================================================================
'函数：getnewsofcatalog
'====================================================================
function getnewsofcatalog(id)
	dim sql,rs,childList,ret,ischa
	sql="select id,savedir,title,flag from catalogs where parentid="&id
	Set rs = conn.Execute(Sql)
	if not rs.eof and not rs.bof then
		childList=rs.GetRows()
		rs.close
		set rs=nothing
		for i=0 to ubound(childList,2)
			if(childList(3,i)=true) then
				ischa=""
			else
				ischa="/index_1.htm"
			end if
			ret=ret&"<div class=""div_title""><div class=""col_right""><a href="""&childList(1,i)&ischa&""">更多&gt;&gt;</a></div><a href="""&childList(1,i)&ischa&""">"&childList(2,i)&"</a></div><ul>"&GetNewsLi(childList(0,i),10,"news","id","","·",35,1)&"</ul>"
		next
	else
		rs.close
		set rs=nothing
		getnewsofcatalog=""
	end if
	getnewsofcatalog=ret
end function
'====================================================================
'函数：getbrotherlist(id)
'作用：获得某个类的所有子类
'参数：id 	---类别ID
'linkStyle  ---链接样式
'例：arr=getchildlist(32,"|")
'===================================================================
function getbrotherlist(id,str,linkStyle)
dim relatePath,cur_parentid,rs,tempList,i,sql
cur_parentid=Cint(getparentid(id))
if(WebRootDir="/") then 
	relatePath=""
else
	relatePath=WebRootDir
end if
sql="select savedir,title,flag from catalogs where parentid="&cur_parentid
Set rs = conn.Execute(sql)
if not rs.eof and not rs.bof then
	tempList=rs.GetRows()	
	rs.close
	set rs=nothing
	for i=0 to ubound(tempList,2)
		if(tempList(2,i)=true) then
			getbrotherlist=getbrotherlist&"<a class="""&linkStyle&""" href="""&relatePath&tempList(0,i)&"/index_1.htm"">"&tempList(1,i)&"</a>"&str
		else
			getbrotherlist=getbrotherlist&"<a class="""&linkStyle&""" href="""&relatePath&tempList(0,i)&"/index_1.htm"">"&tempList(1,i)&"</a>"&str
		end if		
	next
else
	rs.close
	set rs=nothing
end if
end function
'====================================================================
'函数：getparentlist(id)
'作用：获得某个类的所有父类
'参数：id 	---类别ID
'例：arr=Split(getparentlist(32),"|")
'===================================================================
function getparentlist(id)
dim sql,rs
sql="select id,parentid from catalogs where id="&id
Set rs = conn.Execute(Sql)
if not rs.eof and rs.bof then
	getparentlist=getparentlist&rs("id")
	if(rs("parentid")<>0) then
		getparentlist=getparentlist&"|"&getparentlist(rs("parentid"))
	end if
	rs.close
	set rs=nothing
else
	rs.close
	set rs=nothing
end if
end function
'====================================================================
'函数：getPosition(id,str)
'作用：获得某个类的所有父类
'参数：id 	---类别ID
'===================================================================
function getPosition(id,str)
dim sql,rs,catalog_savedir,catalog_title,catalog_parentid,isChannel
sql="select savedir,title,parentid,flag from catalogs where id="&id
Set rs = conn.Execute(Sql)
if not rs.eof and not rs.bof then
	catalog_savedir=rs("savedir")
	catalog_title=rs("title")
	catalog_parentid=rs("parentid")
	isChannel=rs("flag")
	rs.close
	set rs=nothing
	if(isChannel=true) then
		getPosition=getPosition&str&"<a href="""&catalog_savedir&""">"&catalog_title&"</a>"
	else
		getPosition=getPosition&str&"<a href="""&catalog_savedir&"/index_1.htm"">"&catalog_title&"</a>"
	end if
	if(catalog_parentid<>0) then
		getPosition=getPosition(catalog_parentid,str)&getPosition
	end if
else
	rs.close
	set rs=nothing
end if

end function
'====================================================================
'函数：getparentid(id)
'作用：获得某个类的父类
'参数：id 	---类别ID
'例：pid=getparentid(33)
'===================================================================
function getparentid(id)
dim rs,sql
sql="select * from catalogs where id="&id
Set rs = conn.Execute(Sql)
if not rs.bof and not rs.bof then
if(rs("parentid")<>0) then
	getparentid=rs("parentid")
else
	getparentid=0
end if
end if
rs.close
set rs=nothing
end function
'====================================================================
'函数：getCatalogName(classid)
'作用：获得某个类的名字
'参数：classid 	---类别ID
'例：getCatalogName(33)
'===================================================================
function getCatalogName(classid)
dim sql,rs
sql="select title from catalogs where id="&classid
Set rs = conn.Execute(Sql)
if not rs.eof then
	getCatalogName=rs("title")
end if
rs.close
set rs=nothing
end function

'=======================================================================
'函数：GetFriendLink(rows,cols,linktype,ItColor1,ItColor2)
'作用：获得头条新闻标题
'参数：rows        ---行数
'      cols        ---列数
'      linktype    ---链接类型，0<>=文字链接，1<=>图片链接
'      ItColor1    ---交替的背景颜色一
'      ItColor2    ---交替的背景颜色二
'      例：GetFriendLink(4,8,0,"#0066CC","#FF6600")
'=====================================================================
function GetFriendLink(rows,cols,linktype,ItColor1,ItColor2)
	set rs=server.CreateObject("adodb.recordset")
	if(Cint(linktype)=0) then
		sql="select Title,LinkUrl from friendlink where Flag="&linktype
	elseif(Cint(linktype=1)) then
		sql="select Title,LinkUrl,Pic from friendlink where Flag="&linktype
	end if
  	set rs=conn.execute(sql)
	if not rs.eof then
  		TempArr=rs.GetRows()  
  		rs.close
		set rs=nothing   
		GetFriendLink=GetFriendLink&"<TABLE  style=""line-height:24px;"" cellSpacing=0 cellPadding=0 width=""100%"" border=0>"&Chr(10)
		for i=0 to rows-1' ubound(TempArr,2)按行循环
			if i mod 2=0 then
				GetFriendLink=GetFriendLink&"<TR bgColor="&ItColor1&">"&Chr(10)
			else
				GetFriendLink=GetFriendLink&"<TR bgColor="&ItColor2&">"&Chr(10)
			end if
			for j=0 to cols-1'按列循环
				GetFriendLink=GetFriendLink&"<TD><DIV align=center>"&Chr(10)
				if(linktype=0) then
					if(i*cols+j<=ubound(TempArr,2)) then
						GetFriendLink=GetFriendLink&"<A href="""&TempArr(1,i*cols+j)&""" title="""&TempArr(0,i*cols+j)&""" target=_blank>"&TempArr(0,i*cols+j)&"</A>"&Chr(10)
					else
						GetFriendLink=GetFriendLink&"<A href="""&SiteUrl&""" target=_blank>友情链接</A>"&Chr(10)
					end if
				else
					if(i*cols+j<=ubound(TempArr,2)) then
						GetFriendLink=GetFriendLink&"<a href="""&TempArr(1,i*cols+j)&""" target=""_blank""><img src="""&TempArr(2,i*cols+j)&""" width=""88"" height=""31"" border=""0"" alt="""&TempArr(0,i*cols+j)&"""></a>"&Chr(10)
					else
						GetFriendLink=GetFriendLink&"<A href="""&SiteUrl&""" target=_blank>友情链接</A>"&Chr(10)
					end if
				end if
				GetFriendLink=GetFriendLink&"</DIV></TD>"&Chr(10)
			next
		GetFriendLink=GetFriendLink&"</TR>"&Chr(10)
		next
		GetFriendLink=GetFriendLink&"</TABLE>"&Chr(10)	
	else
		rs.close
		set rs=nothing
	end if
end function

'=================================================================================
'                             +-转换所有标签-+
'函数：ReplaceStaticLabel(TempContWrit)
'功能：转换某个类别中模板内容中的所有标签
'参数：
'TempContWrit   ---待转换某个内容
'classid 		---栏目ID
'=================================================================================
function ReplaceStaticLabel(TempContWrit,ClassId)
	dim labelArr,returnStr
	returnStr=TempContWrit		
	if(Instr(TempContWrit,"$SiteUrl$")<>0) then
		returnStr=replace(returnStr,"$SiteUrl$",SiteUrl)
	end if
	if(Instr(TempContWrit,"$SiteName$")<>0) then
		returnStr=replace(returnStr,"$SiteName$",SiteName)
	end if
	if(Instr(TempContWrit,"$SiteTitle$")<>0) then
		returnStr=replace(returnStr,"$SiteTitle$",SiteTitle)
	end if
	if(Instr(TempContWrit,"$Year$")<>0) then
		returnStr=replace(returnStr,"$Year$",Year(now))
	end if
	if(Instr(TempContWrit,"$Month$")<>0) then
		returnStr=replace(returnStr,"$Month$",Month(now))
	end if
	if(Instr(TempContWrit,"$Day$")<>0) then
		returnStr=replace(returnStr,"$Day$",Day(now))
	end if
	if(Instr(TempContWrit,"$Time$")<>0) then
		returnStr=replace(returnStr,"$Time$",Time)
	end if
	if(Instr(TempContWrit,"$Random$")<>0) then
		returnStr=replace(returnStr,"$Random$",getRndNum())
	end if
	if(Instr(TempContWrit,"$classid$")<>0) then
		returnStr=replace(returnStr,"$classid$",ClassId)
	end if
	ReplaceStaticLabel=returnStr
end function

'=================================================================================
'                             +-转换所有标签-+
'函数：ReplaceAllLabel(TempContWrit,classid)
'功能：转换某个类别中模板内容中的所有标签
'参数：
'TempContWrit   ---待转换某个内容
'classid 		---栏目ID
'=================================================================================
function ReplaceAllLabel(TempContWrit,classid)
	dim labelArr,returnStr,repeat_ii,totinfo
	returnStr=TempContWrit
	
	returnStr=ReplaceStaticLabel(returnStr,classid)
	
	if(Instr(TempContWrit,"$position$")<>0) then
		returnStr=replace(returnStr,"$position$","<a href="""&SiteUrl&""">"&SiteTitle&"</a>"&getPosition(classid,"-&gt;"))
	end if
	if(Instr(TempContWrit,"$CurrentChilds$")<>0) then
		returnStr=replace(returnStr,"$CurrentChilds$",getchildlist(classid," ",""))
	end if
	if(Instr(TempContWrit,"$GetBrotherList$")<>0) then
		returnStr=replace(returnStr,"$GetBrotherList$",getbrotherlist(classid," ","a2"))
	end if	
	if(Instr(TempContWrit,"$NewsOfCatalog$")<>0) then
		returnStr=replace(returnStr,"$NewsOfCatalog$",getnewsofcatalog(classid))
	end if
	if(Instr(TempContWrit,"$ListName$")<>0) then
		returnStr=replace(returnStr,"$ListName$",getCatalogName(classid))
	end if
	if(Instr(TempContWrit,"$ListTitle$")<>0) then
		returnStr=replace(returnStr,"$ListTitle$",getCatalogName(classid)&"-"&SiteName&"-"&SiteUrl)
	end if
	if(Instr(TempContWrit,"$Head$")<>0) then
		returnStr=replace(returnStr,"$Head$",ReadFromTextFile(server.MapPath("/head.asp")))
	end if
	if(Instr(TempContWrit,"$Root$")<>0) then
		returnStr=replace(returnStr,"$Root$",ReadFromTextFile(server.MapPath("/root.asp")))
	end if
	
	Set rs = Server.CreateObject("adodb.recordset")
	rs.open "select labelname,content from label where labeltype=0 and (classid=0 or classid="&classid&") order by id desc",conn,3,1
	''''''''''''
	if not rs.eof or not rs.bof then
  		labelArr=rs.GetRows() 
	else
		ReplaceAllLabel=returnStr
		exit function
	end if
	rs.close
	set rs=nothing
	for repeat_ii=0 to ubound(labelArr,2)
			TempStr=labelArr(1,repeat_ii)
			TempStr = Left(TempStr,Instr(TempStr,"(")-1) & "," & Mid(TempStr,InStr(TempStr,"(")+1)
			TempStr = Left(TempStr,InStrRev(TempStr,")")-1)
			TempStr = Replace(TempStr,"""","")
			if(Instr(TempContWrit,labelArr(0,repeat_ii))<>0) then
				labelname=labelArr(0,repeat_ii)				
				response.Flush()
				labelDataContent=GetLableContent(TempStr,classid)
				returnStr=replace(returnStr,labelname,labelDataContent)
			end if
	next
	''''''''''''''''
	'替换自定义函数
	''''''''''''''''
	dim creg,c_funname,c_funcont,c_newfuncnt,c_sql,j,c_repeat
	Set creg= New RegExp
	creg.ignoreCase = true
	creg.Global = True 
	creg.Pattern = "\$Sub\[([\w]+)\]\$([\s|\S]*?)\$End\$"
	set cmatch=creg.Execute(returnStr)
	returnStr=creg.replace(returnStr,"$1")
	For Each m in cmatch 
		c_funname=m.SubMatches(0)
		c_funcont=m.SubMatches(1)
		c_repeat=""
		set rs=server.createobject("adodb.recordset")
		rs.open "select content from label where labelname='"&c_funname&"'",conn,3,1
		if not rs.eof then
			c_sql=rs(0)
		end if
		rs.close
		set rs=nothing
		'''''''''''''''''
		
		if(c_sql<>"") then
			set rs=server.createobject("adodb.recordset")
			rs.open c_sql,conn,3,1
			'''''''''''''''按行循环''''''''''''
			while not rs.eof
				c_newfuncnt=c_funcont
				for j=1 to rs.fields.count						
					c_newfuncnt=replace(c_newfuncnt,"$"&j,rs(j-1))
				next
				c_repeat=c_repeat&c_newfuncnt
				rs.movenext
			wend
			rs.close
			set rs=nothing
		end if
		returnStr=replace(returnStr,c_funname,c_repeat)
	Next
	''''''''''''
	ReplaceAllLabel=returnStr
end function
'===============================================================================
'                        +-获得所有标签内容-+
'===============================================================================
Function GetLableContent(LableStr,classid)
	Dim ParaArray
	ParaArray = Split(LableStr,",")
	if UBound(ParaArray) = 0 then
		GetLableContent = ""
		Exit Function
	else
		Select Case LCase(ParaArray(0))
			Case "getnews"'获得指定类的前N条文字记录
				if UBound(ParaArray) = 12 then
					GetLableContent = GetNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getnewsli"'获得指定类的前N条文字记录
				if UBound(ParaArray) = 8 then
					GetLableContent = GetNewsLi(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getnewsall"'获得总新闻表中的前N条文字记录
				if UBound(ParaArray) = 14 then
					GetLableContent = GetNewsAll(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12),ParaArray(13),ParaArray(14))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getimgnews"'获得指定类的前N条图片文字记录(图上文下)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getimgnews2"'获得指定类的前N条图片文字记录(左图右上标题右下内容)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews2(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getimgnews3"'获得指定类的前N条图片文字记录(repeat by td)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews3(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getmultitxtnews"'获得指定类的前N条文字记录(repeat by td)
				if UBound(ParaArray) = 12 then
					GetLableContent = GetMultiTxtNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getspecialnews"
				if UBound(ParaArray) = 12 then
					GetLableContent = GetSpecialNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getmultiimgnews"'获得指定类的前N条图片文字记录(repeat by td)
				if UBound(ParaArray) = 14 then
					GetLableContent = GetMultiImgNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12),ParaArray(13),ParaArray(14))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getcurrentnews"'获得当前类的前N条文字记录
				if UBound(ParaArray) = 12 then					
					GetLableContent = GetNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),classid,ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			
			Case "get1image"'获得指定类的第一条图片信息
				if UBound(ParaArray) = 6 then
					GetLableContent = Get1Image(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getcurrent1image"'获得当前类的第一条图片信息
				if UBound(ParaArray) = 6 then
					GetLableContent = Get1Image(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
				
			Case "get1title"'获得指定类的第一条标题信息
				if UBound(ParaArray) = 5 then
					GetLableContent = Get1Title(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getcurrent1title"'获得当前类的第一条标题信息
				if UBound(ParaArray) = 5 then
					GetLableContent = Get1Title(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getCurimgnews1"'获得当前类的前N条图片文字记录(图上文下)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getCurimgnews2"'获得当前类的前N条图片文字记录(左图右上标题右下内容)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews2(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getCurimgnews3"'获得当前类的前N条图片文字记录(repeat by td)
				if UBound(ParaArray) = 11 then
					GetLableContent = GetImgNews3(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "get1content"'获得指定类的第一条内容信息
				if UBound(ParaArray) = 5 then
					GetLableContent = Get1Content(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getcurrent1content"'获得当前类的第一条内容信息
				if UBound(ParaArray) = 5 then
					GetLableContent = Get1Content(classid,ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getchildlist"'获得当前类的第一条内容信息
				if UBound(ParaArray) = 3 then
					GetLableContent = getchildlist(ParaArray(1),ParaArray(2),ParaArray(3))
					'response.Write("--"&classid)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case "getfriendlink"'获得指定类的第一条标题信息
				if UBound(ParaArray) = 5 then
					GetLableContent = GetFriendLink(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5))
					'response.Write(GetLableContent)
				else
					GetLableContent = ""
					Exit Function
				end if
			Case Else

				GetLableContent = ""
				Exit Function
		End Select
	end if
End Function

'==============================================================================
'                               显示分页函数
'==============================================================================
function showPage(currentpage,totalnum,pagenum)
if CurrentPage>1then
showPage=showPage&("["&"<a href='index_"&currentpage-1&".htm'>上一页</a>]&nbsp;&nbsp;&nbsp;")
else showPage=showPage&("上一页&nbsp;&nbsp;&nbsp;")
end if 
if CurrentPage>=int(pagenum) then 
showPage=showPage&("下一页" )
else
showPage=showPage&("["&"<a href='index_"&currentpage+1&".htm'>下一页</a>]")
end if
showPage=showPage&("&nbsp;共"&totalnum+1&"条&nbsp;")
showPage=showPage&("&nbsp;共"&pagenum&"页&nbsp;")
showPage=showPage&("&nbsp;第"&currentpage&"页&nbsp;")  	
end function	

sub ActionRecord(s1,s2,s3,s4)

end sub
%>