📄 myweb_diary.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="myweb_check.asp"-->
<%
dim ID,Action
action=trim(request("action"))
ID=trim(Request("ID"))
userid=trim(Request("userid"))
set moneyrs=conn.execute("select add_money,lost_money from myweb_const where id=1")
addmoney=moneyrs("add_money")
lostmoney=moneyrs("lost_money")
moneyrs.close
%>
<html>
<head>
<title>木叶村免费个人主页http://www.x92.cn</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="木叶村网免费个人主页http://www.x92.cn">
<meta name="description" content="木叶村网免费个人主页http://www.x92.cn">
<link rel="stylesheet" href="admin/Admin_STYLE.CSS">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<div align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td height="24" align=center class="title"><strong style="font-weight: 400">
<font color="#000000">网 站 日 记 管 理</font></strong></td>
</tr>
<tr class="tdbg">
<td width="787">栏目导航:
<a href="myweb_diary.asp">管理所有日记</a> <font color="#FF0000">说明</font>:"设为网站日记"则该日记可以在主站上显示,"撤消网站日记"则该日记不显示在主站上</td>
</tr>
</table>
</div>
<%if request("action")="" then%>
<br>
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="49">
<tr class="tdbg" >
<td height="20" class="topbg" width="3%" align="center">
<font color="#000000">ID</font></td>
<td height="20" class="topbg" align="center" width="40%">
<strong style="font-weight: 400">
<font color="#000000">日记</font></strong>标题</td>
<td height="20" class="topbg" align="center" width="12%">
发布日期</td>
<td height="20" class="topbg" align="center" width="10%">
主站是否显示</td>
<td height="20" class="topbg" align="center" width="33%">
<font color="#000000">
管 理 操 作</font></td>
</tr>
<%
If Len(Trim(Request("page")))=0 Then '返回目标页码的判断
page=1
Else
page=CInt(Trim(Request("page")))
End If
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select userid,id,diaryname,diarydate,diarynice,index from [myweb_diary] where diarynice=true order by id desc"
rs.open sql,conn,1,1
rs.PageSize=20
if not rs.eof then
rs.AbsolutePage=page
for k=1 to rs.PageSize
%>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="3%" align="center" ><%=rs("id")%></td>
<td width="40%" align="center" ><%=rs("diaryname")%> </td>
<td align="center" width="12%" ><%=rs("diarydate")%> </td>
<td align="center" width="10%" ><%if rs("index")=true then%><font color=red>是</font><%else%>否<%end if%></td>
<td align="center" width="33%" >
<a target="_blank" href="e_showdiary.asp?diaryid=<%=rs("id")%>&userid=<%=rs("userid")%>">查看</a> <a href="myweb_diary.asp?action=modif&id=<%=rs("id")%>">编辑</a> <a href="myweb_diary.asp?action=del&id=<%=rs("id")%>&userid=<%=rs("userid")%>" <%="onClick='return confirm(""确定要删除此日记吗(不可恢复)?"");'"%>>删除</a>
<%if rs("index")=false then%><a href=myweb_diary.asp?action=index&id=<%=rs("id")%>&userid=<%=rs("userid")%>>设为网站日记</a><%end if%><%if rs("index")=true then%><a href=myweb_diary.asp?action=noindex&id=<%=rs("id")%>&userid=<%=rs("userid")%>>撤消网站日记</a><%end if%>
</td>
</tr>
<%
rs.movenext
if rs.EOF Then Exit For
next
end if
%> <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td align="center" colspan="5" ><%
if page <>1 then
Response.Write "<a href=myweb_diary.asp?page=1>首页</a> "
end if
tmppage = page - 1
if tmppage <= 0 then
tmppage = 1
else
Response.Write"<a href=myweb_diary.asp?page="&tmppage&">上一页</a>"
end if
tmppage = page + 1
if tmppage >rs.PageCount then
tmppage = page
else
Response.Write " <a href=myweb_diary.asp?page="&tmppage&">下一页</a> "
end if
if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
Response.Write "<a href=myweb_diary.asp?page="&rs.PageCount&">尾页</a>"
end if
if Cstr(rs.PageCount) <> 0 then
Response.Write "每页显示<font color=red>20</font>个日记信息 第<font color='blue'>" & page & "/"&rs.PageCount&"</font>页"
end if
Response.Write " 共有<font color='blue'>"&rs.RecordCount&"</font>个日记信息"
rs.close
%> </td>
</tr>
</table>
<%end if%>
<%if request("action")="modif" then%>
<%set rs=conn.execute("select id,diaryname,diarywrite,diarytimes,content,diaryweather from myweb_diary where id="&id&"")%>
<form action=myweb_diary.asp?action=edit&id=<%=rs("id")%> method=post onSubmit="submits();">
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
<tr class="tdbg" >
<td class="topbg" colspan="2">
<p align="center"><font color="#000000">修 改 </font><strong style="font-weight: 400">
<font color="#000000">日 记</font></strong></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
<strong style="font-weight: 400">
<font color="#000000">日记</font></strong>标题:</td>
<td width="76%" >
<input type="text" name="diaryname1" maxlength=50 size="59" value="<%=rs("diaryname")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
<strong style="font-weight: 400">
<font color="#000000">日记</font></strong>作者:</td>
<td width="76%" >
<input type="text" name="diarywrite1" maxlength=50 size="59" value="<%=rs("diarywrite")%>">
</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
查看次数:</td>
<td width="76%" >
<input type="text" name="diarytimes1" maxlength=50 size="59" value="<%=rs("diarytimes")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
天气情况:</td>
<td width="76%" >
<input type="radio" value="晴" <% if rs("diaryweather")="晴" then response.write"checked" end if %> name="diaryweather1"> 晴
<input type="radio" name="diaryweather1" <% if rs("diaryweather")="多云" then response.write"checked" end if %> value="多云"> 多云
<input type="radio" name="diaryweather1" <% if rs("diaryweather")="小雨" then response.write"checked" end if %> value="小雨"> 小雨
<input type="radio" name="diaryweather1" <% if rs("diaryweather")="阴" then response.write"checked" end if %> value="阴"> 阴</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
<strong style="font-weight: 400">
<font color="#000000">日记</font></strong>内容:</td>
<td width="76%" >
<input type=hidden name="content1" id='edit' value="<%
response.Write Server.HtmlEncode(rs("content"))
%>"><!--#include file="edit.asp"-->
</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td colspan="2" >
<p align="center"><input type=submit value="修 改" </td></td>
</tr>
</table>
</form>
<%rs.close%>
<%end if%>
<%if request("action")="edit" then%>
<br>
<table border="0" width="60%" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="56">
<tr class="tdbg" >
<td height="24" class="title">
<p align="center"><font color="#000000">系 统 信 息 提 示</font></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td >
<%dim diaryname1,diarywrite1,diarytimes1,content1,erroredit
diaryname1=trim(request.form("diaryname1"))
diarywrite1=trim(request.form("diarywrite1"))
diarytimes1=trim(request.form("diarytimes1"))
diaryweather1=trim(request.form("diaryweather1"))
content1=trim(request.form("content1"))
if diaryname1="" then
erroredit=erroredit+"<br><li>日记标题不能为空</li>"
end if
if diarywrite1="" then
erroredit=erroredit+"<br><li>日记作者不能为空</li>"
end if
if diarytimes1="" then
erroredit=erroredit+"<br><li>日记查看次数不能为空</li>"
end if
if content1="" then
erroredit=erroredit+"<br><li>日记内容不能为空</li>"
end if
if erroredit="" then
set rs=server.CreateObject("adodb.recordset")
sql="select id,diaryname,diarywrite,diarytimes,content,diaryweather from myweb_diary where id="&id&" "
rs.open sql,conn,1,3
rs.update
rs("diaryname")=diaryname1
rs("diarywrite")=diarywrite1
if isnumeric(diarytimes1) then
rs("diarytimes")=diarytimes1
end if
rs("diaryweather")=diaryweather1
rs("content")=content1
rs.update
response.write"<li><font color=red>系统处理结果如下</font></li><br><li>日记信息修改成功 </li><br> <center><a href=myweb_diary.asp><font color=red>返回</font></a></center>"
rs.close
set rs=nothing
else
response.write"<li><font color=red>系统处理结果如下</font></li>"&erroredit&"<br> <center> <a href=javascript:history.go(-1)><font color=red>返回重写</font></a></center>"
end if
%>
</td>
</tr>
</table>
<%end if%>
<%if request("action")="del" then
sql="delete from [myweb_diary] where ID=" & CLng(ID)
Conn.Execute sql
conn.execute("update [myweb_user] set count_diary=count_diary-1 where userid="&userID&"")
response.redirect"myweb_diary.asp"
end if
%>
<%if request("action")="index" then
sql="update [myweb_diary] set index=true where ID=" & CLng(ID)
Conn.Execute sql
set addrs=server.CreateObject("adodb.recordset")
sql1="select money from [myweb_user] where userid="&userid&""
addrs.open sql1,conn,1,3
addrs.update
addrs(0)=addrs(0)+addmoney
addrs.update
addrs.close
response.redirect"myweb_diary.asp"
end if
%>
<%if request("action")="noindex" then
sql="update [myweb_diary] set index=false where ID=" & CLng(ID)
Conn.Execute sql
set addrs=server.CreateObject("adodb.recordset")
sql1="select money from [myweb_user] where userid="&userid&""
addrs.open sql1,conn,1,3
addrs.update
addrs(0)=addrs(0)-lostmoney
addrs.update
addrs.close
response.redirect"myweb_diary.asp"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -