📄 d_look.asp
字号:
<!--#include file="up.asp"-->
<!--#include file="conndiary.asp"--><br>
<%dtitle=Request.Form("dtitle")
dbody=Request.Form("dbody")
dpubl=Request.Form("dpubl")
if lgname="" then
else
set lockuser=d_conn.execute("select * from lockuser where d_name='"&lgname&"' ")
if not lockuser.eof or not lockuser.eof then %>
<%=t1%>错误信息<%=t2&d1%>对不起你的日记本的使用权已经被禁止!!要想再次使用请给管理员发短信!!<%=d2%>
<%else
set duser=d_conn.execute("select * from duserset where d_name='"&lgname&"' ")
if duser.eof then%>
<%=t1%>错误信息<%=t2&d1%>对不起你还没有申请日记本!!
<form action="diary.asp?action=reg" method="post">
请在此输入日记本的名字:
<INPUT type="text" name=notename> <INPUT type="submit" value="确认" name=a1>
</form>
<%else
select case action
case "mag"%>
<%=t1%>个人日记管理<%=t2&d1%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr>
<td height="95"><table width="90%" height="96%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr align="center" valign="top">
<td width="32%" height="20"><font color="<%=c2%>">日记名称</font></td>
<td width="23%"><font color="<%=c2%>">日期</font></td>
<td width="25%"><font color="<%=c2%>">修改</font></td>
<td width="20%"><font color="<%=c2%>">删除</font></td>
</tr>
<%set mynote=d_conn.execute("select * from diary where d_name='"&lgname&"'")
do while not mynote.eof
did=mynote("d_id")
notettl=mynote("d_title")
noteda=mynote("d_data")%>
<tr align="center">
<td height="20"><a href="d_look.asp?action=look&did=<%=did%>"><%=notettl%></a></td>
<td><%=noteda%></td>
<td><a href="d_look.asp?action=xiu&did=<%=did%>">修改</a></td>
<td><a href="d_look.asp?action=del&did=<%=did%>">删除</a></td>
</tr>
<%mynote.movenext
loop
mynote.close
set mynote=nothing
%>
<tr valign="bottom">
<td height="20" colspan="4" align="center"><a href="d_look.asp?action=add&dname=<%=lgname%>"><font color="<%=c2%>">添加新日记</font></a></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<%=d2%>
<%case "other"%>
<%=t1%><%=dname%>的日记本<%=t2&d1%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr>
<td height="95"><table width="90%" height="96%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr align="center" valign="top">
<td width="32%" height="20"><font color="<%=c2%>">日记名称</font></td>
<td width="23%"><font color="<%=c2%>">日期</font></td>
</tr>
<%set mynote=d_conn.execute("select * from diary where d_name='"&dname&"'and d_public=1")
do while not mynote.eof
did=mynote("d_id")
notettl=mynote("d_title")
noteda=mynote("d_data")%>
<tr align="center" valign="top">
<td height="20"><a href="d_look.asp?action=look&did=<%=did%>"><%=notettl%></a></td>
<td height="20"><%=noteda%></td>
</tr>
<%mynote.movenext
loop
mynote.close
set mynote=nothing
%>
</table></td>
</tr>
</table>
<%=d2%>
<%case "look"%>
<%set lookd=d_conn.execute("select * from diary where d_id="&did&"")
if not lookd.eof and not lookd.bof then
nopub=lookd("d_public")
dnm=lookd("d_name")
dttl=lookd("d_title")
dbody=lookd("d_body")
dda=lookd("d_data")
dbody=Replace(dbody,CHR(10), "<BR> ")
dbody=Replace(dbody,CHR(9), " ")
if nopub=1 or dnm=lgname then '''如果是私有"0"的且是自己写的就能访问
%><%=t1%><%=dttl%><%=t2&d1%><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr>
<td height="95" valign="top"><%=dbody%></td>
</tr>
<tr>
<td height="10" align="right" valign="top">本日记写于:<%=dda%></td>
</tr>
</table><%=d2%>
<%
else
%><%=t1%>错误信息<%=t2&d1%>对不起!!你访问的日记是<%=dnm%>私有的!!!!<a href=javascript:history.go(-1)>请返回</a><%=d2%>
<%
end if
else
%><%=t1%>错误信息<%=t2&d1%>对不起!!没有你要访问的日记!!!!<a href=javascript:history.go(-1)>请返回</a><%=d2%>
<%end if%>
<%case "add"%>
<%=t1%>添加日记<%=t2&d1%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr>
<td height="94"><form action="d_look.asp?action=addok" method="post" name="a">日记题目:<input name="dtitle" type="text" size="80">
<font color="#FF0000">*</font> 日记状态:
<select name="dpubl" size="1">
<option value="0" selected>私密</option>
<option value="1">公开</option>
</select>
<p align="justify">日记主体:<br>
<textarea name="dbody" cols="80" rows="20"></textarea>
</p>
<p align="center">
<input name="a1" type="submit" value="提交日记" >
<input name="a2" type="reset" id="a2" value="重置">
</form>
</p></td>
</tr>
</table>
<%=d2%>
<%case "addok"
if dtitle="" or dbody="" then
%><%=t1%>错误信息<%=t2&d1%>对不起!!你填写的信息不全请 <a href=javascript:history.go(-1)>返回重写</a>!!!!!<%=d2%>
<%else
set dbit=d_conn.execute("select * from dadmin ")
if not dbit.eof and not dbit.bof then
dmin=dbit("d_min")
dmax=dbit("d_max")
if len(dbody)<dmin or len(dbody)>dmax then%>
<%=t1%>错误信息<%=t2&d1%>对不起!!你写的日记字数应在<%=dmin%>和<%=dmax%>字之间 <a href=javascript:history.go(-1)>返回重写</a>!!!!!<%=d2%>
<%else
d_conn.execute("update duserset set d_public=d_public+1 where d_name='"&lgname&"'")
d_conn.execute("insert into diary(d_title,d_name,d_body,d_public)values('"&dtitle&"','"&lgname&"','"&dbody&"',"&dpubl&")")
%>
<%=t1%>添加成功<%=t2&d1%>你写的日记已经提交成功!!
<br>
<a href="d_look.asp?action=add&dname=<%=lgname%>">是否再次添加日记</a>!!!! <%=d2%>
<%
end if
else
end if
dbit.close
set dbit=nothing
end if
%>
<%case"xiu"%>
<%set lookd1=d_conn.execute("select * from diary where d_id="&did&" and d_name='"&lgname&"'")
if not lookd1.eof and not lookd1.bof then
nopub1=lookd1("d_public")
dttl1=lookd1("d_title")
dbody1=lookd1("d_body")
%>
<%=t1%>修改日记<%=t2&d1%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=c1%>">
<tr>
<td height="94"><form action="d_look.asp?action=xiuok&did=<%=did%>" method="post" name="a2">日记题目:<input name="dtitle" type="text" value="<%=dttl1%>" size="80">
<font color="#FF0000">*</font> 日记状态:
<select name="dpubl" size="1">
<option value="0" selected>私密</option>
<option value="1">公开</option>
</select>
<p align="justify">日记主体:<br>
<textarea name="dbody" cols="80" rows="20"><%=dbody1%></textarea>
</p>
<p align="center">
<input name="a1" type="submit" value="修改日记" >
<input name="a2" type="reset" id="a2" value="重置">
</form>
</p></td>
</tr>
</table>
<%else
end if%>
<%=d2%>
<%case "xiuok"%>
<%
if dtitle="" or dbody="" then
%>
<%=t1%>错误信息<%=t2&d1%>对不起!!你填写的信息不全请<a href=javascript:history.go(-1)>返回重写</a>!!!!!<%=d2%>
<%else
set dbit=d_conn.execute("select * from dadmin ")
if not dbit.eof and not dbit.bof then
dmin=dbit("d_min")
dmax=dbit("d_max")
if len(dbody)<dmin or len(dbody)>dmax then%>
<%=t1%>错误信息<%=t2&d1%>对不起!!你写的日记字数应在<%=dmin%>和<%=dmax%>字之间 <a href=javascript:history.go(-1)>返回重写</a>!!!!!<%=d2%>
<%else
d_conn.execute("update diary set d_title='"&dtitle&"',d_name='"&lgname&"',d_body='"&dbody&"',d_public="&dpubl&",d_data=now where d_id="&did&" and d_name='"&lgname&"'")
%>
<%=t1%>修改成功<%=t2&d1%>你要修改的日记已经修改成功!!<%=d2%>
<%
end if
else
end if
end if
%>
<%case"del"%>
<%
d_conn.execute("update duserset set d_public=d_public-1 where d_name='"&lgname&"'")
d_conn.execute("delete from diary where d_id="&did&"")%>
<%=t1%>删除成功<%=t2&d1%>你已经成功的删除一个日记 !!!<br><br>
<a href=d_look.asp?action=mag>继续删除???</a><%=d2%>
<%end select%>
<%end if%>
<%=d2%>
<%
end if
end if%>
<!--#include file="down.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -