|
这是我的代码,我现在想把这段代码改成对内容的分页,请大家帮帮小弟,谢谢
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" link="#000000" vlink="#000000" alink="#FF0000" background="images/bg.jpg" text="#000000">
<!--#include file="top.asp"-->
<table width="945" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center">
<tr>
<td width="186" height="439" valign="top" background="images/lbg.jpg">
<table width="100" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="94">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="<%=aa%>" width="228" height="75"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="23" width="202">
<tr><%
set rs3=server.CreateObject("ADODB.RecordSet") '创建记录集对象
sql3="select * from smallclass where bigclassname='"&bigg&"'order by smallclassid asc"
'response.write sql3
rs3.Open sql3,conn,1,1
do while not rs3.eof
dim aa
aa=rs3("smallClassname")
'response.write aa
%>
<td height="32"> <b></b>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="9">
<table width=228 border=0 cellpadding=0 cellspacing=0>
<tr>
<td> <img src="images/me_1.jpg" width=44 height=36 alt=""></td>
<td background="images/me_2.jpg" width="156" height="36">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="19%" height="23" align="center"><img src="images/zy.gif" width="13" height="13"></td>
<td colspan="2" height="23"><%if rs3("smallclassname")="影视图片" then%><a href="pic.asp?bigclassname=<%=rs3("bigclassname")%>&smallclassname=<%=rs3("smallclassname")%>"><b><%=aa%></b></a><%else%><a href="readxx.asp?bigclassname=<%=rs3("bigclassname")%>&smallclassname=<%=rs3("smallclassname")%>"><b><%=aa%></b></a><%end if%><b>
</b></td>
</tr>
</table>
</td>
<td> <img src="images/me_3.jpg" width=28 height=36 alt=""></td>
</tr>
</table>
</td>
</tr>
<tr >
<td height="3"></td>
</tr>
</table>
</td>
<%
response.write "</td></tr>"
rs3.movenext
loop
rs3.close
set rs3=nothing
%> </tr>
</table>
</td>
</tr>
<tr>
<td> <img src="images/zd_1.jpg" width=228 height=26 alt="">
<table width="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/sr_1.jpg" width=228 height=39 alt=""></td>
</tr>
<tr >
<td background="images/sr_3.jpg" height="66">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<form method="post" action="search.asp"> <tr>
<td width="38%" height="22">
<div align="right">关键字:</div>
</td>
<td width="62%" height="22">
<input type="text" name="key" size="12">
</td>
</tr>
<tr>
<td width="38%" height="22">
<div align="right">搜索类型:</div>
</td>
<td width="62%" height="22">
<select name="ty">
<option value="1" selected>= 按标题 =</option>
<option value="2">= 按内容 =</option>
</select>
</td>
</tr>
<tr>
<td width="38%"> </td>
<td width="62%">
<input type="image" border="0" name="imageField" src="images/search.gif" width="62" height="22">
</td>
</tr> </form>
</table>
</td>
</tr>
<tr>
<td><img src="images/sr_4.jpg" width=228 height=11 alt=""></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width=228 border=0 cellpadding=0 cellspacing=0>
<tr>
<td> <img src="images/zd_1.jpg" width=228 height=26 alt=""></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="751" height="439" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width=702 border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=3> <img src="images/n2_1.jpg" width=702 height=9 alt=""></td>
</tr>
<tr>
<td rowspan=2> <img src="images/n2_2.jpg" width=38 height=73 alt=""></td>
<td width="236" height="42"><b><font color="#CC3300">当前位置:首页-<%=bigg%><%if smaa<>bigg then%>
- <%=smaa%> <%end if%></font></b></td>
<td rowspan=2> <img src="images/n2_4.jpg" width=428 height=73 alt=""></td>
</tr>
<tr>
<td> <img src="images/n2_5.jpg" width=236 height=31 alt=""></td>
</tr>
</table>
<table width="702" border="0" cellspacing="0" cellpadding="0" background="images/ny_14.jpg">
<%if smaa="影视名家" then
sql="select * from news where bigclassname='"&bigg&"'and smallclassname='"&smaa&"' order by id asc"
else
sql="select * from news where bigclassname='"&bigg&"'and smallclassname='"&smaa&"' order by id desc"
end if
'response.write sql
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
totle=rs.recordcount
if totle>1 then
if rs.eof and rs.bof then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" height="31">
<div align="center"> <img src="images/no.jpg" width="350" height="301"></div>
</td>
</tr>
</table>
<%else
'分页的实现
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum%> <%i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%> <%do while not rs.eof and i<listnum
n=n+1%>
<tr align=center >
<td height=22 width="88" >
<div align="right"><img src="images/d2.gif" width="12" height="9">
</div>
</td>
<td height="22" width="468">
<div align="left"><% if rs("flag")=3 or rs("flag")=0 then%>
<a href="readnews.asp?newsid=<%= RS("id") %>&bigclassname=<%=rs("bigclassname")%>&smallclassname=<%= RS("smallclassname") %>" ><%= RS("TITLE") %></a>
<%else%> <a href="<%=rs("images")%>" target="_parent"><%=rs("title")%></a>
<%end if%> </div>
</td>
<td width="146" height="22">
<div align="left"><font color="#666666"><%=rs("infotime")%></font></div>
</td>
</tr>
<tr align=center >
<td height=5 colspan="3" >
<table width="85%" border="0" cellspacing="0" cellpadding="0" background="images/line.gif" height="5">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<%rs.movenext
i=i+1
j=j-1
loop%>
<tr>
<td colspan=3 > </td>
</tr>
<tr align="center" > <%filename="readxx.asp"%>
<td colspan=3 height=31><b>共 <%=Rs.pagecount%> 页 <% if page=1 then %>
<%else%> <a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>>|<<</a>
<a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>&page=<%=page-1%>><<</a>
<a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>&page=<%=page-1%>>[<%=page-1%>]</a>
<%end if%> <% if Rs.pagecount=1 then %> <%else%> [<%=page%>]
<%end if%> <% if Rs.pagecount-page <> 0 then %> <a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>&page=<%=page+1%>>[<%=page+1%>]</a>
<a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>&page=<%=page+1%>>>></a>
<a href=<%=filename%>?bigclassname=<%=bigg%>&smallclassname=<%=smaa%>&page=<%=Rs.pagecount%>>>>|</a>
<%end if%> </b></td>
<%end if%> </tr>
<tr>
<td colspan=3 ><img src="images/ny_16.jpg" width=702 height=48 alt=""></td>
</tr>
<%elseif totle=1 then%>
<tr valign="top" >
<td background="images/ny_14.jpg" colspan="3" height="332" bgcolor="#FFFFFF">
<table width="702" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6%" height="332"> </td>
<td width="87%" height="332" valign="top"><%=rs("content")%><%if rs("flag")=0 and rs("images")<>"" then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<hr NOSHADE size="1">
<b>相关附件:</b><a href="<%=rs("images")%>" target="_blank"><font color="#FF0000">点击查看</font></a>
<br>
</td>
</tr>
</table>
<%end if%></td>
<td width="7%" height="332"> </td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td colspan="3" height="16" bgcolor="#FFFFFF"><img src="images/ny_16.jpg" width=702 height=48 alt=""></td>
</tr>
<%else%>
<tr >
<td background="images/ny_14.jpg" colspan="3" height="50" bgcolor="#FFFFFF">
<div align="center"><img src="pic/no.jpg" width="343" height="310"></div>
</td>
</tr> <tr>
<td colspan="3" height="50" bgcolor="#FFFFFF">
<div align="center"><img src="images/ny_16.jpg" width=702 height=48 alt=""></div>
</td>
</tr>
<%end if%>
</table>
</td>
</tr>
</table>
</td>
</tr> |
|