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

📄 index2.asp

📁 是一个完整的留言板源代码
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="ubb.asp"-->
<!--#include file="pub.asp"-->
<!--#include file="header.asp"-->
<%
snr=Request("snr")  
stype=Request("stype")  
IF Request("del")<>"" and Session("PRO"&LogPWD&"ADMIN")=True Then
Sql = "Delete From gb Where id="&Request("del")
Conn.Execute(Sql)
End IF
%>
<%
GetCookie
if notice<>"" then BzNotice
SqlType
IF Not Rs.Eof Then
IF Request("s")="" Then
ShowNum=Showlynum
Else
ShowNum=Request("s")
End IF
rs.pagesize=Showlynum
maxpage=rs.pagecount
totally=rs.recordcount
requestpage=clng(request("p"))
if requestpage="" or requestpage<1 then
   requestpage=1
end if
if requestpage>maxpage then
    requestpage=maxpage
end if
if not requestpage=1 then
rs.move (requestpage-1)*rs.pagesize
end if
for i=1 to rs.pagesize and not rs.bof
if ubbcode="1" then
cont=ubb(rs("content"))
else
cont=rs("content")
end if
LyType=Rs("type")
LyType1=left(LyType,2)
LyType2=Right(LyType,2)
LyTitle="&nbsp;"&Rs("title")
if Session("PRO"&LogPWD&"ADMIN")<>True then
 if LyType2="se" then
  if UserName<>rs("name") or UserPwd<>rs("psw") then
  LyTitle=" [ 对外保密 ]"
  else
  LyTitle=" "&Rs("title")
  end if
 end if
 if LyType1="wa" then
 LyTitle=" ◇◇◇◇"
 end if
end if

dim j
if requestpage=1 then
j=i
else 
j=((requestpage-1)*Showlynum+i)
end if 

IF Session("PRO"&LogPWD&"ADMIN")<>True Then
 if LyType2="se" and (UserName<>rs("name") or UserPwd<>rs("psw")) then
 cont1="&lt;&nbsp;此留言是给站长看的悄悄话&nbsp;&gt;"
 elseif LyType1="wa" then
 cont1="&lt;&nbsp;站长一定认真阅读您的留言&nbsp;&gt;"
 elseif LyType="no" then
 cont1="&lt;&nbsp;此留言-站长不能认可&nbsp;&gt;"
 else
 cont1=cont
 end if
ELSE
 if LyType2="se" then
 cont1="<font color=#ff6666>[ 悄悄话 ]</font><BR>"&cont
 elseif LyType1="wa" then
 cont1="<font color=#ff6666>[ 等待审核的留言 ]</font><BR>"&cont
 elseif LyType="no" then
 cont1="<font color=#ff6666>[ 留言被禁止显示 ]</font><BR>"&cont
 else
 cont1=cont
 end if
end if%>
<%
Response.Cookies("ppp")("ccc")=""%>

<div align="center">
<table class="table0" cellSpacing="1" cellPadding="0" width="600" border="0">
<tr>

<%if request.cookies("UserInfo2tp88")("sjm88")="" then%>
<td width="600" colspan="2" class="font" height="18">&nbsp;<%=j%>.&nbsp;&nbsp;<%=rs("date")%>&nbsp;&nbsp;[&nbsp;<%=rs("ip")%>&nbsp;]</td>
</tr>
<%end if%>

<td width="90" rowspan="3" align="center" onmouseover="javascript:this.bgColor='#e8ffff'" onmouseout="javascript:this.bgColor='#f8ffff'" bgColor=#f8ffff>
<P align=center>

<font style="FONT-SIZE: 9pt; FILTER: shadow(color=#cccccc); COLOR: #ff0088; HEIGHT: 1px"><%=Rs("name")%></font><br><br>
<font style="FONT-SIZE: 9pt; FILTER: shadow(color=#cccccc); COLOR: #0060f0; HEIGHT: 1px">来自<%=rs("from")%></font>
</P></td>

<td width="510" onmouseover="javascript:this.bgColor='#ffe0ff'" onmouseout="javascript:this.bgColor='#fff8ff'" bgColor=#fff8ff>
<table border="0" cellpadding="0" width="100%">
<tr>
<td>
<font color=#009900>话题:</font><%=LyTitle%>&nbsp;&nbsp;
<%if LyType1="wa" Then%>
<%if LyType2="se" then%>
<font color=#ff0088>|</font>&nbsp;<font color=#009900>不公开的留言</font>&nbsp;<font color=#ff0088>|</font>
<% else %>
<font color=#ff0088>|</font>&nbsp;<font color=#009900>留言等待处理</font>&nbsp;<font color=#ff0088>|</font>
<%end if%>
<% else %>
<%end if%>
<%if rs("top")="9" then%><font color=#ee0088>※</font><%end if%>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="510" onmouseover="javascript:this.bgColor='#e8ffff'" onmouseout="javascript:this.bgColor='#f8ffff'" bgColor=#f8ffff>
<table border="0" cellpadding="0" width="100%" style="table-layout:fixed;word-break:break-all">
<tr>
<td width="100%">
<%=cont1%>
</td></tr>
</table>
<% if rs("reply")<>"" then  %>   
<%   
if Session("PRO"&LogPWD&"ADMIN")<>True and LyType2="se" then   
if UserName<>rs("name") or UserPwd<>rs("psw") then   
%>
<table border="0" cellpadding="0" width="100%" style="table-layout:fixed;word-break:break-all">
<tr>
<td width="33"><font color=#009900>回复:</font></td>
<td>
<font color=#ff0088>→</font>&nbsp;<a href="user_login.asp?url=index.asp?p=<%=requestpage%>">登陆查看</a>
</td>
</tr>
</table>

<%else%>
<table border="0" cellpadding="0" width="100%" style="table-layout:fixed;word-break:break-all">
<tr>
<td width="33"><font color=#009900>回复:</font></td>
<td>
<font color=#000000><%=ubb(Rs("reply"))%></font>&nbsp;&nbsp;[&nbsp;<a href="user_logout.asp" target="_top">知道了,我要退出</a>&nbsp;]
</td>
</tr>
</table>
<%   
end if   
else%>

<table border="0" cellpadding="0" width="100%" style="table-layout:fixed;word-break:break-all">
<tr>
<td width="33"><font color=#009900>回复:</font></td>
<td>
<font color=#000000><%=ubb(Rs("reply"))%></font>
</td>
</tr>
</table>
<%
end if   
end if%>
</td>
</tr>
<tr>
<td width="510" height="19" align="right" onmouseover="javascript:this.bgColor='#ffe0ff'" onmouseout="javascript:this.bgColor='#fff8ff'" bgColor=#fff8ff>
<%if request.cookies("UserInfo2tp88")("sjm88")="" then%>

<%if rs("oicq")<>"" then%>
<img border=0 src="images/qq.gif">
OICQ:<%=rs("oicq")%>&nbsp
<%else%>
<%end if%>
<%if rs("site")<>"" then%>
<img border=0 src="images/index.gif">
<a href='<%=rs("site")%>' target="_blank" title="<%=rs("site")%>">主页</a>&nbsp;
<%else%>
<%end if%>
<img border=0 src="images/post.gif">   
<%if rs("mail")="test@system.net" then%>
<a title="没有信箱">信箱</a>&nbsp;
<%else%>
<a href='mailto:<%=rs("mail")%>' title="<%=rs("mail")%>">信箱</a>&nbsp;
<%end if%>

<%else%>

<%if rs("oicq")<>"" then%>
OICQ:<%=rs("oicq")%>&nbsp
<%else%>
<%end if%>
<%if rs("site")<>"" then%>
<a href='<%=rs("site")%>' target="_blank" title="<%=rs("site")%>">主页</a>&nbsp;
<%else%>
<%end if%>
<%if rs("mail")="test@system.net" then%>
<%else%>
<a href='mailto:<%=rs("mail")%>' title="<%=rs("mail")%>">信箱</a>&nbsp;
<%end if%>
<a style="color: #ff0088" title="<%=rs("date")%>  [&nbsp;<%=rs("ip")%>&nbsp;]">&gt;&gt;&gt;</a>&nbsp;

<%end if%>
  
<%IF Session("PRO"&LogPWD&"ADMIN")=True Then%>   
→&nbsp;<A href='edit.asp?edit=ture&id=<%=rs("id")%>'><font color=#c00088>管理</font></A>&nbsp;<A href='index.asp?del=<%=Rs("id")%>'><font color=#c00088>删除</font></A>&nbsp;
<%End IF%>

</td>
</tr>
</table>
</center>
</div>

<div align="center">
<table cellPadding="0" width="580" border="0">
<tr>
<td width="580" height="16">
</td>
</tr>
</table>
</div>

<%   
Rs.MoveNext   
if rs.eof then exit for   
next   
else   
response.write "<center><font color=#FF0088>没有找到任何记录</font><br><br>"   
End IF   
Rs.Close   
Set Rs=Nothing   
%>
<div align="center"> 
<center>  
<TR width="600">  
<TD >  
<P align=center >共有留言<font color=#ff0088> <%=totally%> </font>条,共<font color=#ff0088> <%=maxpage%> </font>页 [    
<%   
PageJ   
%>   
]</TD></TR> 
     
<%   
bottom   
Function BzNotice   
%>      
<TR>   
<TD>   
<p align="center">
<table  cellSpacing="1" cellPadding="0" width="600" border="0" align="center">
<tr>
<td width="600"><marquee onMouseOut=start(); onMouseOver=stop(); scrollamount=2><%=ubb(notice)%></marquee></td>
</tr>
</table>
<BR>  

<%END Function  
Function PageJ  
ii=requestpage-4  
iii=requestpage+4  
if ii < 1 then  
ii=1  
end if  
if iii > maxpage then  
iii=maxpage  
end if   
if requestpage > 5 then  
if Request("search")="" then  
Response.Write "<a href=index.asp?p=1>1</a> ... "  
else  
Response.Write "<a href=index.asp?p=1&snr="&snr&"&stype="&stype&"&search=ture>1</a> ... "  
end if  
end if  
for ai=ii to iii  
if ai<>requestpage then  
if Request("search")="" then  
Response.Write "<a href=index.asp?p="&ai&">"&ai&"</a> "  
else  
Response.Write "<a href=index.asp?p="&ai&"&snr="&snr&"&stype="&stype&"&search=ture>"&ai&"</a> "  
end if  
else  
Response.Write "<font color=#FF6633>"&ai&"</font> "  
end if  
Next  
if maxpage > requestpage+4 then  
if Request("search")="" then  
Response.Write "...<a href=index.asp?p="&maxpage&">"&maxpage&"</a> "  
else  
Response.Write "...<a href=index.asp?p="&maxpage&"&snr="&snr&"&stype="&stype&"&search=ture>"&maxpage&"</a> "  
end if  
end if  
END Function 
Function SqlType  
if Request("search")="" then  
Set Rs = Server.CreateObject("ADODB.Recordset")  
Sql = "Select * From gb Order BY top desc, id DESC "  
Rs.Open Sql,conn,1,1  
else  
snr=Request("snr")  
stype=Request("stype")  
   if snr="" then  
     if Request("search")="myliuyan" then  
	 response.write "<script language='javascript'>"  
     response.write "alert('对不起,你没有留言或者Cookies过期');"  
     response.write "history.go(-1);"  
     response.write "</script>"  
     response.end  
	 else  
     response.write "<script language='javascript'>"  
     response.write "alert('你没有输入任何搜索内容');"  
     response.write "history.go(-1);"  
     response.write "</script>"  
     response.end  
	 end if  
   end if  
  if stype<>"" then  
  Set Rs = Server.CreateObject("ADODB.Recordset")  
  Sql = "Select * From gb where "&stype&" like '%" &snr& "%' Order BY top desc, id DESC "  
  Rs.Open Sql,conn,1,1  
  else  
  Set Rs = Server.CreateObject("ADODB.Recordset")  
  Sql = "Select * From gb where name like '%" &snr& "%' or content like '%" &snr& "%' or title like '%" &snr& "%' Order BY top desc, id DESC "  
  Rs.Open Sql,conn,1,1  
  end if  
end if  
End Function  
%>  
</table></center>
</div>


⌨️ 快捷键说明

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