📄 show.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="background.asp"-->
<!--#INCLUDE FILE="ubblabel.asp"-->
<!--#INCLUDE FILE="ubbcode.asp"-->
<script language=javascript>
function exit(id)
{
if(!confirm('确认删除个主题?将连同回复一起删除'))
return;
url ="show.asp?del=ok&id="+id
window.location.href =url
}
function exit1(id1,id)
{
if(!confirm('确认删除这条回复?'))
return;
url ="show.asp?del=ok&type1=ok&id="+id1+"&id1="+id
window.location.href =url
}
function guestpreview()
{
document.preview.content.value=document.form.Content.value;
var popupWin = window.open('GuestPreview.asp', 'GuestPreview', 'scrollbars=yes,width=620,height=230');
document.preview.submit()
}
</script>
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
Set rs1=Server.CreateObject("ADODB.RecordSet")
session("useridname")=Request.cookies("ly")("useridname")
session("useridpassword")=Request.cookies("ly")("useridpassword")
if session("useridname")<>"" then
rs.open "select level1 from register where username='"&session("useridname")&"'",conn,1,1
if not rs.eof then
if rs("level1")="管理员" then session("admin")=1
if rs("level1")="版主" then session("admin")=2
if rs("level1")<>"版主" and rs("level1")<>"管理员" then session("admin")=0
else
session("admin")=0
end if
rs.close
end if
if not rs11("regshow") and session("useridname")="" then response.Redirect "error.asp?info=您尚未登录,不能查看留言内容!"
webname=rs11("webname")
homepage=rs11("weblink")
show=rs11("show")
del=no
type1=no
del=request("del")
text=request("text")
type1=request("type1")
if del="ok" and ((session("admin")=1) or (session("admin")=2)) then
if type1="ok" then
dsql="delete From reply where id1="&request("id")
conn.execute(dsql)
rs.open "Select * from guest where ID = " & request("ID1"),conn,2,3
rs("hf")=rs("hf")-1
rs1.open "Select * from reply where id="&rs("id")&" order by id1 desc",conn,1,1
if rs1.eof then
rs("lastname")="——"
rs("lastdate")=rs("lydate")
else
rs("lastname")=rs1("replyname")
rs("lastdate")=rs1("replydate")
end if
rs.update
rs1.close
response.Redirect "show.asp?id="&request("id1")
else
rs.open "Select * from guest where ID = " & request("ID"),conn,2,3
dsql="delete from reply where id="&request("id")
conn.execute(dsql)
dsql="delete From guest where id="&request("id")
conn.execute(dsql)
response.Redirect "index.asp"
end if
set rs=nothing
set rs1=nothing
end if
sh=no
type1=no
sh=request("sh")
type1=request("type1")
if sh="ok" and ((session("admin")=1) or (session("admin")=2)) then
if type1="ok" then
dsql="update reply set mark=1 where id1="&request("id1")
conn.execute(dsql)
else
rs.open "Select * from guest where ID = " & request("ID"),conn,2,3
dsql="update guest set mark=1 where id="&request("id")
conn.execute(dsql)
if request("all")="1" then
dsql="update reply set mark=1 where id="&request("id")
conn.execute(dsql)
end if
end if
set rs=nothing
set rs1=nothing
response.Redirect "show.asp?id="&request("id")
end if
if (request("act")<>"") and ((session("admin")=1) or (session("admin")=2)) then
select case request("act")
case 0
rs.open "Select count(*) as hfcount from reply where ID = " & request("ID"),conn,1,1
dsql="update guest set hf="&rs("hfcount")&" where id="&request("id")
conn.execute(dsql)
rs.close
rs.open "Select * from guest where ID = " & request("ID"),conn,3,3
rs1.open "Select * from reply where id="&request("id")&" order by id1 desc",conn,1,1
if rs1.eof then
rs("lastname")="——"
rs("lastdate")=rs("lydate")
else
rs("lastname")=rs1("replyname")
rs("lastdate")=rs1("replydate")
end if
rs.update
rs.close
rs1.close
case 1
dsql="update guest set top1=1 where id="&request("id")
conn.execute(dsql)
case 2
dsql="update guest set top1=0 where id="&request("id")
conn.execute(dsql)
case 3
dsql="update guest set jinghua=1 where id="&request("id")
conn.execute(dsql)
case 4
dsql="update guest set jinghua=0 where id="&request("id")
conn.execute(dsql)
case 5
dsql="update guest set lock=1 where id="&request("id")
conn.execute(dsql)
case 6
dsql="update guest set lock=0 where id="&request("id")
conn.execute(dsql)
case 7
dsql="update guest set lastdate='"&now&"' where id="&request("id")
conn.execute(dsql)
end select
end if
ID1=request("id")
up1="no"
next1="no"
up1=request("up")
next1=request("next")
if up1="ok" then
rs.open "Select * from guest where ID < " & ID1,conn,3,3
if rs.recordcount=0 then
rs.close
rs.open "select * from guest where ID="&ID1,conn,3,3
end if
rs.movelast
rs1.open "Select * from reply where ID = " & rs("id")&" order by replydate",conn,3,3
end if
if next1="ok" then
rs.open "Select * from guest where ID > " & ID1,conn,3,3
if rs.recordcount=0 then
rs.close
rs.open "select * from guest where ID="&ID1,conn,3,3
end if
rs1.open "Select * from reply where ID = " & rs("id")&" order by replydate",conn,3,3
end if
if (up1<>"ok") and (next1<>"ok") then
rs.open "Select * from guest where ID = " & ID1,conn,3,3
rs1.open "Select * from reply where ID = " & ID1&" order by replydate",conn,3,3
end if
if (not rs("mark")) and show and ((session("admin")<>1) and (session("admin")<>2)) then response.Redirect("error.asp?info=本留言为未审核,不能查看!")
rs("yd")=rs("yd")+1
rs.update
Set rs4=server.createobject("ADODB.RECORDSET")
rs4.open "Select * From option1" ,Conn,3,3
if rs1.recordcount<>0 then
dim maxperpage,url,PageNo
url="show.asp?id="&id1
rs1.pagesize=10
PageNo=REQUEST("PageNo")
maxperpage=rs.pagesize
if PageNo="" or PageNo=0 then PageNo=1
rs1.AbsolutePage=PageNo
TSum=rs1.pagecount
RowCount=rs1.PageSize
PageNo=PageNo+1
PageNo=PageNo-1
else
PageNo=1
TSum=1
end if
if rs("secret")=0 then
else
if (rs("username")<>text) then
if (session("admin")<>2) then response.Redirect "error.asp?info=这不是你所发的言,不能查看留言内容!"
else
end if
end if
%>
<SCRIPT language=javascript>
function save_onclick()
{
var strTemp = document.form.UserName.value;
if (strTemp.length == 0 )
{
alert("请输入用户名!");
document.form.UserName.focus();
return false;
}
var strTemp = document.form.Content.value;
if (strTemp.length == 0 )
{
alert("请填写留言内容!");
document.form.Content.focus();
return false;
}
return true;
}
</SCRIPT>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示回复留言</title>
<link href="1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body onkeydown="if(event.keyCode==13 && event.ctrlKey) if(save_onclick())document.form.submit()">
<tr>
<td align=left>
<table width="100%" cellpadding="5" cellspacing="1" align="center" class="tablebg<%=skin%>b">
<tr class="tablebg<%=skin%>a">
<td> <div align="left"><strong>* 留言主题:
<%if rs("subject")="" then %>
无标题
<%else%>
<font color="<%=rs("fontcolor")%>"><%=rs("subject")%></font>
<%end if%>
<input name="id" type="hidden" id="id" value="<%=request("id")%>">
</strong> </div></td>
</tr>
</table>
<%
if (rs1.recordcount=0) or (PageNo=1) then%>
<table width="100%" align=center cellpadding="5" cellspacing="1" <%if bg mod 2=0 then%>class="tablebg<%=skin%>e"<%else%>class="tablebg<%=skin%>f"<%end if%>>
<tr>
<td width="18%" rowspan="3" align=center valign="top" class="tablebg<%=skin%>h">
<table width="100%" border="0" align="center" >
<tr>
<td width="61%">
<div align="right"><%if (session("admin"))<>0 or (session("useridname")=rs("username")) then%>
<font color="#FF0000"> {<%=rs("username")%>发表}</font>
<%end if%><br><font color=#0066CC><b>
<% Set rs2=server.createobject("ADODB.RECORDSET")
sql2="SELECT * FROM register where username='"&rs("username")&"'"
rs2.open sql2,conn,3,3%>
<%if rs2("level1")="版主" then%>
<%=rs("username")%>老师<%else%><%=rs2("level1")%> <%end if%>
</b></font>
</div></td>
<td width="40%">
<div align="left">
<%
if not rs2.eof then
if Instr(rs2("level1"),"嘉宾")>0 then%>
<font color=#000000><img src="images/bz.gif" alt="嘉宾" width="16" height="16"></font>
<%end if
if Instr(rs2("level1"),"版主")>0 then%>
<font color=#000000><img src="images/fbz.gif" alt="老师" width="16" height="16"></font>
<%end if
if rs2("level1")="管理员" then%>
<img src="images/gly.gif" alt="管理员" width="15" height="18">
<% end if
end if
%>
<%
if not rs2.eof then
%>
<%if rs2("sex")="1" then%>
<img src="images/man.gif" alt="GG" width="20" height="14">
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -