<%
'class cls_templates
'=============================
'通用新闻调用
'参数 id,调用id，支持"11,22"多ID调用
'     zs,字数,ts条数 if_date是否显示时间
function articleindex(id,zs,ts,if_date)
Response.Write "<table width=""99%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"&VbStr
'if id="0" then 
'temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news order by id desc")
'else
temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news where sortid in("&id&") order by id desc")
'end if 
 if isarray(temps) then 
 for i=0 to ubound(temps,2)
 response.write "<tr><td height=""24"" align=""left"" valign=""middle"">"
 response.write "<img src=""/images/news.jpg""></img>&nbsp; <a target=_blank href=show.asp?id="&temps(0,i)&">"&tx_common.topictitle(temps(1,i),zs)&"</a></td>"&vbstr
 if if_date<>0 then response.write "<td width=""22%"">"&temps(2,i)&"</td>"
 response.write "</tr>"
 next
 else
 response.write "<tr><td>暂时没有任何内容</td></tr>"
 end if 
 response.write "</table>"
end function 

function articleindex1(id,zs,ts,if_date)
Response.Write "<table width=""99%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"&VbStr
'if id="0" then 
'temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news order by id desc")
'else
temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news where sortid in("&id&") order by id desc")
'end if 
 if isarray(temps) then 
 for i=0 to ubound(temps,2)
 response.write "<tr><td height=""24"" align=""left"" valign=""middle"">"
 response.write "<img src=""/images/fl.gif""></img>&nbsp; <a target=_blank href=view.asp?id="&temps(0,i)&">"&tx_common.topictitle(temps(1,i),zs)&"</a></td>"&vbstr
 if if_date<>0 then response.write "<td width=""22%"">"&temps(2,i)&"</td>"
 response.write "</tr>"
 next
 else
 response.write "<tr><td>暂时没有任何内容</td></tr>"
 end if 
 response.write "</table>"
end function 

'==============================================
'热门调用
'ts
function articleHot(zs,ts,if_date)
Response.Write "<table width=""94%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"&VbStr
'if id="0" then 
'temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news order by id desc")
'else
temps=tx_common.query("select top "&ts&" id,title,addtime from tx_news where if_hot=1 order by id desc")
'end if 
 if isarray(temps) then 
 for i=0 to ubound(temps,2)
 response.write "<tr><td height=""24"" align=""left"" valign=""middle"">"
 response.write "<img src=""/images/hot.gif""></img>&nbsp; <a href=view.asp?id="&temps(0,i)&">"&tx_common.topictitle(temps(1,i),zs)&"</a></td>"&vbstr
 if if_date<>0 then response.write "<td width=""22%"">"&temps(2,i)&"</td>"
 response.write "</tr>"
 next
 else
 response.write "<tr><td>暂时没有任何内容</td></tr>"
 end if 
 response.write "</table>"
end function 
'==============================================
'公告调用
'ts
function getmynews()
temps=tx_common.query("select top 1 id,tx_title,tx_content from tx_announce order by id desc")
if  isarray(temps) then
content = temps(2,0)
else
content = "暂时没有任何公告！"
end if 
response.write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"
response.write "<tr><td align=left>"&content&"</td></tr>"
response.write "</table>"
end function 
'===============================================
'新闻调用
'sid ID LS行数 iftime 是否显示时间，orderby 排序方式 att
'==============================================
function article_list(sid,ls,iftime,orderby)
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
   <% 
if sortid="0" then
sqls=""
else
sqls=" where sortid in("&sid&") "
end if 
              sql="select * from tx_news "&sqls&" order by "&orderby&" desc"
					 tx_pages.getconn=conn
					 tx_pages.getsql=sql
                  tx_pages.pagesize=ls
                 set rs=tx_pages.getrs()
                 for i=1 to tx_pages.pagesize
				   if not rs.eof then 
				%>
				  <tr>
                    <td height="30" valign="middle">· <a href="show.asp?id=<%=rs("id")%>"><%=rs("title")%></a>
				<%	if iftime=1 then response.write "&nbsp;&nbsp;&nbsp;&nbsp;"&rs("addtime")%>
				</td>
                    </tr>		  
<%
		      rs.movenext
   else
   exit for
   end if 
next					
%>
 <tr><td height=35 align="left">
				<%
response.write tx_pages.showpage()
				rs.close
			  %>
		 </td></tr></table>
				<%
end function 

function article_list1(sid,ls,iftime,orderby)
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
   <% 
if sortid="0" then
sqls=""
else
sqls=" where sortid in("&sid&") "
end if 
              sql="select * from tx_news "&sqls&" order by "&orderby&" desc"
					 tx_pages.getconn=conn
					 tx_pages.getsql=sql
                  tx_pages.pagesize=ls
                 set rs=tx_pages.getrs()
                 for i=1 to tx_pages.pagesize
				   if not rs.eof then 
				%>
				  <tr>
                    <td height="30" valign="middle"><img src="file:///E|/www/images/bl.gif"/> <a href="view.asp?id=<%=rs("id")%>"><%=rs("title")%></a>
				<%	if iftime=1 then response.write "&nbsp;&nbsp;&nbsp;&nbsp;"&rs("addtime")%>
				</td>
                    </tr>		  
<%
		      rs.movenext
   else
   exit for
   end if 
next					
%>
 <tr><td height=35 align="left">
				<%
response.write tx_pages.showpage()
				rs.close
			  %>
		 </td></tr></table>
				<%
end function 
'==============================================
'分类调用
'=============================================
function sortlist()

end function 
'====================================
'单页面简介调用
'str 调用id
function mainindex(str)
Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"&VbStr
temps=tx_common.query("select id,mainindex from tx_main where sortid="&str)
if isarray(temps) then
response.write "<tr><td align=left valign=top>"&temps(1,0)&"</td></tr>"&vbstr
else
response.write "<tr><td>暂时没有任何简介内容</td></tr>"
end if 
response.write "</table>"
end function 
'=====================================
'单页面调用
'str 调用id
'====================================
function get_main(str)
temps=tx_common.query("select content from tx_main where sortid="&str)
if isarray(temps) then 
get_main=temps(0,0)
else
get_main="暂时没有任何内容"
end if 
end function 
'====================================
'自定义标签调用
'str 调用标签名称
'=====================================
function mytags(str)
temps=tx_common.query("select content from tx_templates where title='"&str&"'")
if isarray(temps) then 
mytag = temps(0,0)
else
mytag = "标签调用错误"
end if 
mytag = replace(mytag,"{tx_setting(","<%=tx_setting(")
mytags= replace(mytag,")}",")% >")

end function 
'===========================================
'产品展示2
'===========================================
function product(ts,sortid,orderby,ls,picw,pich)
catatitle=request.QueryString("cataname")
if sortid=0 then sortid=tx_common.CheckStr(request.QueryString("cataid"),1)
if sortid="" then 
sqls=""
else
sqls=" where sortid in("&sortid&") "
end if 
response.write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
response.write "<tr>"
   sql="select * from tx_news "&sqls&" order by "&orderby&" desc"
					 tx_pages.getconn=conn
					 tx_pages.getsql=sql
                  tx_pages.pagesize=ts
                 set rs=tx_pages.getrs()
                 for i=1 to tx_pages.pagesize
				   if not rs.eof then 
response.write " <td height="""&pich+20&""" align=""center"" valign=""middle""><div style=""border:1px #CCCCCC solid;width:136px;height:111px;padding-top:2px;""><a href=""anlishow.asp?id="&rs("id")&""">"
response.write "<img src="""&rs("d_picture")&""" width="""&picw&""" height="""&pich&""" alt="""&rs("title")&""" border=0/></a></div></td>"
if i mod ls = 0 then response.write "</tr><tr>"
		      rs.movenext
   else
   exit for
   end if 
next
					
 response.write "<tr><td colspan="&ls&" height=35 align=""center"">"
response.write tx_pages.showpage()
				rs.close
response.write "</tr>"
 response.write " </table>"
 end function
 '========================================
 '显示
 '========================================
 function news_show()
 id=tx_common.CheckStr(request.QueryString("id"),1)
 temps=tx_common.query("select title,content from tx_news where id="&id)
 if isarray(temps) then
 response.write "<table width=""98%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
response.write "<tr>"
			response.write "<td height=""50"" align=""center"" style="" border-bottom-style:dashed; border-bottom-width:1px;border-bottom-color:#999999;""><h4>"
			response.write temps(0,0)&"</h4></td>"
              response.write "</tr>"
			  response.write "<tr><td align=left valign=top style="" padding:0px 30px; line-height:20px; "">"&temps(1,0)&"</tr>"
          response.write "  </table>"
 else
 response.write "参数调用错误！请不要试图破坏"
 end if 
 end function 
'============================================
'产品展示
'=========================================
function productlist1(sts,sortid,orderby,ls,picw,pich)
	response.write "		<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
			 response.write "<tr>"
sql="select top "&sts&" id,title,d_picture from tx_news where sortid in("&sortid&") and if_tj=1 order by "&orderby&" desc"
productlisttemps=tx_common.query(sql)
if isarray(productlisttemps) then 
for i=0 to ubound(productlisttemps,2)
j=i+1
response.write " <td height="""&pich+20&""" align=""center"" valign=""middle""><a href=""show.asp?id="&productlisttemps(0,i)&""" target=""_blank"">"
response.write "<img src="""&productlisttemps(2,i)&""" width="""&picw&""" height="""&pich&""" alt="""&productlisttemps(1,i)&""" border=0/></a><div align=center>"&productlisttemps(1,i)&"</div></td>"
if j mod ls = 0 then
response.write "</tr><tr>"
  end if 
if j=sts then exit for
  next
  else
  response.write "<td >没有任何信息</td>"
  end if 
 response.write " </tr></table>"
end function 

'============================================
'产品展示
'=========================================
function productlist(sts,sortid,orderby,ls,picw,pich)
	response.write "		<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
			 response.write "<tr>"
sql="select top "&sts&" id,title,d_picture from tx_news where sortid in("&sortid&") and if_tj=1 order by "&orderby&" desc"
productlisttemps=tx_common.query(sql)
if isarray(productlisttemps) then 
for i=0 to ubound(productlisttemps,2)
j=i+1
response.write " <td height="""&pich&""" align=""center"" valign=""left"">"
response.write "<div style=""border:1px #CCCCCC solid;width:144px;height:121px;padding-top:2px;""><a href=""anlishow.asp?id="&productlisttemps(0,i)&""" target=""_blank""><img src="""&productlisttemps(2,i)&""" width="""&picw&""" height="""&pich&""" alt="""&productlisttemps(1,i)&""" border=0/></a></div></td>"
if j mod ls = 0 then
response.write "</tr><tr>"
  end if 
if j=sts then exit for
  next
  else
  response.write "<td >没有任何信息</td>"
  end if 
 response.write " </tr></table>"
end function 
'============================================
'留言显示列表
'ts每页显示条数
'===========================================
function booklist(ts)

end function 
'============================================
'focus幻灯图片调用
'w 宽 h高 text_height标题高度 defjpeg 
'============================================
function news_focus(w,h,text_height)
news_focus="<script language=""javascript"">"& vbCrLf
news_focus= news_focus &"linkarr = new Array();"& vbCrLf
news_focus= news_focus &"picarr = new Array();"& vbCrLf
news_focus= news_focus &"textarr = new Array();"& vbCrLf
news_focus= news_focus &"var focus_width="&w&"; //宽度"& vbCrLf
news_focus= news_focus &"var focus_height="&h&";"& vbCrLf
news_focus= news_focus &"var text_height="&text_height&"; //标题高度"& vbCrLf
news_focus= news_focus &"var pics ='';//图片地址"& vbCrLf
news_focus= news_focus &"var links ='';//相对于图片的链接地址"& vbCrLf
news_focus= news_focus &"var texts ='';//标题文字"& vbCrLf
news_focus= news_focus &"var swf_height = focus_height+text_height; //相加之和最好是偶数,否则数字会出现模糊失真的问题"& VbStr
news_focus= news_focus &"var defJpeg = '/plus/img/jpeg.jpg';"& vbCrLf
temps=tx_common.query("select top 5 id,title,d_picture from tx_news where if_focus=1 and d_picture<>''")
if isarray(temps) then 
for i=0 to ubound(temps,2)
news_focus= news_focus &"linkarr["&i+1&"] =""show.asp?id="&temps(0,i)&""";"& vbCrLf
news_focus= news_focus &"picarr["&i+1&"] ="""&temps(2,i)&""";"& vbCrLf
news_focus= news_focus &"textarr["&i+1&"] ="""&temps(1,i)&""";"& vbCrLf
next
end if

news_focus= news_focus &"</script>"& vbcrlf
news_focus= news_focus &"<SCRIPT language=JavaScript src=""js/focus.js""></script>"&vbcrlf

end function 
'============================================
'调查调用
'str 调查ID 0为系统默认
'============================================
function vote()

end function 
'=================================================
'调用连接 logo 是否图片 td 单行数目
function links(logo,td)
Response.Write "<table width=""95%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"&VbStr
temps=tx_common.query("select webname,weburl,weblogo,webcontent from tx_link order by id desc")
if isarray(temps) then 
response.write "<tr><td valign=midden align=left style='line-height:28px;'>"
for i=0 to ubound(temps,2)
response.write "<a href="&temps(1,i)&" target=_blank>"
if logo=1 then
response.write"<img src="&temps(2,i)&" border='0'>"
else
response.write temps(0,i)
end if 
response.write "</a>&nbsp;&nbsp;"

next
response.write "</td></tr>"
else
response.write "<tr><td>没有友情连接</td></tr>"
end if 
response.write "</table>"
end function 
function weburllist()

end function 

function jobindex()

end function 

function maincontent()

end function 

function articlelist()

end function 
function joblist()

end function 
function book()

end function 
function bookshow()

end function 
function thenext()
id= request.QueryString("id")
sqlt = "select sortid from tx_news where id="&id
rst = tx_common.query(sqlt)
if isarray(rst) then
   stid=rst(0,0)
End if
sql="select top 1 id,title from tx_news where id>"&id &"and sortid="&stid&" order by id asc"
rs=tx_common.query(sql)
if isarray(rs) then
	thenext=("下一篇：<a href=""?id="&rs(0,0)&""">"&rs(1,0)&"</a>") 
	else
	thenext=("下一篇：没有下一篇了")
	End if
	
end function 
function thelast()
id= request.QueryString("id")
sqlt = "select sortid from tx_news where id="&id
rst = tx_common.query(sqlt)
if isarray(rst) then
   stid=rst(0,0)
End if
sql="select top 1 id,title from tx_news where id<"&id&"and sortid="&stid&" order by id DESC"
rs=tx_common.query(sql)
if isarray(rs) then
	thelast=("上一篇：<a href=""?id="&rs(0,0)&""">"&rs(1,0)&"</a>")  
	else
	thelast=("上一篇：没有上一篇了")
	End if

end function 

'end class
%>