⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.asp

📁 我见过的用ASP写的最好的留言簿程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=urlname%> - 留言版</title>
</head>
<body>
<!--#include file="top.asp"-->
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
    <td width="100%"><marquee style="word-break:break-all;FONT-SIZE: 9pt; LEFT: 2px; MARGIN-LEFT: 2px; WIDTH: 100%; TOP: 2px; HEIGHT: 20px; TEXT-ALIGN: center" onMouseOver=this.stop() onMouseOut=this.start() scrollamount=2 scrolldelay=50 direction=left behavior=loop> 
      <%=affiche%>
	  </marquee></td>
  </tr>
</table>
<%
sql="Select * from topic order by top desc,retime desc,usertime desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
noninfo="尚无留言..."
non(noninfo)
else
%>
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="4%"><img src="images/skin/t-tl.gif" width="31" height="29"></td>
    <td width="91%" background="images/skin/t-tc.gif">&nbsp;</td>
    <td width="5%"><img src="images/skin/t-tr.gif" width="35" height="29"></td>
  </tr>
  <tr>
    <td background="images/skin/t-lt.gif">&nbsp;</td>
    <td>
<%
dim currentpage,page_count
dim totalrec,endpage
if request("page")="" then
currentPage=1
else
currentPage=cint(request("page"))
end if
rs.PageSize = perpage
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
while (not rs.eof) and (not page_count = rs.PageSize)
%>
        <table width="95%" border="0" align="center" cellpadding="5" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse table-layout:fixed;word-break:break-all">
            <tr>
              <td height="25" colspan="3" bordercolor="#495474" style="border: 1px solid #495474; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" background="images/skin/t-tc.gif">
			  <img src="images/toolbar.gif" align="absmiddle">&nbsp;<font style="width :15%;filter:glow(color='#9898BA',strength='2');"><b><%= HTMLEncode(rs("username")) %></b></font></td>
            </tr>
            <tr>
              <td width="11" style="border-left: 1px solid #495474; border-right-width: 1; border-top-width: 1; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1"> </td>
              <td><%if rs("sex")="1" then%>
                <img border="0" src="images/male.gif" alt="帅哥">
                  <% Else %>
                <img border="0" src="images/female.gif" alt="美女">
                  <%end if%>&nbsp;&nbsp;<% If rs("qq")="" Then %>
                &nbsp;
                <% Else %>
                <img src="images/qq.gif" alt="<%= rs("qq") %>" align="absmiddle">
                <% End If %>
                &nbsp;
                <% If rs("mail")="" Then %>
                &nbsp;
                <% Else %>
                <img src="images/u_13.gif" alt="<%= rs("mail") %>" align="absmiddle">
                <% End If %>
                &nbsp;
                <% If rs("url")="" Then %>
                &nbsp;
                <% Else %>
                <img src="images/u_14.gif" alt="<%= rs("url") %>" align="absmiddle">
                <% End If %><hr></td>
              <td width="13" style="border-right: 1px solid #495474">&nbsp;</td>
            </tr>
            <tr>
              <td width="11" style="border-left: 1px solid #495474; border-right-width: 1; border-top-width: 1; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" rowspan="2"> </td>
              <td>              </td>
              <td width="13" style="border-right: 1px solid #495474" rowspan="2"> </td>
            </tr>
            <tr>
              <td width="620" background="images/t_dot.gif" onload="javascript:if(this.width>620)this.width=620" style="line-height: 210%"><font color="#999999" style="width:80%">留言于:<%= rs("usertime") %></font>类型:<font color="#0000FF"><%= rs("type") %></font><br><% if session(Variable&Names)=Variable then %><%=change(rs("usercontent"))%><% Elseif rs("views")="1" then %>
			 <center><b><font color=red>秘密留言,只有管理员才可见</font></b></center>
			 <% Elseif rs("views")="0" then %><%=change(rs("usercontent"))%><% End If %>
                  <%if rs("reply")="1" then%><p>
    <TABLE border="0" align="center" cellPadding="0" cellSpacing="0">
              <TR><TD width=14><IMG height=8 src=images/skin/rebg/top_l.gif width=14></TD><TD background=images/skin/rebg/top_c.gif></TD><TD width=16><IMG height=8 src=images/skin/rebg/top_r.gif width=16></TD></TR><TR><TD vAlign=top width=14 background=images/skin/rebg/center_l.gif></TD>
			  <td bgColor=#FFFFF7  width="600" onload="javascript:if(this.width>600)this.width=600" style="line-height: 210%">
			  回复于:<font color="#FF3300"><%=rs("retime")%></font><br><font color="#666666"><%=change(rs("recontent"))%></font>
<TD vAlign=top width=16 background=images/skin/rebg/center_r.gif>&nbsp;</TD>
</TR><tr><td valign=top width=14><Img height=42 src=images/skin/rebg/foot_l1.gif width=14></td><td background=images/skin/rebg/foot_c.gif><img height=42 src=images/skin/rebg/foot_l3.gif width=36></td><TD align=right width=16><IMG height=42 src=images/skin/rebg/foot_r.gif width=16></TD></TR></table>
              <b><font color="#00CCFF">管理员</font></b>
              </p><%end if%></td>
            </tr>
            <tr>
              <td background="images/bg1.gif"  colspan="3" style="border: 1px solid #495474; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">&nbsp;
                  <%if session(Variable&Names)=Variable then%>
                  <font style="width:90%"><a href="del_message.asp?id=<%=rs("id")%>">删除</a>&nbsp;&nbsp; <a href="reply.asp?id=<%=rs("id")%>">回复/编辑回复</a></font><% If rs("top") Then %><b>固顶回复</b><% End If %><%end if%></td>
            </tr>
            <tr>
              <td colspan="3"><img src="images/bian.gif" width="100%" height="14" align="top"></td>
            </tr>
    </table>
    <p>
      <%
page_count = page_count + 1
rs.movenext
wend
call pages()
rs.close
set rs=nothing

sub pages()
dim ii,p,n
if totalrec mod perpage=0 then
n= totalrec \ perpage
else
n= totalrec \ perpage+1
end if
if currentpage-1 mod 10=0 then
p=(currentpage-1) \ 10
else
p=(currentpage-1) \ 10
end if

response.write "<table border=0 cellpadding=0 cellspacing=3 width='80%' align=center ><form method=post action=index.asp>"&_
"<tr>"&_
"<td valign=middle align=center>页次:<font color='#FF3300'><b>"& currentPage &"</b>/<b>"& n &"</b></font>&nbsp;页,每页&nbsp;<font color='#FF3300'><b>"& rs.PageSize &"</b></font>&nbsp;条留言,共&nbsp;<font color='#FF3300'><b>"& totalrec &"</b></font>&nbsp;条留言<br><br>"

if currentPage=1 then
response.write "<font face=webdings>9</font>   "
else
response.write "<a href='?page=1'><font face=webdings>9</font></a>   "
end if
if p*10>0 then response.write "<a href='?page="&Cstr(p*10)&"'><font face=webdings>7</font></a>   "
response.write "<b>"
for ii=p*10+1 to P*10+10
if ii=currentPage then
response.write "<font size=4>"+Cstr(ii)+"</font> "
else
response.write "<a href='?page="&Cstr(ii)&"'>"+Cstr(ii)+"</a>   "
end if
if ii=n then exit for
'p=p+1
next
response.write "</b>"
if ii<n then response.write "<a href='?page="&Cstr(ii)&"'><font face=webdings>8</font></a>   "
if currentPage=n then
response.write "<font face=webdings>:</font>   "
else
response.write "<a href='?page="&Cstr(n)&"'><font face=webdings>:</font></a>   "
end if
response.write "</form></table>"
end sub
%></p></td>
    <td background="images/skin/t-rt.gif">&nbsp;</td>
  </tr>
  <tr>
    <td><img src="images/skin/t-bl.gif" width="31" height="32"></td>
    <td background="images/skin/t-bc.gif"></td>
    <td><img src="images/skin/t-br.gif" width="35" height="32"></td>
  </tr>
</table><% end if %>
<!--#include file="bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -