給萬博系統的新聞系統增加分頁功能,無需修改數據庫,只需改變一個文件,就可以了.
如果將後台的Webediter增加一個插入分頁符,那就更完美了.我還沒加這個.
本例是在後台錄入新聞時,在需要分頁的位置插入分頁符:{$html_page$}就可以了.
代碼如下,有詳細說明
newsshow.asp
<!--#includefile="siteinfo.asp"-->
<HTML>
<HEAD>
<TITLE><%=sitename%></TITLE>
<METAHTTP-EQUIV="Content-Type"C>
<linkhref="images/CSS.css"type=text/cssrel=stylesheet>
</HEAD>
<bodytopmargin="0">
<tablewidth="780"border="0"cellspacing="0"cellpadding="0">
<tr>
<tdcolspan="3"><!--#includefile="top.asp"--></td>
</tr>
<tr>
<tdwidth="145"align="left"valign="top"><!--#includefile="left.asp"--></td>
<tdalign="left"valign="top"><tablewidth="625"border="0"cellspacing="0"cellpadding="0">
<tr>
<tdwidth="17"height="20"></td>
<tdwidth="598"></td>
<tdwidth="10"></td>
</tr>
<tr>
<tdwidth="17"><%idd=trim(request.querystring("id"))
setrsr=server.createobject("adodb.recordset")
sql="select*fromNewswherePutout=trueandid="&idd
rsr.opensql,conn,1,3
ifnotrsr.eofthen
Newcontent=rsr("Newcontent")
Newtitle=rsr("Newtitle")
Putman=rsr("Putman")
kig=rsr("kig")
kig=kig+1
addtime=rsr("addtime")
rsr("kig")=kig
rsr.update
else
response.Write"找不到記錄,發生導常錯誤,請聯繫管理員!"