</head> <% const MaxPerPage=10 typename="messages" if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if %> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <center> <TABLE cellPadding=0 cellSpacing=0 width=760> <TBODY> <TR> <td valign=top> <div align=center><font color=#ff6633><IFRAME src="../banner.htm" NORESIZE scrolling="NO" hspace="0" vspace="0" frameborder="0" marginheight="0" width=760 height="88"></iframe> </font></div> </td> </TR> <TR> <td colspan=2 height=5> <tr bgcolor=#333333> <td height=1></td> </tr> <tr bgcolor="#ff9900"> <td height=16 valign=bottom width="72%"> <font color=#ffffff><strong>您的位置 > <a href=../index.htm><font color=#ffffff>情趣内衣</font></a> > <b>给我留言 </font></b></td> </tr> <tr bgcolor=#333333> <td height=1></td> </tbody> </table> <table border="0" width="92%" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="100%"> <br> <% if Request.QueryString("searchname")<>null or Request.QueryString("searchname")<>"" then searchname=Request.QueryString("searchname") end if 'response.write searchname sql="SELECT * FROM gbook_tbl " if searchname<>"" then if searchname<>"reset" then sql=sql & " where mess_title LIKE " sql=sql & "'%" sql=sql & searchname sql=sql & "%'" sql=sql & " or "
sql=sql & " mess_auther LIKE " sql=sql & "'%" sql=sql & searchname sql=sql & "%'" sql=sql & " or " sql=sql & " mess_comment LIKE " sql=sql & "'%" sql=sql & searchname sql=sql & "%'" else searchname=null end if sql = sql & " order by id_no DESC" else sql = sql & " where mess_reno=0 order by id_no DESC" end if 'Response.Write sql %> <% dim sql dim rs Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<p align='center'> 还 没 有 任 何 相 关 留 言</p>" else totalPut=rs.recordcount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showpage totalput,MaxPerPage,"default.asp" showContent showpage totalput,MaxPerPage,"default.asp" else if (currentPage-1)*MaxPerPage<totalPut then rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showpage totalput,MaxPerPage,"default.asp" showContent showpage totalput,MaxPerPage,"default.asp" else currentPage=1 showpage totalput,MaxPerPage,"default.asp" showContent showpage totalput,MaxPerPage,"default.asp" end if end if rs.close end if set rs=nothing conn.close set conn=nothing sub showContent dim i i=0 %> <% if searchname<>null or searchname<>"" then Response.write("搜索关键字<font color=red>" & searchname & "</font>的结果如下:") end if %> <div align="center"> <table border="1" cellspacing="0" width="760" bordercolordark="#FFFFFF" cellpadding="0" bordercolorlight="#000000"> <tr> <td width="54" align="center" height="20" bgcolor="#ff9900">编号</td> <td width="299" align="center" bgcolor="#ff9900">主题</td> <td width="71" align="center" bgcolor="#ff9900">回应</td> <td width="65" align="center" bgcolor="#ff9900">点击</td> <td width="82" align="center" bgcolor="#ff9900">作者</td> <td width="135" align="center" bgcolor="#ff9900">日期</td> </tr> <% do while not rs.eof %> <tr> <td height="23" width="54" bgcolor="ffffec"> <p align="center"><%=rs("id_no")%> </td> <td width="299" bgcolor="ffffec"> <p align="left"> <a href="read.asp?recno=<%=rs("id_no")%>"><%=rs("mess_title")%></a> </td> <td width="71" align=center bgcolor="ffffec"><font color=ff0000 size=3><b> <%=rs("mess_re")%></b></font> </td> <td width="65" align=center bgcolor="ffffec"> <%=rs("mess_read")%> </td> <td width="82" bgcolor="ffffec"> <p align="center"><%=rs("mess_auther")%> </td> <td width="135" bgcolor="ffffec"> <p align="center"><%=rs("mess_date")%>  <%=rs("mess_time")%> </td> </tr> <tr> <td width="54"> </td> <td colspan=5><% =rs("mess_comment") %> <table align=right cellpadding="0" cellspacing="0" width="120"> <tr><td><img src=images/reply.gif><a href="write.asp?re=<%=rs("id_no")%>">回 复</a></td></tr></table> </td> </tr> <% i=i+1 if i>=MaxPerPage then exit do rs.movenext loop %> </table> </div> <% end sub
function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "<form method=Get action="&filename&"> response.write "<tr><td width=70 align=center><input type=""button"" value=""写留言"" style=""background-color: rgb(255,255,255);border:1px double rgb(88,88,88);font:12px"" onClick=""javascript:window.document.location.href='write.asp'""></td><td><p align=center><font color='#000080'></font> " if CurrentPage<2 then response.write "<font color='#000080'>首页 上一页</font> " else response.write "<a href="&filename&"?page=1&>首页</a> " response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> " end if if n-currentpage<1 then response.write "<font color='#000080'>下一页 尾页</font>" else response.write "<a href="&filename&"?page="&(CurrentPage+1) response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>" end if response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> " response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>篇留言 <b>"&maxperpage&"</b>篇/页</font></span><td> " response.write "<td><font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 style=""background-color: rgb(255,255,255);border:1px double rgb(88,88,88);"" value="¤tpage&">" response.write "<font color='#000080'>搜索:</font><input type='text' name='searchname' size=8 maxlength=20 style=""background-color: rgb(255,255,255);border:1px double rgb(88,88,88);""><input type=""submit"" value=""提交/返回"" style=""background-color: rgb(255,255,220);font:12px"">" response.write "</td></tr></table></form>" end function %>
[此贴子已经被作者于2005-7-12 23:22:14编辑过]