2个回答
展开全部
rs.open "Select User_Id,Sort_Id,Title,Content,Date,Author,Hits,RemarkSum from txnb_blog "&sql&" order by isTop desc,Date desc",conn,1,1
rs.pagesize=6
Set rs2=Server.CreateObject("ADODB.RecordSet")
if not (rs.eof and rs.bof) then
if page="" then
page=1
else
if Clng(page)>rs.pagecount then
page=rs.pagecount
else
page=Clng(page)
end if
end if
if request("allpage")="" then
allpage=rs.pagecount
end if
rs.absolutepage=page
for i=1 to rs.pagesize
%>
<div class="art"><img src="images/dot.gif" width="14" height="16" align="middle" /> <span style="font-weight:bold;"><%=rs(2)%></span> <span style="color:#aaa;font-size:12px;">(<%=rs(4)%>)</span><hr /><a href="detail.asp?id=<%=rs(0)%>"><%=cnMid(rs(3),60,"...")%></a><hr /><div class="artinfo">发布:<%=rs(5)%> | 分类:<%
rs2.open "Select Sort_Name from txnb_sort where Sort_Id="&Clng(rs(1)),conn,1,1
if not rs2.eof then
response.Write(rs2(0))
end if
rs2.close%> | 评论:(<%=rs(7)%>)| 阅读:(<%=rs(6)%>) </div></div>
<%
rs.movenext
if rs.eof then
exit for
end if
next%>
<div id="pagecent">分页:(第<%=page%>/<%=allpage%>页 <%
if page<6 then
page1=1
else
page1=page-5
end if
if page+5>allpage then
page2=allpage
else
page2=page+5
end if
if page>6 then response.Write("<a href=?classid="&classid&"&page=1&allpage="&allpage&"&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">1</a>...")
for j=page1 to page2
response.Write("<a href=?classid="&classid&"&page="&j&"&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">")
if j=page then
response.Write("<font color=red>")
end if
response.Write(j)
if j=page then
response.Write("</font>")
end if
response.Write("</a> ")
next
if allpage-5>page then response.Write("...<a href=?name=$pagename&page=$allpage&keysort=$keysort&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">"&allpage&"</a>")
%>)</div>
自己改下SQL以及HTML代码即可了
rs.pagesize=6
Set rs2=Server.CreateObject("ADODB.RecordSet")
if not (rs.eof and rs.bof) then
if page="" then
page=1
else
if Clng(page)>rs.pagecount then
page=rs.pagecount
else
page=Clng(page)
end if
end if
if request("allpage")="" then
allpage=rs.pagecount
end if
rs.absolutepage=page
for i=1 to rs.pagesize
%>
<div class="art"><img src="images/dot.gif" width="14" height="16" align="middle" /> <span style="font-weight:bold;"><%=rs(2)%></span> <span style="color:#aaa;font-size:12px;">(<%=rs(4)%>)</span><hr /><a href="detail.asp?id=<%=rs(0)%>"><%=cnMid(rs(3),60,"...")%></a><hr /><div class="artinfo">发布:<%=rs(5)%> | 分类:<%
rs2.open "Select Sort_Name from txnb_sort where Sort_Id="&Clng(rs(1)),conn,1,1
if not rs2.eof then
response.Write(rs2(0))
end if
rs2.close%> | 评论:(<%=rs(7)%>)| 阅读:(<%=rs(6)%>) </div></div>
<%
rs.movenext
if rs.eof then
exit for
end if
next%>
<div id="pagecent">分页:(第<%=page%>/<%=allpage%>页 <%
if page<6 then
page1=1
else
page1=page-5
end if
if page+5>allpage then
page2=allpage
else
page2=page+5
end if
if page>6 then response.Write("<a href=?classid="&classid&"&page=1&allpage="&allpage&"&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">1</a>...")
for j=page1 to page2
response.Write("<a href=?classid="&classid&"&page="&j&"&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">")
if j=page then
response.Write("<font color=red>")
end if
response.Write(j)
if j=page then
response.Write("</font>")
end if
response.Write("</a> ")
next
if allpage-5>page then response.Write("...<a href=?name=$pagename&page=$allpage&keysort=$keysort&keyword="&server.urlencode(keyword)&" style=""font-size:15px"">"&allpage&"</a>")
%>)</div>
自己改下SQL以及HTML代码即可了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询