給萬博系統的新聞系統增加分頁功能[配有詳細說明]
2024-05-04 11:01:51
供稿:網友
給萬博系統的新聞系統增加分頁功能,無需修改數據庫,只需改變一個文件,就可以了.
如果將后臺的Webediter增加一個插入分頁符,那就更完美了.我還沒加這個.
本例是在后臺錄入新聞時,在需要分頁的位置插入分頁符: {$html_page$} 就可以了.
代碼如下,有詳細說明
newsshow.asp
<!--#include file="siteinfo.asp"-->
<HTML>
<HEAD>
<TITLE><%=sitename%></TITLE>
<META HTTP-EQUIV="Content-Type" C>
<link href="images/CSS.css" type=text/css rel=stylesheet>
</HEAD>
<body topmargin="0">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><!--#include file="top.asp"--></td>
</tr>
<tr>
<td width="145" align="left" valign="top"><!--#include file="left.asp" --></td>
<td align="left" valign="top" ><table width="625" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="17" height="20"> </td>
<td width="598"> </td>
<td width="10"> </td>
</tr>
<tr >
<td width="17"><% idd=trim(request.querystring("id"))
set rsr=server.createobject("adodb.recordset")
sql="select * from News where Putout=true and id="&idd
rsr.open sql,conn,1,3
if not rsr.eof then
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"找不到記錄,發生導常錯誤,請聯系管理員!"