关于燕衔泥新闻程序的问题。请高手帮忙!
ywrc 2002-02-28 07:50:06 下面的代码是来自燕衔泥的新闻程序,我想请问如何设置每页的新闻的输出数,我找了半天也没有找到如何设置。我用他改了一个图片系统,但每页他默认显示10张图片,我想只显示2张或是其他的数目,请问如何设置。
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data/bjxx.mdb")
Set rs9 = Server.CreateObject("ADODB.Recordset")
sql9 ="SELECT * From system Order By id DESC"
RS9.open sql9,Conn,3,3
on error resume next
dim rs, sql
set rs = server.createobject("adodb.recordset")
dim curpage, curtopic, strtopic
if request("dtitle") = "" then
curtopic="-1"
else
curtopic = request("dtitle")
'显示专题信息
sql = "SELECT dtitle FROM dtitle WHERE id=" + cstr(curtopic)
set rs=conn.execute(sql)
strtopic=rs("dtitle")
rs.close
%>
<html>
<head>
<title><%= strtopic %></title>
<meta HTTP-EQUIV="Content-topic" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body { font-size: 9pt}
table { font-size: 9pt}
-->
</style>
<script
language="javascript">
<!--
function winopen(url)
{
window.open(url,"search","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=550,height=450,top=0,left=0");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" >
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#666666">
<td>
<div align="center"><img src="<%=rs9("banner")%>" width="468" height="60"></div>
</td>
</tr>
</table>
<table width="500" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#003366">
<td><font color="#FFFFFF">新闻中心</font></td>
</tr>
<tr>
<td> <%
response.write "<table width=500 align=center><tr><td><h3 align=left>" + strtopic + "</h3></table>"
sql = "SELECT * FROM kh where dtitleid=" + cstr(curtopic) + " ORDER BY shijian DESC"
rs.open sql,conn,1,1
if err.number <> 0 then
response.write "数据库出错"
else
if rs.bof and rs.eof then
rs.close
response.write "<center>没有新闻"
else
dim i
rs.pagesize = PERPAGE
rs.absolutepage = curpage
for i = 1 to rs.pagesize
%>
<img src="images/move.gif" width="16" height="16"><a href=javascript:winopen('yanxianni.asp?id=<%=rs("id")%>')><%=rs("biaoti")%></a><font size=1 color=888888>[<%=rs("SHIJIAN")%>]阅<%=rs("counter")%>次</FONT><br>
<%
rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next%>
<p align=center>
<%
response.write "第" + cstr(curpage) + "页/总" + cstr(rs.pagecount) + "页 "
response.write "本页" + cstr(i-1) + "条/总" + cstr(rs.recordcount) + "条 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='dtitle.asp?page=1&dtitle=" + cstr(curtopic) + "'>首页</a> <a href='dtitle.asp?page=" + cstr(curpage-1) + "&dtitle=" + cstr(curtopic) + "'>前页</a> "
end if
if curpage = rs.pagecount then
response.write "后页 末页"
else
response.write "<a href='dtitle.asp?page=" + cstr(curpage+1) + "&dtitle=" + cstr(curtopic) + "'>后页</a> <a href='dtitle.asp?page=" + cstr(rs.pagecount) + "&dtitle=" + cstr(curtopic) + "'>末页</a>"
end if
rs.close
end if 'if rs.bof and rs.eof then
end if 'if err.number <> 0 then
end if 'if request("dtitle") = "" then
set rs = nothing
call endconnection()
%>
</td>
</tr>
<tr>
<td>
<tr>
<td height="17">
<table width="498" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<p align="right"><a href="javascript:window.close()">关闭本窗口 </a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p align=center> <%=rs9("banquan")%> <br>
程序制作:燕衔泥 OICQ:2510199
</body>
</html>
<%rs9.close%>