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

📄 read.asp

📁 网上有名留言板20120版,非常不错~
💻 ASP
字号:
<!--#include file="mycheck.asp"-->
<!--#include file="ubbhtml.asp"-->
<!--#include file="write_msg.asp"-->
<p><!--#include file="qq_online.asp"-->
<%
sub read()

first="<table width=100% height=151 border=1 cellspacing=0 cellpadding=3 bordercolorlight=#333333 bordercolordark=#FFFFFF>        <tr>           <td width='100%' height='6' class=link >                 <li>Hello, 欢迎光临"&homename&"留言板!现在本留言板开通免费申请服务,赶快申请吧!<br>   &nbsp;&nbsp;&nbsp;[<a href='?action=registration&user="&admin&"'>免费申请</a>]...</li><p><li>如果您想现在直接留言给"&yourname&",请[<a href='?user="&admin&"&action=write'>签写留言</a>]。"
first=first&"</li><p><li>您再在也可访问[<a href="&homeurl&" target=_blank>"&yourname&"</a>]的主页,也可[<a href=mailto:"&adminmail&">发信给我</a>],Many thanks.</font></td></tr></table>"

sql_user="select userid,counter from user where user='"&request("user")&"'"
set rs_user=server.createobject("adodb.recordset")
rs_user.open sql_user,conn,3,2
if not rs_user.bof and not rs_user.eof then
userid=rs_user("userid")
if session("counter")="" then
rs_user("counter")=rs_user("counter")+1
rs_user.update
session("counter")=1
end if
else
if request("user")<>admin then
table(first)
end if
end if
if request("user")=admin then
userid=0
   if session("counter")="" then
       conn.execute("update admin set counter=counter+1 where adminid=1")
       session("counter")=1
   end if
end if
if userid>0 or (userid=0 and request("user")=admin) then
sql_msg="select * from message where userid="&userid&""
if keyword<>"" then
sql_msg=sql_msg&" and (name like '%"&keyword&"%' or qq like '%"&keyword&"%'  or email like '%"&keyword&"%'  or homepage like '%"&keyword&"%'  or message like '%"&keyword&"%'  or from_address like '%"&keyword&"%'  or writetime like '%"&keyword&"%')"
end if
sql_msg=sql_msg&" order by id desc"
set rs_msg=server.createobject("adodb.recordset")
rs_msg.open sql_msg,conn,3,2
if not rs_msg.bof and not rs_msg.eof then
rs_msg.pagesize=pagesize
if   isInteger(request("page"))=False then
pageno=1
else
if request("page")=""  or request("page")<=1 then
pageno=1
else
pageno=int(request("page"))
if pageno>rs_msg.pagecount then
pageno=rs_msg.pagecount
end if
end if
end if
if not rs_msg.BOF then
Rs_msg.Move Rs_msg.PageSize*(pageno-1)
end if
%>

<%
sql_notice="select id,userid,title,message,writetime from notice where userid="&userid&" order by id desc"
set rs_notice=server.createobject("adodb.recordset")
rs_notice.open sql_notice,conn,3,2
%>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td class=link width="80"><span title="留言板上共有 <%=rs_notice.recordcount%> 条公告"><img src="image/announce.gif" width="18" height="18" align="absmiddle"><b>公告:</b> 
      </span></td>
    <td class=link width="437"><marquee scrollamount=3> 
      <%
if rs_notice.eof and rs_notice.bof then
response.write "<b>当前没有公告.</b>["&now()&"]"
if session("user")<>"" then
response.write "[<a href=?action=write_notice&user="&user&">发表公告</a>]"
end if
else
response.write "<a href=?action=read_notice&user="&user&"><b>"&rs_notice("title")&"</b>["&rs_notice("writetime")&"]</a>"
if session("user")<>"" then
response.write "[<a href=?action=read_notice&user="&user&">公告管理</a>]"
end if
end if

rs_notice.close
%>
      </marquee> </td>
    <td class=link width="233">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="1">
  <tr> 
   <td height="1" width="22%" bgcolor="<%=InBorderColor%>" align="center"><img height=1 src="css/<%=css_name%>/<%=LBorderGraphic%>" 
            width="120" border=0></td>
     <td height="1" width="1" bgcolor="<%=InBorderColor%>" align="center"></td>
      <td width="410" height="1" bgcolor="<%=InBorderColor%>"></td>
  </tr>
</table>

  <%
i=1
while not rs_msg.eof and i<=rs_msg.pagesize
%>
  <%tablefirst()%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="136" align="center">
  <tr> 
    <td bgcolor=<%=LTablebgColor%> align="center"> 
      <table width="120" border="0" cellspacing="0" cellpadding="2" height="136">
        <tr> 
          <td height="40" colspan="2" #d3e5fa> 
            <div align="center"><img src="image/<%=rs_msg("pic")%>.gif" width="40" height="40"></div>
          </td>
        </tr>
        <tr> 
          <td height="8" colspan="2" class=link > 
            <div align="center"> <br>
              <%
name_html=HTMLEnCode(rs_msg("name"))
response.write hightlight(name_html)
%>
            </div>
          </td>
        </tr>
        <tr> 
          <td width="6%"> 
            <div align="center"><img src="image/homepage.gif" width="16" height="16"></div>
          </td>
          <td width="14%" class=link ><a href="<%=rs_msg("homepage")%>" target="_blank" title="访问<%=rs_msg("name")%>的主页">我的主页</a></td>
        </tr>
        <tr> 
          <td width="6%"> 
            <div align="center"><img src="image/email.gif" width="16" height="16"></div>
          </td>
          <td width="14%" class=link ><a href="mailto:<%=rs_msg("email")%>" title="给<%=rs_msg("name")%>发信">写信给我</a></td>
        </tr>
        <tr> 
          <td width="6%" valign="top"> 
            <div align="center">
<%qq_online(rs_msg("qq"))%>
</div>
          </td>
          <td width="14%" class=link  valign="bottom"> 
            <%if rs_msg("qq")<>""then
hightlight(rs_msg("qq"))
else
response.write("不告诉你")
end if
%>
          </td>
        </tr>
      </table>
      <br>
    </td>
    <TD vAlign=top bgColor=<%=InBorderColor%> rowspan="2" width=1><IMG 
            src="image/spacer.gif" 
            width=1> </TD>
    <td width="410"> 
      <table cellspacing=0 cellpadding=1 width="400%" align=center border=0>
        <tbody> 
        <tr> 
          <td> 
            <table bordercolor=#111111 
                  cellspacing=0 cellpadding=0
                  border=0 class=link width="423" style="TABLE-LAYOUT: fixed">
              <tr> 
                <td valign=center height="20" style="LEFT: 0px; WIDTH: 76%; WORD-WRAP: break-word">&nbsp; 
                  <%
name_html=HTMLEnCode(rs_msg("name"))
response.write hightlight(name_html)
%>
                  发表于:&nbsp;<%=hightlight(rs_msg("writetime"))%></td>
                <td align="right" height="20" style="LEFT: 0px; WIDTH: 24%; WORD-WRAP: break-word"> 
                  <font color="<%=InBorderColor%>">|</font> 第 <%=rs_msg.recordcount-rs_msg.pagesize*(pageno-1)-i+1%> 
                  条留言</td>
              
              <tr valign="top"> 
                <td colspan="2" height="10"><img height=1 
                        src="css/<%=css_name%>/<%=MainBorderGraphic%>" width="100%"></td>
            </table>
            <table width="423" border="0" cellspacing="0" cellpadding="3" bordercolorlight="#333333" bordercolordark="#FFFFFF" style="TABLE-LAYOUT: fixed" class=link height="100">
              <tr> 
                <td colspan="2" class=link style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word"> 
                  <%
      memo = htmlEncode(rs_msg("message"))
if ubb=1 then
memo=ubbcode(memo)
end if
memo = Replace(memo, "&lt;br&gt;", "<br>")
memo = Replace(memo, chr(10), "<br>")
memo = Replace(memo, vbCrLf, "<br>")
Response.Write hightlight(memo)
response.write Request.servervariables("document_name")
%>
                </td>
              </tr>
            </table>
            <table style="BORDER-COLLAPSE: collapse;TABLE-LAYOUT: fixed" bordercolor=#111111 
                  cellspacing=0 cellpadding=0 width="423" 
                  border=0 class=link>
              <tr> 
                <td valign=bottom height="10"><img height=1 
                        src="css/<%=css_name%>/<%=MainBorderGraphic%>" 
                        width="100%"></td>
              <tr> 
                <td valign=bottom height="20" style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word">&nbsp;<img src="image/ip.gif" width="16" height="15" align="absmiddle" border="0" class=link>来自:<%=hightlight(rs_msg("from_address"))%>&nbsp;<img src="image/post.gif" width="16" height="16" border="0" align="absmiddle"><a href="?action=write&user=<%=user%>">签写留言</a> 
                  <img src="image/replynow.gif" width="16" height="16" align="absmiddle" border="0"><a href="?action=reply&user=<%=user%>&messageid=<%=rs_msg("id")%>">回复留言</a> 
                  <%if session("user")<>"" then%>
                  <a href="?action=write&user=<%=user%>"></a> <img src="image/edit.gif" width="16" height="15" align="absmiddle" border="0"><a href="?action=edit&user=<%=user%>&messageid=<%=rs_msg("id")%>&page=<%=pageno%>">编辑</a> 
                  <a href="?action=write&user=<%=user%>"></a> <img src="image/del.gif" width="15" height="15" align="absmiddle" border="0"><a href="?action=delete&user=<%=user%>&messageid=<%=rs_msg("id")%>&page=<%=pageno%>">删除</a> 
                  <%end if%>
                </td>
              
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td height="1" width="22%" bgcolor="<%=InBorderColor%>" align="center"><img height=1 src="css/<%=css_name%>/<%=LBorderGraphic%>" 
            width="120" border=0></td>
    <td width="410" height="1" bgcolor="<%=InBorderColor%>"></td>
  </tr>
</table>
<%tablelast()%>
<%
i=i+1
 rs_msg.MoveNext                                              
 wend 
%>

<%
if rs_msg.recordcount<>0 then
if pageno-1 mod 10=0 then
		p=(pageno-1) \ 10
	else
		p=(pageno-1) \ 10
	end if

	response.write "<div class=link align=center>页次:<strong>"& pageno &"</strong>/<strong>"& rs_msg.pagecount &"</strong>页"&_
					" 分页:[ "

	if p*10>0 then response.write "<a href='?user="&user&"&keyword="&keyword&"&page="&p*10&"'>←</a>   "
    uming_i=1
	for ii=p*10+1 to P*10+10
		   if ii=pageno then
	          response.write "<font color=gray>"+Cstr(ii)+"</font> "
		   else
		      response.write "<a href='?user="&user&"&keyword="&keyword&"&page="&ii&"'>"+Cstr(ii)+"</a>   "
		   end if
		if ii=rs_msg.pagecount then exit for
		 uming_i=uming_i+1
	next
	if ii<=rs_msg.pagecount and uming_i=11 then response.write "<a href='?user="&user&"&keyword="&keyword&"&page="&ii&"'>→</a>   "
response.write(" ]")
end if
%>
<table align="center">
  <tr>
    <form method="POST" action="index.asp?action=search&user=<%=user%>">
      <td width="100%" height="6" class=link > 
        <p align="center" class=link ><img src="image/find.gif" width="16" height="16" align="absmiddle" border="0">关键字: 
          <input name="keyword" size="20" class=link>
          &nbsp;&nbsp;&nbsp; 
          <input name="B1" type="submit" value="搜索" class=link>
        </p>
      </td>
    </form>
  </tr>
</table>
<% 
else
if (rs_msg.bof or rs_msg.eof) and request("action")="" then
%>
<%
write_msg()
end if
if request("action")="search" then
nosearch_html="<table width=100% height=151 border=1 cellspacing=0 cellpadding=3 bordercolorlight=#333333 bordercolordark=#FFFFFF>        <tr>           <td width='100%' height='6' class=link ><div align=center>对不起,没有找到符合查找条件的内容!<p align=center>[<a href=javascript:history.go(-1);>这里返回</a>]</p></div></td></tr></table>"
table(nosearch_html)   
%>
<table align="center">
  <tr>
    <form method="POST" action="index.asp?action=search&user=<%=user%>">
      <td width="100%" height="6" class=link > 
        <p align="center" class=link ><img src="image/find.gif" width="16" height="16" border="0" align="absmiddle">关键字: 
          <input name="keyword" size="20" class=link>
          &nbsp;&nbsp;&nbsp; 
          <input name="B1" type="submit" value="搜索" class=link>
        </p>
      </td>
    </form>
  </tr>
</table>
  
<%
end if
end if 
%>
<%
        
end if
%>
<%end sub%>

⌨️ 快捷键说明

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