📄 default.asp
字号:
<!--#INCLUDE FILE="config.asp"-->
<%session("list")=0%>
<%
Set rs10=server.createobject("ADODB.RECORDSET")
rs10.open "Select * From option1",Conn,3,3
Set rs11=server.createobject("ADODB.RECORDSET")
rs11.open "Select * From option1" ,Conn,3,3
'on error resume next
session("useridname")=Request.cookies("ly")("useridname")
session("useridpassword")=Request.cookies("ly")("useridpassword")
session("admin")=Request.cookies("ly")("admin")
if session("showmodal")="" then
Set rs=server.createobject("ADODB.RECORDSET")
rs.open "Select modal From option1",Conn,3,3
if rs("modal")=2 then response.Redirect("default1.asp")
session("showmodal")="1"
end if
%>
<%
del=no
type1=no
del=request("del")
type1=request("type1")
if del="ok" and session("admin")=true then
Set rs=Server.CreateObject("ADODB.RecordSet")
if type1="ok" then
rs.open "Select * From reply where id1="&request("id")&"'",Conn,2,3
else
rs.open "Select * From guest where id="&request("id")&"'",Conn,2,3
end if
rs.delete
rs.update
rs.close
set rs=nothing
response.Redirect "default.asp"
end if
text=request("text")
option1=request("option")
if option1="" then option1=0
if session("admin")="" then session("admin")=false
Set rs1=server.createobject("ADODB.RECORDSET")
rs1.open "Select * From option1" ,Conn,3,3
webname=rs1("webname")
homepage=rs1("weblink")
if request("jinghua")="1" then jinghua=" and jinghua=1" else jinghua=""
if rs1("show") and ((session("admin")<>1) and (session("admin")<>2)) then
select case option1
case 1
SQL="Select * From guest where mark=1 and subject like '%"&text&"%'"&jinghua&" order by top1,lastdate desc"
case 2
SQL="Select * From guest where mark=1 and content like '%"&text&"%'"&jinghua&" order by top1,lastdate desc"
case 3
SQL="Select * From guest,reply where (mark=1) and (guest.id=reply.id) and (reply.replycontent like '%"&text&"%'"&jinghua&" order by top1,guest.lastdate desc"
case 4
SQL="Select * From guest where mark=1 and username='"&text&"'"&jinghua&" order by top1,lastdate desc"
case else
sql="SELECT * FROM guest where mark=1 "&jinghua&" order by top1,lastdate desc"
end select
else
select case option1
case 1
SQL="Select * From guest where subject like '%"&text&"%'"&jinghua&" order by top1,lastdate desc"
case 2
SQL="Select * From guest where content like '%"&text&"%'"&jinghua&" order by top1,lastdate desc"
case 3
SQL="Select * From guest,reply where (guest.id=reply.id) and (reply.replycontent like '%"&text&"%')"&jinghua&" order by top1,guest.lastdate desc"
case 4
SQL="Select * From guest where username='"&text&"'"&jinghua&" order by top1,lastdate desc"
case else
sql="SELECT * FROM guest where 1=1"&jinghua&" order by top1,lastdate desc"
end select
end if
Set rs=server.createobject("ADODB.RECORDSET")
rs.open sql,conn,3,3
if not rs.eof then
rs.pagesize=rs1("row2")
PageNo=REQUEST("PageNo")
if PageNo="" or PageNo=0 then PageNo=1
RS.AbsolutePage=PageNo
TSum=rs.pagecount
RowCount=rs.PageSize
PageNo=PageNo+1
PageNo=PageNo-1
if CINT(PageNo)>1 then
if CINT(PageNo)>CINT(TSum) then
response.Write("对不起没有您想要的页数")
Response.End
end if
end if
if PageNo<0 then
response.Write("没有这一页!")
Response.End
End if
end if
%>
<link href="1.css" rel="stylesheet" type="text/css">
<%if rs11("lytitle")="" then%><title>留言板</title><%else%><title><%=rs11("lytitle")%></title><%end if%>
<table border=0 cellspacing=0 align=center>
<tbody>
<tr>
<td align=center> <table border=0 width=100% align=center>
<tr>
<td width="100%" align=center> </tr>
<tr>
<td align=center><hr size=1 width=100% noshade color=#C0C0C0></tr>
</table></td>
</tr>
<tr>
<td height="47"> <table border=0 width=100% align=center>
<td width="220" align=lift> <font color=#000000>留言数:</font><font color=#000000><%=rs.RECORDCOUNT%></font>
总页数:<font color=#000000><%=TSum%></font> 第 <%=PageNo%> <font color=#000000>页</font> </td>
<td width="742" align=right>
<!--#INCLUDE FILE="link.asp"--> </td>
</table></tr>
<tr>
<td><HR SIZE=1 WIDTH=100% NOSHADE COLOR=#C0C0C0></td>
</tr>
<tr>
<td align=left><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="73%" height="20" valign="middle"> <a href="<%=homepage%>"><%=webname%>首页</a>
<a href="default1.asp">留言板方式查看</a></td>
<td width="27%"> <div align="right">
<%
if TSum>1 Then
If PageNo=TSum or PageNo<>1 Then
PrwePage=PageNo-1
Response.Write "<A HREF=default.asp?Pageno=1"&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">第一页</A> "
Response.Write "<A HREF=default.asp?Pageno="&PrwePage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">上一页</A> "
End If
If pageno=1 or TSum>PageNo Then
NextPage=PageNo+1
Response.Write "<A HREF=default.asp?PageNo="&NextPage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">下一页</A> "
Response.Write "<A HREF=default.asp?Pageno="&rs.PageCount&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">末一页</A> "
End If
End If
%>
</div></td>
</tr>
</table>
<td></tr>
<tr>
<%
if PageNo=1 then i=rs.RECORDCOUNT else i=rs.RECORDCOUNT-(30*(PageNo-1))
%>
<form action="progress.asp" method="post" name="form" id="form">
</table>
<div align="center">
<table width="100%" border="1" cellpadding="5" cellspacing="1" bgcolor="#E6F2FF" style="word-break:break-all; border-collapse:collapse" bordercolor="#000000">
<tr >
<td width="40" bordercolorlight="#000000" bordercolordark="#C0C0C0"> <p align="center"><strong>状态</strong>
</td>
<td width="40" bordercolorlight="#000000" bordercolordark="#C0C0C0" bgcolor="#FFFFFF"><div align="center"><strong>心情</strong></div></td>
<td bordercolorlight="#000000" bordercolordark="#C0C0C0"><div align="center"><b>发
言 主 题</b></div></td>
<td width="100" bordercolorlight="#000000" bordercolordark="#C0C0C0" bgcolor="#FFFFFF">
<p align="center"><b>作 者</b> </td>
<td width="40" align="center" bordercolorlight="#000000" bordercolordark="#C0C0C0"><b>回复</b></td>
<td width="40" align="center" bordercolorlight="#000000" bordercolordark="#C0C0C0" bgcolor="#FFFFFF">
<b>人气</b></td>
<td width="200" align=center bordercolorlight="#000000" bordercolordark="#C0C0C0">
<b>最后回复</b> </td>
<%if (session("admin")=1) or (session("admin")=2) then%>
<td width="39" align=center bordercolorlight="#000000" bordercolordark="#C0C0C0" bgcolor="#FFFFFF"><strong>操作</strong></td>
<%end if%>
</tr>
<% DO WHILE NOT rs.EOF AND RowCount>0%>
<tr >
<td width="40" align="center">
<%if rs1("show") and not rs("mark") then%>
<img src="images/folder1.gif" alt="未认证留言">
<%else if rs("top1")=1 then%>
<img src="images/top.gif" alt="固顶留言">
<%else if rs("lock")=1 then%>
<img src="images/lock.gif" alt="锁定留言">
<%else if rs("hf")>=10 then%>
<img src="images/hotfolder.gif" alt="热点留言">
<%else if DateDiff("d",rs("lastdate"),Now)=0 then%>
<img src="images/newfolder.gif" alt="新留言">
<%else%>
<img src="images/folder.gif" alt="普通留言">
<%end if%>
<%end if%>
<%end if%>
<%end if%>
<%end if%> </td>
<td width="40" height="28" align="center" bgcolor="#FFFFFF"><%if option1=3 then%><img src="images/<%=rs("guest.pic")%>" ><%else%><img src="images/<%=rs("pic")%>" ><%end if%> </td>
<td width="348" onmouseover="this.className='table001'" onmouseout="this.className='table002'">
<%if rs("subject")="" then %>
<a href="show.asp?id=<%=rs("id")%>">无标题</a>
<%else%>
<%if option1=3 then%><a href="show.asp?id=<%=rs("guest.id")%>"><%=rs("subject")%></a>
<%else%>
<a href="show.asp?id=<%=rs("id")%>"><%=rs("subject")%></a>
<%end if%>
<%end if%>
<%if rs("hf")>10 then%>
[<img src="images/page.gif" width="10" height="12">
<%if rs("hf") mod 10=0 then end1=rs("hf")/10 else end1=rs("hf")/10+1 end if%>
<%for i=1 to end1%>
<%if option1=3 then%><a href="show.asp?PageNo=<%=i%>&id=<%=rs("guest.id")%>"><%else%><a href="show.asp?PageNo=<%=i%>&id=<%=rs("id")%>"><%end if%><strong><font color="#FF0000">
<%response.write i%>
</font></strong></a>
<%response.write " "%>
<%next%>
]
<%end if%> <%if rs("jinghua") then response.Write("<img src='images/jh.gif' border=0>")%></td>
<td width="100" align="center" class="jnfont5" bgcolor="#FFFFFF"> <div align="center"><font color=#000000>
<%if rs("username")<>"" then%>
<%=rs("username")%>
<%else%>
无名氏
<%end if%>
<%
Set rs2=server.createobject("ADODB.RECORDSET")
sql2="SELECT * FROM register where username='"&rs("username")&"'"
rs2.open sql2,conn,1,1
if not rs2.eof then
%>
<%if Instr(rs2("levels"),"嘉宾")>0 then%>
<img src="images/fbz.gif" alt="嘉宾" width="16" height="16">
<%end if%>
<%if Instr(rs2("levels"),"版主")>0 then%>
<img src="images/bz.gif" alt="版主" width="16" height="16">
<%end if%>
<%if rs2("levels")="管理员" then%>
<img src="images/gly.gif" alt="管理员" width="15" height="18">
<%end if
end if
%>
</font> </div></td>
<td width="40" align="center"><font color=#000000><%=rs("hf")%></font></td>
<td width="40" align="center" bgcolor="#FFFFFF"><font color=#000000><%=rs("yd")%></font></td>
<td width="250" align="center" >
<div align="left">
<%=rs("lastdate")&" <font color=#FF0000>|</font> "&rs("lastname")%>
</div></td>
<%if (session("admin")=1) or (session("admin")=2) then%>
<td width="39" align="center" bgcolor="#FFFFFF"><%if option1=3 then%><input name="<%=rs("guest.id")%>" type="checkbox" id="<%=rs("guest.id")%>3" value="on"><%else%><input name="<%=rs("id")%>" type="checkbox" id="<%=rs("id")%>3" value="on"><%end if%></td>
<%end if%>
</tr>
<%
RowCount = RowCount - 1
i=i-1
rs.MoveNext
Loop%>
</table>
</div>
<TABLE width=100% height="5" border=0 align=center cellPadding=3 cellSpacing=0>
<TBODY>
<TR>
<TD width="74%" style="LETTER-SPACING: 1px">跳转到第:[ <strong>
<%for i=PageNo to TSum%>
<%if j>9 then%>
....<a href="default.asp?PageNo=<%=TSum%>"><%response.write TSum%></a>
<%exit for%>
<%end if%>
<a href="default.asp?PageNo=<%=i%>"><%response.write i%></a><%response.write " "%>
<% j=j+1
next
%>
</strong>]页
</TD>
<TD width="26%" align=middle style="LETTER-SPACING: 1px"><div align="right">
<%
if TSum>1 Then
If PageNo=TSum or PageNo<>1 Then
PrwePage=PageNo-1
Response.Write "<A HREF=default.asp?Pageno=1"&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">第一页</A> "
Response.Write "<A HREF=default.asp?Pageno="&PrwePage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">上一页</A> "
End If
If pageno=1 or TSum>PageNo Then
NextPage=PageNo+1
Response.Write "<A HREF=default.asp?PageNo="&NextPage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">下一页</A> "
Response.Write "<A HREF=default.asp?Pageno="&rs.PageCount&"&text="&text&"&option="&option1&"&jinghua="&jinghua
Response.Write ">末一页</A> "
End If
End If
%>
</div></TD>
</TR>
<%if (session("admin")=1) or (session("admin")=2) then%>
<TR>
<TD colspan="2" style="LETTER-SPACING: 1px"><div align="right"> <select name=act class=input2>
<option value="1">删除留言</option>
<option value="2">固定顶端</option>
<option value="3">锁定留言</option>
<option value="4">提到最前</option>
<option value="5">取消固顶</option>
<option value="6">解除锁定</option>
<option value="7">认证留言</option>
<option value="8">取消认证</option>
<option value="9">设为精华</option>
<option value="10">取消精华</option>
</select>
<input name="goto" type=submit class=input2 id="goto2" value="确定">
</div></TD>
</TR>
<%end if%>
</TBODY>
</TABLE>
</form>
<tbody>
<tr>
<table width="100%" border="0" align="center">
<tr>
<td width="100%" height="39"> <form action="default.asp" method="post" name="form" id="form">
<div align="center">
<div align="center"> 搜索:
<INPUT
class=input1 size=25 name=text>
<INPUT name=option type=radio value=1 CHECKED>
发言主题
<INPUT type=radio value=2 name=option>
发言内容
<INPUT type=radio value=3 name=option>
回复内容
<input type=radio value=4 name=option>
注册名称
<INPUT name="submit" type=submit class=input2 value=" 搜 索 ">
</div>
</form></td>
</tr>
</table>
<table border=0 width=100% align=center>
<tr>
<td width="100%" height=12><HR SIZE=1 WIDTH=100% NOSHADE COLOR=#C0C0C0></td>
</tr>
<tr>
<td align=center>
<!--#INCLUDE FILE="bottom.asp"-->
</tr>
</table>
</html>
<%
'rs.close
'rs1.close
'rs2.close
set rs=nothing
set rs1=nothing
set rs2=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -