www.gusucode.com > 木犁IT产品管理系统 1.0 beta1码程序 > SysProduct.asp

    <!--#include file="conn.asp" -->
<%
dim strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr, errmsg
dim BigClassName,SmallClassName,keyword,strField
dim rs,sql,sqlProduct,rsProduct,sqlSearch,rsSearch,sqlBigClass,rsBigClass
BeginTime=Timer
BigClassName=Trim(request.querystring("BigClassName"))
SmallClassName=Trim(request.querystring("SmallClassName"))
keyword=trim(request("keyword"))
if keyword<>"" then 
	keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
end if
strField=trim(request("Field"))
if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if
'sqlBigClass="select * from BigClass order by BigClassID"
'Set rsBigClass= Server.CreateObject("ADODB.Recordset")
'rsBigClass.open sqlBigClass,conn,1,1

'*************************************************
'函数名:gotTopic
'作  用:截字符串,汉字一个算两个字符,英文算一个字符
'参  数:str   ----原字符串
'       strlen ----截取长度
'返回值:截取后的字符串
'*************************************************
function gotTopic(str,strlen)
	if str="" then
		gotTopic=""
		exit function
	end if
	dim l,t,c, i
	str=replace(replace(replace(replace(str,"&nbsp;"," "),"&quot;",chr(34)),"&gt;",">"),"&lt;","<")
	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>=strlen then
			gotTopic=left(str,i) & "…"
			exit for
		else
			gotTopic=str
		end if
	next
	gotTopic=replace(replace(replace(replace(gotTopic," ","&nbsp;"),chr(34),"&quot;"),">","&gt;"),"<","&lt;")
end function

power="厦门随缘网络科技"
bb="随缘网络产品管理系统2.0"
adgg="承接网站建设及相关系统开发 同时提供优惠域名空间"
adtitle="厦门网站制作"
wz="http://www.115cn.cn"

'=================================================
'过程名:ShowSmallClass_Tree
'作  用:树形目录方式显示栏目
'参  数:无
'=================================================
Sub ShowSmallClass_Tree()
%>
<SCRIPT language=javascript>
function opencat(cat,img){
	if(cat.style.display=="none"){
	cat.style.display="";
	img.src="Images/class2.gif";
	}	else {
	cat.style.display="none"; 
	img.src="Images/class1.gif";
	}
}
</Script>
<div align="center">
<TABLE cellSpacing=0 cellPadding=0 width="60%" border=0>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
		sql="select * from BigClass"
		rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
	Response.Write "栏目正在建设中……"
else
	i=1
	do while not rsbig.eof
%>
	<TR>
		<TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=24 align=center><IMG id=img10<%=i%>000 src="Images/class1.gif" width=20 height=20></TD>
		<TD width="471"><a href='sort.asp?BigClassName=<%=rsbig("BigClassName")%>'><%=rsbig("BigClassName")%></a></TD>
	</TR>
	<TR>
		<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then 
		     response.write "style='DISPLAY'"   
		    else  
		     response.write "style='DISPLAY: none'"
		    end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from SmallClass where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
	Response.Write "没有小类"
else
	j=1
	do while not rsSmall.eof
%>
&nbsp;<IMG height=20 src="Images/class3.gif" width=26 align=absMiddle border=0><a href="sort.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
<%
	rsSmall.movenext
	j=j+1
	loop
end if
rsSmall.close
set rsSmall=nothing
%>
		</TD>
	</TR>
<%
	rsbig.movenext
	i=i+1
	loop
	rsbig.close
    set rsbig=nothing
end if
%>
</TABLE>
</div>


<%
end sub
'=================================================
'过程名:ShowSmallClass_Tree
'作  用:树形目录方式显示新闻栏目
'参  数:无
'=================================================
Sub newsclass()
%>
<SCRIPT language=javascript>
function opencat(cat,img){
	if(cat.style.display=="none"){
	cat.style.display="";
	img.src="Images/class2.gif";
	}	else {
	cat.style.display="none"; 
	img.src="Images/class1.gif";
	}
}
</Script>
<div align="center">
<TABLE cellSpacing=0 cellPadding=0 width="60%" border=0>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
		sql="select * from bg"
		rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
	Response.Write "栏目正在建设中……"
else
	i=1
	do while not rsbig.eof
%>
	<TR>
		<TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=24 align=center><IMG id=img10<%=i%>000 src="Images/class1.gif" width=20 height=20></TD>
		<TD width="471"><a href='news.asp?BigClassName=<%=rsbig("BigClassName")%>'><%=rsbig("BigClassName")%></a></TD>
	</TR>
	<TR>
		<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then 
		     response.write "style='DISPLAY'"   
		    else  
		     response.write "style='DISPLAY: none'"
		    end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from sm where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
	Response.Write "没有小类"
else
	j=1
	do while not rsSmall.eof
%>
&nbsp;<IMG height=20 src="Images/class3.gif" width=26 align=absMiddle border=0><a href="news.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
<%
	rsSmall.movenext
	j=j+1
	loop
end if
rsSmall.close
set rsSmall=nothing
%>
		</TD>
	</TR>
<%
	rsbig.movenext
	i=i+1
	loop
	rsbig.close
    set rsbig=nothing
end if
%>
</TABLE>
</div>

<%
end Sub
'=================================================
'过程名:ShowProductTotal
'作  用:显示新闻总数
'参  数:无
'=================================================
sub ShowProductTotal()
	dim sqlTotal
	dim rsTotal
	sqlTotal="select Count(*) from news"
	if BigClassName<>"" then
		sqlTotal=sqlTotal & " where BigClassName='" & BigClassName & "' "
		if SmallClassName<>"" then
			sqlTotal=sqlTotal & " and SmallClassName='" & SmallClassName & "' "
		end if	
	end if
	Set rsTotal= Server.CreateObject("ADODB.Recordset")
	rsTotal.open sqlTotal,conn,1,1
	if rsTotal.eof and rsTotal.bof then
		totalPut=0
		response.write "共有 0 个产品"
	else
		totalPut=rsTotal(0)
		'response.Write "共有 " & totalPut & " 个产品"
	end if
	rsTotal.close
	set rsTotal=nothing
end sub

'=================================================
'过程名:newsTotal
'作  用:显示新闻总数
'参  数:无
'=================================================
sub newsTotal()
	dim sqlTotal
	dim rsTotal
	sqlTotal="select Count(*) from xw"
	if BigClassName<>"" then
		sqlTotal=sqlTotal & " where BigClassName='" & BigClassName & "' "
		if SmallClassName<>"" then
			sqlTotal=sqlTotal & " and SmallClassName='" & SmallClassName & "' "
		end if	
	end if
	Set rsTotal= Server.CreateObject("ADODB.Recordset")
	rsTotal.open sqlTotal,conn,1,1
	if rsTotal.eof and rsTotal.bof then
		totalPut=0
		response.write "共有 0 条新闻"
	else
		totalPut=rsTotal(0)
		'response.Write "共有 " & totalPut & "条新闻"
	end if
	rsTotal.close
	set rsTotal=nothing
end sub

'=================================================
'过程名首页推荐:Showtj
'=================================================
sub Showtj(TitleLen,lss)
	if TitleLen<0 or TitleLen>200 then
		TitleLen=50
	end if
    if currentpage<1 then
	   	currentpage=1
    end if
	if (currentpage-1)*MaxPerPage>totalput then
		if (totalPut mod MaxPerPage)=0 then
	   		currentpage= totalPut \ MaxPerPage
		else
		   	currentpage= totalPut \ MaxPerPage + 1
		end if
   	end if
	if currentPage=1 then
        sqlProduct="select top " & MaxPerPage	
	else
		sqlProduct="select "
	end if
	sqlProduct=sqlProduct & " * from news where tj=1"
	
	if BigClassName<>"" then
		sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
		  if SmallClassName<>"" then
			sqlProduct=sqlProduct & "and SmallClassName='" & SmallClassName & "' "
		 end if
	end if
	sqlProduct=sqlProduct & " order by id desc"
	Set rsProduct= Server.CreateObject("ADODB.Recordset")
	rsProduct.open sqlProduct,conn,1,1
	if rsProduct.bof and  rsProduct.eof then
		response.Write("<br><li>暂无推荐产品!</li>")
	else
		if currentPage=1 then
			call ProductContenttj(TitleLen,lss)
		else
			if (currentPage-1)*MaxPerPage<totalPut then
         	   	rsProduct.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rsProduct.bookmark
            	call ProductContenttj(TitleLen,lss)
        	else
	        	currentPage=1
           		call ProductContenttj(TitleLen,lss)
	    	end if
		end if
	end if
	rsProduct.close
	set rsProduct=nothing
end sub


'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen,lss)
	if TitleLen<0 or TitleLen>200 then
		TitleLen=50
	end if
    if currentpage<1 then
	   	currentpage=1
    end if
	if (currentpage-1)*MaxPerPage>totalput then
		if (totalPut mod MaxPerPage)=0 then
	   		currentpage= totalPut \ MaxPerPage
		else
		   	currentpage= totalPut \ MaxPerPage + 1
		end if
   	end if
	if currentPage=1 then
        sqlProduct="select top " & MaxPerPage	
	else
		sqlProduct="select "
	end if
	sqlProduct=sqlProduct & " * from news"
	
	if BigClassName<>"" then
		sqlProduct=sqlProduct & " where BigClassName='" & BigClassName & "' "
		  if SmallClassName<>"" then
			sqlProduct=sqlProduct & "and SmallClassName='" & SmallClassName & "' "
		 end if
	end if
	sqlProduct=sqlProduct & " order by id desc"
	Set rsProduct= Server.CreateObject("ADODB.Recordset")
	rsProduct.open sqlProduct,conn,1,1
	if rsProduct.bof and  rsProduct.eof then
		response.Write("<br>暂无产品!")
	else
		if currentPage=1 then
			call ProductContenttj(TitleLen,lss)
		else
			if (currentPage-1)*MaxPerPage<totalPut then
         	   	rsProduct.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rsProduct.bookmark
            	call ProductContenttj(TitleLen,lss)
        	else
	        	currentPage=1
           		call ProductContenttj(TitleLen,lss)
	    	end if
		end if
	end if
	rsProduct.close
	set rsProduct=nothing
end sub

sub ProductContenttj(intTitleLen,cs)
       	dim i,strTemp,ViewList
         i=1
		 ViewList=cs
		strTemp= strTemp & "<TABLE align=center BORDER=0 CELLSPACING=1 CELLPADDING=0>"
		strTemp= strTemp & "<tr>"
	do while not rsProduct.eof
	 strTemp= strTemp & "<td width=140>"				
		strTemp= strTemp & "<table align=center width=140 border=0 cellspacing=2 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td colspan=2>"
              strTemp= strTemp &"<TABLE  border=0 cellPadding=0 cellSpacing=5>" 
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD align=middle width=140> <TABLE align=center border=0 cellPadding=0 cellSpacing=0>"       
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0ltop.gif' width=10></TD>"
   strTemp= strTemp &"<TD background='Img/bg_01.gif' height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rtop.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR> "
   strTemp= strTemp &"<TD background='Img/bg_03.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp & "<td>"&"<div align=center>"
   strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & replace(rsProduct("pic1"),"../","") & " width='100' height='90' border='0'>" & "</a></div>"  
   strTemp= strTemp & "</td>"
   strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0lbottom.gif' width=10></TD>"
   strTemp= strTemp &"<TD background=Img/bg_02.gif height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rbottom.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"          
   strTemp= strTemp &"</TABLE></TD>"
   strTemp= strTemp &"</TR>"  
   strTemp= strTemp &"</TABLE>"
                strTemp= strTemp & "</a></div></td>"
				strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=center height=12 width=100% >"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & left(rsProduct("Title"),10)&""
                strTemp= strTemp & "</a></td>"
				strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"		
        if i mod ViewList =0 then 
		   strTemp= strTemp & "</td></tr>"
        end if
           rsProduct.MoveNext      
		i=i+1
		if i>MaxPerPage then exit do			
	loop
		strtemp= strtemp & "</tr></table>"
		response.write strTemp  
end sub

sub ProductContent(intTitleLen,cs)
       	dim i,strTemp,ViewList
         i=1
		 ViewList=cs
		strTemp= strTemp & "<TABLE align=center BORDER=0 CELLSPACING=1 CELLPADDING=0>"
		strTemp= strTemp & "<tr>"
	do while not rsProduct.eof
	 strTemp= strTemp & "<td width=180>"				
		strTemp= strTemp & "<table align=center width=135 border=0 cellspacing=2 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td colspan=2>"
              strTemp= strTemp &"<TABLE  border=0 cellPadding=0 cellSpacing=5>" 
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD align=middle width=180> <TABLE align=center border=0 cellPadding=0 cellSpacing=0>"       
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0ltop.gif' width=10></TD>"
   strTemp= strTemp &"<TD background='Img/bg_01.gif' height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rtop.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR> "
   strTemp= strTemp &"<TD background='Img/bg_03.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp & "<td>"&"<div align=center>"
   strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & replace(rsProduct("pic1"),"../","") & " width='125' height='97' border='0'>" & "</a></div>"  
   strTemp= strTemp & "</td>"
   strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0lbottom.gif' width=10></TD>"
   strTemp= strTemp &"<TD background=Img/bg_02.gif height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rbottom.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"          
   strTemp= strTemp &"</TABLE></TD>"
   strTemp= strTemp &"</TR>"  
   strTemp= strTemp &"</TABLE>"
                strTemp= strTemp & "</a></div></td>"
				strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=center height=12 width=100% >"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & left(rsProduct("Title"),10)&""
                strTemp= strTemp & "</a></td>"
				strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"		
        if i mod ViewList =0 then 
		   strTemp= strTemp & "</td></tr>"
        end if
           rsProduct.MoveNext      
		i=i+1
		if i>MaxPerPage then exit do			
	loop
		strtemp= strtemp & "</tr></table>"
		response.write strTemp  
end sub


'***********************************************
'函数名:JoinChar
'作  用:向地址中加入 ? 或 &
'参  数:strUrl  ----网址
'返回值:加了 ? 或 & 的网址
'pos=InStr(1,"abcdefg","cd") 
'则pos会返回3表示查找到并且位置为第三个字符开始。
'这就是“查找”的实现,而“查找下一个”功能的
'实现就是把当前位置作为起始位置继续查找。
'***********************************************
function JoinChar(strUrl)
	if strUrl="" then
		JoinChar=""
		exit function
	end if
	if InStr(strUrl,"?")<len(strUrl) then 
		if InStr(strUrl,"?")>1 then
			if InStr(strUrl,"&")<len(strUrl) then 
				JoinChar=strUrl & "&"
			else
				JoinChar=strUrl
			end if
		else
			JoinChar=strUrl & "?"
		end if
	else
		JoinChar=strUrl
	end if
end function


'***********************************************
'过程名:showpage
'作  用:显示“上一页 下一页”等信息
'参  数:sfilename  ----链接地址
'       totalnumber ----总数量
'       maxperpage  ----每页数量
'       ShowTotal   ----是否显示总数量
'       ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用,否则会出现JS错误。
'       strUnit     ----计数单位
'***********************************************
sub showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
	dim n, i,strTemp,strUrl
	if totalnumber mod maxperpage=0 then
    	n= totalnumber \ maxperpage
  	else
    	n= totalnumber \ maxperpage+1
  	end if
  	strTemp= "<table bgcolor='#Ffffff' width='100%'  align='center'><form name='showpages' method='Post' action='" & sfilename & "'><tr><td width=100% align='center'>"
		if ShowTotal=true then 
		strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & "&nbsp;&nbsp;"
	end if
	strUrl=JoinChar(sfilename)
  	if CurrentPage<2 then
    		strTemp=strTemp & "首页 上一页&nbsp;"
  	else
    		strTemp=strTemp & "<a href='" & strUrl & "page=1'>首页</a>&nbsp;"
    		strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage-1) & "'>上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		strTemp=strTemp & "下一页 尾页"
  	else
    		strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage+1) & "'>下一页</a>&nbsp;"
    		strTemp=strTemp & "<a href='" & strUrl & "page=" & n & "'>尾页</a>"
  	end if
   	strTemp=strTemp & "&nbsp;页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
    strTemp=strTemp & "&nbsp;<b>" & maxperpage & "</b>" & strUnit & "/页"
    strTemp=strTemp & "&nbsp;共<b>" & totalput & "</b>条记录"
	if ShowAllPages=True then
		strTemp=strTemp & "&nbsp;转到:<select name='page' size='1' onchange='javascript:submit()'>"   
    	for i = 1 to n   
    		strTemp=strTemp & "<option value='" & i & "'"
			if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected "
			strTemp=strTemp & ">第" & i & "页</option>"   
	    next
		strTemp=strTemp & "</select>"
	end if
	strTemp=strTemp & "</td></tr></form></table>"
	response.write strTemp	
end sub

function getFileExtName(fileName)
    dim pos
    pos=instrrev(filename,".")
    if pos>0 then 
        getFileExtName=mid(fileName,pos+1)
    else
        getFileExtName=""
    end if
end function 
function getFileExtName(fileName)
    dim pos
    pos=instrrev(filename,".")
    if pos>0 then 
        getFileExtName=mid(fileName,pos+1)
    else
        getFileExtName=""
    end if
end function 

'=================================================
'过程名:ShowPrevProduct
'作  用:显示上一个产品
'参  数:TitleLen   ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowPrevProduct(TitleLen)
	dim rsPrev,sqlPrev
	sqlPrev="Select Top 1 * From news Where BigClassName='"&rs("BigClassName")&"' and ID<" & rs("ID")& " order by ID DESC"
	Set rsPrev= Server.CreateObject("ADODB.Recordset")
	rsPrev.open sqlPrev,conn,1,1
	if TitleLen<0 or TitleLen>255 then TitleLen=50
	if rsPrev.Eof then
	  	response.write "没有了"
	else
	  	response.write "<a href='ProductShow.asp?ID="&rsPrev("ID")& "&BigClass="&rs("BigClassName")&"' title='产品名称:" & rsPrev("Title") & vbcrlf & "更新时间:" & rsPrev("Time") & vbcrlf & "点击次数:" & rsPrev("Hits") &"'>" &gotTopic(rsPrev("Title"),TitleLen) &"</a>"
	end if
	rsPrev.close
	set rsPrev=nothing
end sub

'=================================================
'过程名:ShowNextProduct
'作  用:显示上一个产品
'参  数:TitleLen   ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNextProduct(TitleLen)
	dim rsNext,sqlNext
	sqlNext="Select Top 1 * From news Where BigClassName='"&rs("BigClassName")&"' and ID>" & rs("ID")& " order by ID ASC"
	Set rsNext= Server.CreateObject("ADODB.Recordset")
	rsNext.open sqlNext,conn,1,1
	if TitleLen<0 or TitleLen>255 then TitleLen=50
	if rsNext.Eof then
	 	response.write "没有了"
	else
	  	response.write "<a href='ProductShow.asp?ID="&rsNext("ID")& "&BigClass="&rs("BigClassName")&"' title='产品名称:" & rsNext("Title") & vbcrlf & "更新时间:" & rsNext("Time") & vbcrlf & "点击次数:" & rsNext("Hits") &"'>" &gotTopic(rsNext("Title"),TitleLen) &"</a>"
	end if
	rsNext.close
	set rsNext=nothing
end sub
%>

<% 
sub Shownews(TitleLen)
	if TitleLen<0 or TitleLen>200 then
		TitleLen=50
	end if
    if currentpage<1 then
	   	currentpage=1
    end if
	if (currentpage-1)*MaxPerPage>totalput then
		if (totalPut mod MaxPerPage)=0 then
	   		currentpage= totalPut \ MaxPerPage
		else
		   	currentpage= totalPut \ MaxPerPage + 1
		end if
   	end if
	if currentPage=1 then
        sqlProduct="select top " & MaxPerPage	
	else
		sqlProduct="select "
	end if
	sqlProduct=sqlProduct & " * from xw"	
	if BigClassName<>"" then
		sqlProduct=sqlProduct & " where BigClassName='" & BigClassName & "' "
		  if SmallClassName<>"" then
			sqlProduct=sqlProduct & "and SmallClassName='" & SmallClassName & "' "
		 end if
	end if
	sqlProduct=sqlProduct & " order by id desc"
	Set rsProduct= Server.CreateObject("ADODB.Recordset")
	rsProduct.open sqlProduct,conn,1,1
	if rsProduct.bof and  rsProduct.eof then
		response.Write("<br><li>没有任何新闻</li>")
	else
		if currentPage=1 then
			call showcontent(TitleLen)
		else
			if (currentPage-1)*MaxPerPage<totalPut then
         	   	rsProduct.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rsProduct.bookmark
            	call showcontent(TitleLen)
        	else
	        	currentPage=1
           		call showContent(TitleLen)
	    	end if
		end if
	end if
	rsProduct.close
	set rsProduct=nothing
end sub

sub showContent(TitleLen)
for j=1 to MaxPerPage 
%>
<div class="newstitle"><img border="0" src="qy_files/arr2.gif">【<%=rsproduct("bigclassname")%>】<a href="shownews.asp?id=<%= rsProduct("id") %>" ><%= left(rsProduct("TITLE"),30) %></a></div><div class="newstime"><%=rsProduct("time")%></div>
<%
rsProduct.movenext
if rsProduct.eof then exit for
next
end sub%>
<%
'==================================================
'过程名:ShowFriendLinks
'作  用:显示友情链接站点
'参  数:LinkType  ----链接方式,1为LOGO链接,2为文字链接
'       SiteNum   ----最多显示多少个站点
'       Cols      ----分几列显示
'       ShowType  ----显示方式。1为向上滚动,2为横向列表,3为下拉列表框
'==================================================
sub ShowFriendLinks(LinkType,SiteNum,Cols,ShowType)
	dim sqlLink,rsLink,SiteCount,i,strLink
	if LinkType<>1 and LinkType<>2 then
		LinkType=1
	else
		LinkType=Cint(LinkType)
	end if
	if SiteNum<=0 or SiteNum>100 then
		SiteNum=10
	end if
	if Cols<=0 or Cols>20 then
		Cols=10
	end if
	if ShowType=1 then'
        strLink=strLink & "<div id=rolllink style=overflow:hidden;height:340;width:204><div id=rolllink1>"    '新增加的代码
	elseif ShowType=3 then
		strLink=strLink & "<select name='FriendSite' onchange=""if(this.options[this.selectedIndex].value!=''){window.open(this.options[this.selectedIndex].value,'_blank');}""><option value=''>友情文字链接站点</option>"
	end if
	if ShowType=1 or ShowType=2 then
		strLink=strLink & "<table width='100%' cellSpacing='5'><tr align='center' >"
	end if
	
	sqlLink="select top " & SiteNum & " * from FriendLinks where IsOK=True and LinkType=" & LinkType & " order by IsGood,id desc"
	set rsLink=server.createobject("adodb.recordset")
	rsLink.open sqlLink,conn,1,1
	if rsLink.bof and rsLink.eof then
		if ShowType=1 or ShowType=2 then
	  		for i=1 to SiteNum
				strLink=strLink & "<td>"			
				strLink=strLink & "</td>"
				if i mod Cols=0 and i<SiteNum then
					strLink=strLink & "</tr><tr align='center' >"
				end if
			next
		end if
	else
		SiteCount=rsLink.recordcount
		for i=1 to SiteCount
			if ShowType=1 or ShowType=2 then
			  if LinkType=1 then
				strLink=strLink & "<td width='120'><a href='" & rsLink("SiteUrl") & "' target='_blank' title='网站名称:" & rsLink("SiteName") & vbcrlf & "网站地址:" & rsLink("SiteUrl") & vbcrlf & "网站简介:" & rsLink("SiteIntro") & "'>"
				if rsLink("LogoUrl")="" or rsLink("LogoUrl")="http://" then
					strLink=strLink & "<img src='images/nologo.gif' width='88' height='31' border='0'>"
				else
					strLink=strLink & "<img src='" & replace(rsLink("LogoUrl"),"../","") & "' width='88' height='31' border='0'>"
				end if
				strLink=strLink & "</a></td>"
			  else
				strLink=strLink & "<td width='88'><a href='" & rsLink("SiteUrl") & "' target='_blank' title='网站名称:" & rsLink("SiteName") & vbcrlf & "网站地址:" & rsLink("SiteUrl") & vbcrlf & "网站简介:" & rsLink("SiteIntro") & "'>" & left(rsLink("SiteName"),8) & "</a></td>"
			  end if
			  if i mod Cols=0 and i<SiteNum then
				strLink=strLink & "</tr><tr align='center' >"
			  end if
			else
				strLink=strLink & "<option value='" & rsLink("SiteUrl") & "'>" & rsLink("SiteName") & "</option>"
			end if
			rsLink.moveNext
		next
		if SiteCount<SiteNum and (ShowType=1 or ShowType=2) then
			for i=SiteCount+1 to SiteNum
				if LinkType=1 then
					strLink=strLink & "<td width='88'></td>"
				else
					strLink=strLink & "<td width='88'></td>"
				end if
				if i mod Cols=0 and i<SiteNum then
					strLink=strLink & "</tr><tr align='center'>"
				end if
			next
		end if
	end if
	if ShowType=1 or ShowType=2 then
		strLink=strLink & "</tr></table>"
	end if
	if ShowType=1 then
        strLink=strLink & "</div><div id=rolllink2></div></div>"   '新增代码
	elseif ShowType=3 then
		strLink=strLink & "</select>"
	end if
	response.write strLink
	if ShowType=1 then call RollFriendLinks()    '新增代码
	rsLink.close
	set rsLink=nothing
end sub

'==================================================
'过程名:RollFriendLinks
'作  用:滚动显示友情链接站点
'参  数:无
'==================================================
sub RollFriendLinks()
%>
<script>
   var rollspeed=30
   rolllink2.innerHTML=rolllink1.innerHTML //克隆rolllink1为rolllink2
   function Marquee(){
   if(rolllink2.offsetTop-rolllink.scrollTop<=0) //当滚动至rolllink1与rolllink2交界时
   rolllink.scrollTop-=rolllink1.offsetHeight  //rolllink跳到最顶端
   else{
   rolllink.scrollTop++
   }
   }
   var MyMar=setInterval(Marquee,rollspeed) //设置定时器
   rolllink.onmouseover=function() {clearInterval(MyMar)}//鼠标移上时清除定时器达到滚动停止的目的
   rolllink.onmouseout=function() {MyMar=setInterval(Marquee,rollspeed)}//鼠标移开时重设定时器
</script>

<%
end sub
'==================================================
'过程名:AD()
'作  用:广告调用
'参  数:无
'==================================================
sub AD(fl,n,w,h)
set rsad=server.createobject("adodb.recordset")
sql="select top "&n&" * from pic where fl="&fl&" order by id desc"
rsad.open sql,conn,1,1
if not rsad.EOF then
while not rsad.EOF
a=rsad("pic1")

adhtm=adhtm&"<table border=""0"" width=""100%"" cellpadding=""0""  cellspacing=""0"" >"
adhtm=adhtm&"<tr>"
    adhtm=adhtm&"<td valign=bottom>"
    adhtm=adhtm&"<p align=center>"
    if right(a,3)<>"swf" then
    adhtm=adhtm&"<a target=_blank title="&rsad("title")&" href="&rsad("link")&"><img border=0 src="&replace(rsad("pic1"),"../","")&" width="&w&" height="&h&" alt="&rsad("title")&"></a>"
    else
    adhtm=adhtm&"<embed src="&rsad("pic1")&" type=""application/x-shockwave-flash"" width="&w&" height="&h&" align=""center"">"
    end if
    adhtm=adhtm&"</td>"
  adhtm=adhtm&"</tr>"
adhtm=adhtm&"</table>"
rsad.MoveNext
wend
end if
response.write adhtm
rsad.close
set rsad=nothing
end sub
%>