📄 edit_log.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="log_lib.asp" -->
<%
if not instr(1,Request.ServerVariables("http_Referer"),Request.ServerVariables ("SERVER_NAME"),1)=8 then
message "DLOG错误:提交的数据来自网站外部"
response.end
end if
'Username=replace(request("Username"),"'","''")
log_id=replace(request("log_id"),"'","''")
'dim log_tittle,log_content,cat_id,log_author,l_year,l_month,l_day
Log_tittle=Trim(replace(request("log_tittle"),"'","''"))
log_content=RTrim(replace(request("log_content"),"'","''"))
cat_id=request("cat_id")
'log_AUTHOR=Username
log_weather=request("log_weather")
face=request("face")
l_year=request("l_year")
l_month=request("l_month")
l_day=request("l_day")
allows=request("allows")
allowubb=request("allowubb")
author=replace(request("author"),"'","''") 'Poorfish增加来自于字段
author_url=replace(request("author_url"),"'","''") 'Poorfish增加来自于链接字段
if allows="" then
allows=0
end if
if allowubb="" then
allowubb=0
end if
'=======================从log中提取用于编辑的数据========================
sql="select * from log where log_id="&log_id
set rs=conn.Execute(sql)
if rs.eof or rs.bof then
MESSAGE("所选定的日志不存在或以被删除")
Response.End
end if
'========================================================================
if request.form("del_log")="true" then
lr_count=rs("lr_count")
log_author=rs("log_author")
SQL = "Delete from log where log_Id = " & log_ID
conn.Execute(sql)
SQL = "Delete from log_r where log_Id = " & log_ID
conn.Execute(sql)
sql= "UPDATE log_count Set l_COUNT = l_COUNT - 1,r_Count=r_Count-"&lr_Count&" where COUNT_ID = 1"
conn.Execute(sql)
sql= "UPDATE user_mdb SET F_Count=F_Count-1 where username='"&Log_AUTHOR&"'"
conn.Execute(sql)
url="index.asp?vt=byday&l_year="&l_year&"&l_month="&l_month&"&l_day="&l_day
Response.Redirect(url)
end if
if cstr(request.form("UpdataLOG"))<>"" then
if log_tittle= "" then
MESSAGE("主题不能为空")
Response.End
end if
if log_content= "" then
MESSAGE("无内容的日志不是个好注意哦~~")
Response.End
end if
if l_year="" or l_month="" or l_day="" then
MESSAGE("请确定此篇日志的年月日")
Response.End
end if
Username=replace(request("Username"),"'","''")
log_content=log_content & "<div align=right class=eng style=color:#cccccc>[Edit on " & now() & " By " & username & "]</div>"
if request("move_log")="true" then
SQL = "UPDATE log set log_content='" & log_content & "',log_tittle='" & log_tittle & "',log_weather='" & log_weather & "',face='" & face & "',l_year=" & l_year & ",l_month=" & l_month & ",l_day= " & l_day & ", allows = " & allows & " , allowubb = " & allowubb & " ,cat_id= " & cat_id & " , author='" & author & "' , author_url='" & author_url & "' where log_id=" & log_id &""
else
SQL = "UPDATE log set log_content='" & log_content & "',log_tittle='" & log_tittle & "',log_weather='" & log_weather & "',face='" & face & "',l_year=" & l_year & ",l_month=" & l_month & ",l_day= " & l_day & ", allows = " & allows & " , allowubb = " & allowubb & " , author='" & author & "' , author_url='" & author_url & "' where log_id=" & log_id &"" '更新来自于字段 by Poorfish
end if
conn.Execute(SQL)
url="showlog.asp?log_id="&log_id&"&cat_id="&cat_id
Response.Redirect(url)
end if
%>
<html>
<head>
<title><%=win_head%> | 修改日志内容</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body bgcolor="#d6d3ce" topmargin="0" leftmargin="0" style="OVERFLOW: auto">
<table width="728" border="0" cellspacing="0" cellpadding="4">
<tr>
<td bgcolor="#E1DDD8">
<%checkuser()
response.write check_user%>
</td>
</tr>
</table>
<%if not (isad=-1 or rs("log_author")=username) then
MESSAGE "您没编辑此日志的权限,请返回,或向管理员申请权限"
response.end
end if%>
<table width="728" border=0 cellpadding=2 cellspacing=0>
<form name="NewLog" method="POST" action="edit_log.asp">
<tr>
<td colspan=2> <table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="#efefef">
<td> <font color="#000000"> <b>标题</b>
<input type=text name="log_tittle" size="50" maxlength="100" value="<%=rs("log_tittle")%>">
</font></td>
<td align="right"><b> <font color="#000000">
<input type="checkbox" name="move_log" value="true">
转移到:</font></b>
<select name="cat_id">
<!--#include file="cat_list.asp" -->
</select>
<script>
document.NewLog.cat_id.options.value="<%=rs("cat_id")%>" //读取日志所属分类 by Poorfish
</script>
</td>
</tr>
<tr bgcolor="#efefef">
<td> <b><font color="#000000">日期:
<input type="text" value="<%=rs("l_year")%>" name="l_year" maxlength="4" size="4" class="bk">
年
<input type="text" value="<%=rs("l_month")%>" name="l_month" maxlength="2" size="2" class="bk">
月
<input type="text" value="<%=rs("l_day")%>" name="l_day" maxlength="2" size="2" class="bk">
日 天气:
<select name="log_weather" id="select3">
<option id="sunny" value="sunny">sunny</option>
<option id="ptcl" value="ptcl">ptcloudy</option>
<option id="cloudy" value="cloudy">cloudy</option>
<option id="showers" value="showers">showers</option>
<option id="rain" value="rain">rain</option>
<option id="t-storms" value="t-storms">t-storms</option>
<option id="snow" value="snow">snow</option>
<option id="flurries" value="flurries">flurries</option>
<option id="ice" value="ice">ice</option>
</select>
<script>
document.NewLog.log_weather.options.value="<%=rs("log_weather")%>" //读取数据库中保存的天气信息 by Poorfish
</script>
</font></b></td>
<td align="right"><font color="#000000"><b>
<input type="checkbox" name="del_log" value="true">
<b>删除</b></b></font></td>
</tr>
<tr bgcolor="#efefef">
<td colspan="2"> <font color="#000000"><b>来自
<input name="author" type="text" id="author" value="<%=rs("author")%>" size="10">
地址
<input name="author_url" type="text" id="author_url" value="<%=rs("author_url")%>" size="35">
</b> </font></td>
</tr>
</table></td>
</tr>
<tr>
<td valign=middle colspan="2">
<script>
function inputs(smiley){
if(document.NewLog.log_content.createTextRange){
document.NewLog.log_content.focus();
document.selection.createRange().duplicate().text=smiley;
}else{
document.NewLog.log_content.value+=smiley;
}
}
</script>
<textarea name="log_content" style="display:none"><%=Server.HTMLEncode(rs("log_content"))%></textarea>
<iframe ID="eWebEditor1" src="eWebEditor/ewebeditor.asp?id=log_content&style=poorfish" frameborder="0" scrolling="no" width="720" HEIGHT="400"></iframe>
</td>
</tr>
<tr>
<td valign=middle colspan="2"> 心情指数:
<input type="radio" name="face" value="1" checked> <img src="images/face1.gif">
<input type="radio" name="face" value="2"> <img src="images/face2.gif">
<input type="radio" name="face" value="3"> <img src="images/face3.gif">
<input type="radio" name="face" value="4"> <img src="images/face4.gif">
<input type="radio" name="face" value="5"> <img src="images/face5.gif">
<script>
//读取数据库中保存的头像信息 by Poorfish
var faces=document.NewLog.face;
for (var i=0;i<=faces.length;i++){
if (faces[i].value == '<%=rs("face")%>'){
break
}
}
faces[i].checked=1
</script>
</td>
</tr>
<tr>
<td height="35" colspan="2"> 表 情: <a href="#" title=加入心情图标 onClick=inputs(':)')><img src="smile/01.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':(')><img src="smile/02.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':o')><img src="smile/03.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':D')><img src="smile/04.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(';)')><img src="smile/05.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':a')><img src="smile/06.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':b')><img src="smile/07.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':c')><img src="smile/08.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':d')><img src="smile/09.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':e')><img src="smile/10.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':f')><img src="smile/11.gif" width="15" height="15" border="0"></a>
<a href="#" title=加入心情图标 onClick=inputs(':g')><img src="smile/12.gif" width="15" height="15" border="0"></a>
</td>
</tr>
<tr>
<td> <%response.write "<input type=""checkbox"" name=""allows"" value=""1"""
if rs("allows")=1 then
response.write "checked"
end if
response.write ">禁止笑脸转换[默认为允许]"
response.write "<input type=""checkbox"" name=""allowubb"" value=""1"" "
if rs("allowubb")=1 then
response.write "checked"
end if
response.write ">禁止ubb转换[默认为允许]"
%>
</td>
<td colspan="-1" align="right"> <input type="hidden" name="UPDataLog" value="true">
<input type="hidden" name="username" value="<%=username%>">
<input type="hidden" name="log_id" value="<%=log_id%>">
<input type="submit" name="Submit" value=" 修 改 " onClick="this.disabled=true;document.NewLog.submit();">
</td>
</tr>
</form>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -