网站左侧列表新闻数量太长,怎么缩短为十个
上帝的苹果 2013-07-25 03:56:54 <%sub dhl()%>
<h2>产品系列</h2>
<%
Set rs1=server.CreateObject("adodb.recordset")
sql1="Select * From 0791idc_ProductClass where Classid<>3 and ParentPath='0' order by ClassID"
rs1.open sql1,conn,1,1
j=1
do while not rs1.eof
%>
<div class="jjT"><h3><a href="Product.html"><%=rs1("ClassName") %></a></h3></div>
<div class="jjT1">
<%
Dim rs2,sql2,g,count
Set rs2=server.CreateObject("adodb.recordset")
sql2="select * from 0791idc_Product where ClassID="&rs1("ClassID")
rs2.open sql2,conn,1,1
if rs2.recordcount=0 then
response.write (" 暂无分类!")
end if
g=1
count=1
do while not rs2.eof%>
<div class="jj"><a href="ProductShow-<%= rs2("ID") %>.html"><%
response.Write rs2("Title")
%> </a></div>
<% rs2.movenext
count=count+1
g=g+1
loop
rs2.close
set rs2=nothing %>
</div>
<% rs1.movenext
j=j+1
loop
rs1.close
set rs1=nothing
%>
<%
Set rs1=server.CreateObject("adodb.recordset")
sql1="Select * From 0791idc_ProductClass where Classid=3 and ParentPath='0'"
rs1.open sql1,conn,1,1
j=1
do while not rs1.eof
%>
<div class="jjT"><h2><%=rs1("ClassName") %></h2></div>
<div class="jjT1">
<%
Set rs2=server.CreateObject("adodb.recordset")
sql2="select * from 0791idc_Product where ClassID="&rs1("ClassID")
rs2.open sql2,conn,1,1
if rs2.recordcount=0 then
response.write (" 暂无分类!")
end if
g=1
count=1
do while not rs2.eof%>
<div class="jjj"><a href="ProductShow-<%= rs2("ID") %>.html"><%
response.Write rs2("Title")
%> </a></div>
<% rs2.movenext
count=count+1
g=g+1
loop
rs2.close
set rs2=nothing %>
</div>
<% rs1.movenext
j=j+1
loop
rs1.close
set rs1=nothing
%>
<%end sub%>
<%sub jianjie(id)%>
<%sql="select * from 0791idc_Aboutus where id="&id
set rs=conn.execute(sql)
if not rs.eof then
%>
<a href="Aboutus-1.html"><%=left(rs("content"),300)%></a>
<%else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%sub dhll()%>
<h2>产品系列</h2>
<%
Set rs1=server.CreateObject("adodb.recordset")
sql1="Select * From 0791idc_ProductClass where ClassID<>3 and ParentPath='0' order by ClassID"
rs1.open sql1,conn,1,1
j=1
do while not rs1.eof
%>
<div class="jjT"><h3><a href="Product.html"><%=rs1("ClassName") %></a></h3></div>
<div class="jjT1">
<%
Dim rs2,sql2,g,count
Set rs2=server.CreateObject("adodb.recordset")
sql2="select * from 0791idc_Product where ClassID="&rs1("ClassID")
rs2.open sql2,conn,1,1
if rs2.recordcount=0 then
response.write (" 暂无分类!")
end if
g=1
count=1
do while not rs2.eof%>
<div class="jj"><a href="ProductShow-<%= rs2("ID") %>.html"><%
response.Write rs2("Title")
%> </a></div>
<% rs2.movenext
count=count+1
g=g+1
loop
rs2.close
set rs2=nothing
%>
</div>
<% rs1.movenext
j=j+1
loop
rs1.close
set rs1=nothing
%>
<%
Set rs1=server.CreateObject("adodb.recordset")
sql1="Select * From 0791idc_ProductClass where Classid=3 and ParentPath='0'"
rs1.open sql1,conn,1,1
j=1
do while not rs1.eof
%>
<div class="jjT"><h2><%=rs1("ClassName") %></h2></div>
<div class="jjT1">
<%
Set rs2=server.CreateObject("adodb.recordset")
sql2="select * from 0791idc_Product where ClassID="&rs1("ClassID")
rs2.open sql2,conn,1,1
if rs2.recordcount=0 then
response.write (" 暂无分类!")
end if
g=1
count=1
do while not rs2.eof%>
<div class="jjj"><a href="ProductShow-<%= rs2("ID") %>.html"><%
response.Write rs2("Title")
%> </a></div>
<% rs2.movenext
count=count+1
g=g+1
loop
rs2.close
set rs2=nothing %>
</div>
<% rs1.movenext
j=j+1
loop
rs1.close
set rs1=nothing
%>
<h2>最新文章</h2>
<%
BigClass="行业知识"
Set rss=Server.CreateObject("ADODB.RecordSet")
sql="select * from 0791idc_news where BigClassName='"&BigClass&"' order by AddDate desc"
rss.Open sql,conn,1,1
if not rss.eof then
do while not rss.eof
%>
<div class="lis">·<% If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rss("ID")&"."&HTMLName&""
Else
AutoLink = "shownews.asp?ID="&rss("ID")&""
End If
Response.Write "<a href="""&AutoLink&""">"&rss("TITLE")&"</a>"&VbCrLf
%></div>
<%
rss.movenext
loop
end if
rss.close
set rss=nothing
%>
<%end sub%>
<%sub jianjie(id)%>
<%sql="select * from 0791idc_Aboutus where id="&id
set rs=conn.execute(sql)
if not rs.eof then
%>
<a href="Aboutus-1.html"><%=left(rs("content"),300)%></a>
<%else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%sub rongy(BigClassName,num)%>
<%
sql="select top "&num&" * from 0791idc_news where BigClassName='"&BigClassName&"'order by addDate desc"
set rs=conn.execute(sql)
if not rs.eof then
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "shownews.asp?ID="&rs("ID")&""
End If
do while not rs.eof
%>
<div class="ryt">
<h3><a href="<%=AutoLink%>"><img src="<%=rs("FirstImageName")%>" border="0" width="124px" height="89px" alt="<%=rs("Title")%>" title="<%=rs("Title")%>" /></a></h3><p><a href="<%=AutoLink%>"><%=rs("Title")%></a></p>
</div>
<%
rs.movenext
loop
else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%sub gongyi(BigClassName,num)%>
<%
sql="select top "&num&" * from 0791idc_news where BigClassName='"&BigClassName&"'order by addDate desc"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
title=len(rs("Title"))
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "shownews.asp?ID="&rs("ID")&""
End If
if Title>16 then
%>
<li>·<a href="<%=AutoLink%>"><%=left(rs("Title"),16)%>...</a></li>
<%else%>
<li>·<a href="<%=AutoLink%>"><%=rs("Title")%></a></li>
<%end if%>
<%
rs.movenext
loop
else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%sub product(num)%>
<%
sql="select top "&num&" * from 0791idc_Product where FirstPage=true order by UpdateTime asc"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
%>
<div class="tt"><h3><a href="ProductShow-<%= rs("ID") %>.html"><img src="<%=rs("DefaultPicUrl")%>" width="165px" alt="<%=rs("title")%>" height="160px" border="0"title="<%=rs("title")%>" /></a></h3><p align="center" style=" height:20px"><a href="ProductShow-<%= rs("ID") %>.html"><%=rs("title")%></a></p></div>
<%
rs.movenext
loop
else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%sub hangye(BigClassName,num)%>
<%
sql="select top "&num&" * from 0791idc_news where BigClassName='"&BigClassName&"'order by addDate desc"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
title=len(rs("Title"))
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "shownews.asp?ID="&rs("ID")&""
End If
if Title>16 then
%>
<div class="list"><span><%=year(rs("AddDate"))%>-<%=month(rs("AddDate"))%>-<%=day(rs("AddDate"))%></span>·<a href="<%=AutoLink%>"><%=left(rs("Title"),16)%>...</a></div>
<%else%>
<div class="list"><span><%=year(rs("AddDate"))%>-<%=month(rs("AddDate"))%>-<%=day(rs("AddDate"))%></span>·<a href="<%=AutoLink%>"><%=rs("Title")%></a></div>
<%end if%>
<%
rs.movenext
loop
else
response.Write"暂时没有"
end if
rs.close
set rs=nothing
%>
<%end sub%>
<%function fll()%>
<div id="idPicShow" class="container">
<ul id="idNum">
</ul>
</div>
<div id="idPicText"></div>
<div id="idPicList"></div>
<script>
var rvt = new RevealTrans("idPicShow");
//添加变换对象
<%
set rs1=conn.execute("select top 5 * from 0791idc_news where BigClassName='发货现场' order by addDate desc")
if not rs1.eof or not rs1.Bof then
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs1("ID")&"."&HTMLName&""
Else
AutoLink = "shownews.asp?ID="&rs1("ID")&""
End If
%>
<%
do while not rs1.eof
%>
rvt.Add('<%=rs1("FirstImageName")%>', '', '<%=AutoLink%>');
<%
rs1.movenext
loop
else
%>
rvt.Add('images/logo.gif', '', '');
<%
end if
rs1.close
set rs1=nothing
%>
var oList = $("idPicList"), oText = $("idPicText"), arrImg = [];
var oNum = $("idNum"), arrNum = [];
//设置图片列表
Each(rvt.List, function(list, i){
//图片式
var img = document.createElement("img");
img.src = list["img"]; img.alt = list["text"];
arrImg[i] = img;
oList.appendChild(img);
//按钮式
var li = document.createElement("li");
li.innerHTML = i + 1;
arrNum[i] = li;
oNum.appendChild(li);
//事件设置
img.onmouseover = li.onmouseover = function(){ rvt.Auto = false; rvt.Index = i; rvt.Start(); };
img.onmouseout = li.onmouseout = function(){ rvt.Auto = true; rvt.Start(); };
});
//设置图片列表样式 文本显示区域
rvt.onShow = function(){
var i = this.Index, list = this.List[i];
//图片式
Each(arrImg, function(o){ o.className = ""; }); arrImg[i].className = "on";
//按钮式
Each(arrNum, function(o){ o.className = ""; }); arrNum[i].className = "on";
//文本区域
oText.innerHTML = !!list.url ? "<a href='" + list.url + "' target='_blank'>" + list.text + "</a>" : list.text;
}
//文本显示区域
oText.onmouseover = function(){ rvt.Auto = false; rvt.Stop(); };
oText.onmouseout = function(){ rvt.Auto = true; rvt.Start(); };
rvt.Start();
</script>
<%end function%>