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

📄 gbook_self.asp

📁 基于ASP开发的聊天室源码
💻 ASP
字号:
<%
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
nowpage=Request("page")
if nowpage="" then nowpage=1
nowpage=int(nowpage)
if nowpage<1 then nowpage=1
If not IsArray(Session("info")) Then Response.Redirect "err.asp?kind=122"
info = Session("info")
Function bird(v)
v = Replace(v,chr(13),"<br>")
Response.Write v
End Function
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Application("zzbird_conn")
Set Rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from gbook where who='" & info(0) & "' or towho='" & info(0) & "' order by time desc"
Rs.open sql,Conn,3,3
rs.pagesize=10          '每页显示数
howpage=rs.pagecount    '共几页
if nowpage>howpage then nowpage=howpage
if rs.recordcount<>0 then rs.absolutepage=nowpage     '当前页
Dim tid
Dim ttitle
Dim tgtext
Dim tip
Dim twho
Dim ttowho
Dim tico
Dim tmi
Dim toicq
Dim thomepage
Dim temail
Dim ttime
Set tid = Rs("id")
Set ttitle = Rs("title")
Set tgtext = Rs("gtext")
Set tip = Rs("ip")
Set twho = Rs("who")
Set ttowho = Rs("towho")
Set tico = Rs("ico")
Set tmi = Rs("mi")
Set toicq = Rs("oicq")
Set thomepage = Rs("homepage")
Set temail = Rs("email")
Set ttime = Rs("time")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本</title>
<style>
<!--
body         { font-size: 10pt }
table        { font-size: 10pt }
a:active     { color: #000000; font-size: 10pt ;text-decoration: none}
a:link       { color: #000000; font-size: 10pt ;text-decoration: none}
a:visited    { color: #000000; font-size: 10pt ;text-decoration: none}
a            { color: #000000; font-size: 10pt ;text-decoration: none}
a:hover      { color: #000000; font-size: 10pt ;text-decoration: none}
-->
</style>
<Script Language="JavaScript">
function w(v)
{
window.open("gbook_write.asp?name=" + v,"gbookwrite","height=450,width=650,left=80,top=30,toolbar=no,scrollbars=yes,resizable=yes");
}
function d(v)
{
if(confirm("确定删除?只有帖子的作者或者管理员才能够删除帖子。"))
 {location.href="gbook_del.asp?id=" + v}
}
</Script>
</head>
<body topmargin="0" leftmargin="0" background="images/8y.gif" bgproperties="fixed">

<table border="0" cellpadding="2" width="100%" id="AutoNumber1" height="268">
  <tr>
    <td width="100%" align="center" height="7" valign="top">
    <table border="1" width="100%" cellpadding="2" id="AutoNumber2" bgcolor="#94B2DC" style="border-collapse: collapse" bordercolor="#111111">
      <tr>
        <td width="100%">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber7">
          <tr>
            <td width="10%" align="center">
                 [<a href="javascript:w('')">签写留言</a>]
            </td>
            <td width="10%" align="center">
                 [<a href="javascript:this.location.reload();">刷新本页</a>]
            </td>
            <td width="11%" align="center" bgcolor="#006699" style="color:#FFFFFF">
                 [私人留言]
            </td>
            <td width="11%" align="center">
                 [<a href="gbook.asp">所有留言</a>]
            </td>
            <td width="11%" align="center">
                 [<a href="javascript:window.close();">关闭窗口</a>]
            </td>
            <td width="47%" align="right">共<font color="#A20000"><%=Rs.RecordCount%></font>条,分<font color="#A20000"><%=howpage%></font>页,当前<select size="1" name="nowpage" style="font-size: 8pt; color:#A20000" onchange="window.open(this.options[this.selectedIndex].value,'_self')">
      <%For i=1 To howpage%>
      <option value="gbook_self.asp?page=<%=i%>" <%If nowpage=i Then Response.Write "selected"%>><%=i%></option>
      <%Next%>
      </select>页
      <%if nowpage=1 or rs.recordcount=0 then%><font color="#808080">首页 上页</font> <%else%><a href="gbook_self.asp?page=1">首页</a> <a href="gbook_self.asp?page=<%=nowpage-1%>">上页</a><%end if
      if nowpage=howpage then%>
      <font color="#808080">下页 末页</font><%else%>
      <a href="gbook_self.asp?page=<%=nowpage+1%>">下页</a> <a href="gbook_self.asp?page=<%=howpage%>">末页</a><%end if%>
           </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width="100%" align="center" height="46" valign="bottom">
    </td>
  </tr>
  <tr>
    <td width="100%" height="168">
    <div align="center">
      <center>

<%
If Rs.EOF and Rs.BOF Then
Response.Write "目前还没有任何可以显示的留言"
Else
Do While NOT Rs.EOF
%>      <table border="1" width="92%" id="AutoNumber3" bordercolor="#000000" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
        <tr>
          <td width="100%">
          <table border="0" cellpadding="0" width="100%" id="AutoNumber4" style="border-collapse: collapse" bordercolor="#111111" cellspacing="0">
            <tr>
              <td width="25%" bgcolor="#BAD3F5" style="border-right: 1px solid #FFFFFF; " align="center" valign="top">
              <br>
              写给:<%=ttowho%><br>
              <img border="0" src="images/<%=tico%>.gif" width="82" height="90"></td>
              <td width="77%" bgcolor="#CEE3FF">
              <div align="center">
                <center>
              <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber5" height="42">
                <tr>
                  <td width="100%" height="10"><b>标题:<%=ttitle%><font color="#006699"> (来自:<%=twho%>)<%If tmi = True Then Response.Write "(悄悄话)"%></font></b></td>
                </tr>
                <tr>
                  <td width="100%" height="1" bgcolor="#000000"></td>
                </tr>
                <tr>
                  <td width="100%" height="79" valign="top"><%bird(tgtext)%></td>
                </tr>
                <tr>
                  <td width="100%" height="1" bgcolor="#000000"></td>
                </tr>
                <tr>
                  <td width="100%" height="1">
                  <a href="javascript:w('<%=twho%>');">
                  <img border="0" src="images/sysgrade.gif" width="16" height="16">回复</a>&nbsp;<a href="javascript:d('<%=tid%>')"><img alt="删除留言" src="images/del.gif" border="0">删除</a>&nbsp;<img border="0" src="images/save.gif"><%=ttime%>
                  <img alt="来自哪里" src="images/ip.gif"><%=tip%>
<%If toicq=0 Then%>
                  <img alt="QQ号码" src="images/oicq.gif" border="0">
<%Else%>
                  <a target="_blank" href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=toicq%>">
                  <img alt="QQ号码" src="images/oicq.gif" border="0"><%=toicq%></a>
<%End If
If thomepage="" or thomepage="http://" Then%>
                  <img src="images/room.gif" border="0">
<%Else%>
                  <a target="_blank" href="<%=thomepage%>"><img src="images/room.gif" border="0"></a>
<%End If
If temail="" Then%>
                  <img src="images/grade.gif" border="0">
<%Else%>
                  <a href="mailto:<%=temail%>"><img src="images/grade.gif" border="0"></a>
<%End If%></td>
                </tr>
              </table>
                </center>
              </div>
              </td>
            </tr>
          </table>
          </td>
        </tr>
      </table>
<%
Rs.MoveNext
Loop
End If
%>
      </center>
    </div>
    </td>
  </tr>
  <tr>
   <td width="100%" height="14" align="center">只保留最近15天的留言</td>
    
  <tr>
    <td width="100%" align="center" height="39">
    <table border="1" width="100%" cellpadding="2" id="AutoNumber6" bgcolor="#94B2DC" style="border-collapse: collapse" bordercolor="#111111">
      <tr>
        <td width="100%">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber8">
          <tr>
            <td width="10%" align="center">
                 [<a href="javascript:w('')">签写留言</a>]
            </td>
            <td width="10%" align="center">
                 [<a href="javascript:this.location.reload();">刷新本页</a>]
            </td>
            <td width="11%" align="center" bgcolor="#006699" style="color:#FFFFFF">
                 [私人留言]
            </td>
            <td width="11%" align="center">
                 [<a href="gbook.asp">所有留言</a>]
            </td>
            <td width="11%" align="center">
                 [<a href="javascript:window.close();">关闭窗口</a>]
            </td>
            <td width="47%" align="right">共<font color="#A20000"><%=Rs.RecordCount%></font>条,分<font color="#A20000"><%=howpage%></font>页,当前<select size="1" name="nowpage" style="font-size: 8pt; color:#A20000" onchange="window.open(this.options[this.selectedIndex].value,'_self')">
      <%For i=1 To howpage%>
      <option value="gbook_self.asp?page=<%=i%>" <%If nowpage=i Then Response.Write "selected"%>><%=i%></option>
      <%Next%>
      </select>页
      <%if nowpage=1 or rs.recordcount=0 then%><font color="#808080">首页 上页</font> <%else%><a href="gbook_self.asp?page=1">首页</a> <a href="gbook_self.asp?page=<%=nowpage-1%>">上页</a><%end if
      if nowpage=howpage then%>
      <font color="#808080">下页 末页</font><%else%>
      <a href="gbook_self.asp?page=<%=nowpage+1%>">下页</a> <a href="gbook_self.asp?page=<%=howpage%>">末页</a><%end if%>
           </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
%>

⌨️ 快捷键说明

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