📄 index.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="ubbcode.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from guestbook order by id desc"
rs.open sql,dbconn,3,2
dim pagenum
dim e_page
e_page=3 '每页显示留言数
rs.pagesize=e_page
if request.querystring("pagenum")="" or request.querystring("pagenum")=0 then
pagenum=1
else
pagenum=request.querystring("pagenum")
rs.absolutepage=trim(request.querystring("pagenum"))
end if
%>
<link href="style.css" rel="stylesheet" type="text/css">
<title>在线留言</title><body>
<table width="530" border="0" align="center" cellpadding="0" cellspacing="0" class="atable1">
<tr>
<td width="530" valign="top"> <table width="80%" border="0">
<tr>
<td height="3"></td>
</tr>
</table><TABLE
width="94%" border=0 align="center" cellPadding=0 cellSpacing=0>
<TR>
<TD width="549" align="center"><%
if rs.eof and rs.bof then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17%" valign="bottom"><div align="center"><strong><font color="#333333">留言公告:</font></strong> </div></td>
<td valign="bottom"><%
set rsn=server.createobject("adodb.recordset")
sql="select * from notice"
rsn.open sql,dbconn,1,1
if rsn("notice")<>"" then
%>
<marquee border="0" align="top" scrollamount="2" scrolldelay="60" behavior="scroll" onMouseOver="this.stop()" onMouseOut="this.start()" width="100%">
<%=rsn("notice")%>
</marquee>
<%else%>
<marquee border="0" align="top" scrollamount="2" scrolldelay="60" behavior="scroll" width="100%">
还没有任何公告!
</marquee>
<%
end if
rsn.close
set rsn=nothing
%> </td>
</tr>
</table>
<table width="75%" border="0" align="center" cellpadding="6" >
<tr>
<td height="48" align="center"><p>还没有任何留言!</p></td>
</tr>
</table>
<%else%>
<div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="input">
<tr>
<td width="17%" valign="bottom" bgcolor="#F2ECFF"><div align="center"><strong><font color="#333333">留言公告:</font></strong> </div></td>
<td bgcolor="#F2ECFF"><%
set rsn=server.createobject("adodb.recordset") '声明一个记录集
sql="select * from notice"
rsn.open sql,dbconn,1,1
if rsn("notice")<>"" then
%>
<marquee border="0" align="top" scrollamount="2" scrolldelay="60" behavior="scroll" onMouseOver="this.stop()" onMouseOut="this.start()" width="100%" >
<%=rsn("notice")%>
</marquee>
<%else%>
<marquee border="0" align="top" scrollamount="2" scrolldelay="60" behavior="scroll" width="100%" direction="right">
还没有任何公告!
</marquee>
<%
end if
rsn.close
set rsn=nothing
%> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"> <table width="80%" border="0">
<tr>
<td height="1"></td>
</tr>
</table><%
do while not rs.eof and e_page>0
%>
<TABLE class=log_td_table cellSpacing=0 cellPadding=0
width="100%" border=0>
<TR> </TR>
<TR>
<TD class=log_text_box
style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all"
vAlign=top><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15" align="center" valign="bottom">第<%=rs("id")%>位 </td>
<td height="15"></td>
<td width="617" height="15" align="left" valign="middle"> <font color="#666666">TIME:<%=rs("time")%></font> <a title=<%=rs("name")%>来自<%=rs("where")%>><img src="images/friend.gif" width="15" height="15" border="0"></a> <a title=QQ:<%=rs("qq")%>><img src="images/qq.gif" width="15" height="15" border="0"></a> <a href="mailto:<%=rs("email")%>" target="_blank" title=Email:<%=rs("email")%>><img src="images/MAIL.GIF" width="15" height="15" border="0"></a> <a title=IP:<%=rs("ip")%>><img src="images/ip.gif" width="15" height="15" border="0"></a> </td>
<td width="1" align="right" valign="middle"></td>
</tr>
<tr>
<td width="93" rowspan="2" align="center" valign="top"><p><br>
<br>
<img src="<%=rs("select")%>" alt="<%=rs("name")%>"><br>
</p>
<p> <strong><b><%=rs("name")%></b></strong> <br>
<br>
<%if session("rank")>=1 then%>
[<a href="reply.asp?id=<%=rs("id")%>">回复</a>]<br>
[<a href="del.asp?id=<%=rs("id")%>" onClick="return confirm('您确定进行删除操作吗?')">删除</a>]
<%end if%>
</p></td>
<td width="1" rowspan="2" background="/img/bg_1.gif"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#F2ECFF"><table width="95%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2ECFF" style="table-layout:fixed;word-break:break-all">
<tr>
<td><img src="icons/<%=rs("face")%>.gif" width="20" height="20" alt="<%=rs("name")%>">
<%if rs("show")=1 then%>
:<%=rs("title")%><br>
<br>
<font color="#333333"> <%=ubbcode(rs("content"))%> </font>
<%else if session("admin")="smallstick" then%>
:<%=rs("title")%><br>
<br>
<font color="#333333"> 悄悄话:</font><%=ubbcode(rs("content"))%> <font color="#333333">
<%else response.write "此留言内容为悄悄话,只有管理员才可查看!"
end if%>
<%end if%>
</font></td>
</tr>
<tr>
<td><font color="#999999">--------------------------------------------------------</font></td>
</tr>
<tr>
<td><table width="100%" height="25" border="0" style="word-break:break-all">
<tr>
<td valign="top"><font color="#999999">管理员回复:<%=ubbcode(rs("reply"))%></font></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="1" background="/img/bg_1.gif"></td>
</tr>
</table></TD>
</TR>
</TABLE>
<table width="80%" border="0">
<tr>
<td height="2"></td>
</tr>
</table>
<%
e_page=e_page-1
rs.movenext
loop
%> </td>
</tr>
<tr>
<td><div align="right"><font color="#000000"> </font>第<font color=#ff0000><%=pagenum%></font>页 <font color="#000000">
<%
for p=1 to rs.pagecount
response.write ("[")
response.write "<a href=index.asp?pagenum="&p&">"&p&"</a>"
response.write ("] ")
next
%>
</font>共<%=rs.pagecount%>页</div></td>
</tr>
</table>
</div></TD>
</TR>
</TABLE>
<%
rs.close
set rs=nothing
end if
%> </td></tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -