user_saveblog.asp
来自「个人博客」· ASP 代码 · 共 150 行
ASP
150 行
<!--#include file="conn.asp"-->
<!--#include file="inc/usercode.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="user_chkpass.asp"-->
<%
if CheckUserLogined()=False then
response.Redirect "user_login.asp"
end if
dim rs,rstmp,sql,rsblogchk,badstr
dim temp,tbid
dim tbUrl,tbTopic,tbExcerpt,tbBlogname,url
dim topic,logtext,blog_password
dim blogteame
url=trim(request("url"))'引用地址
sql="select * from blog where username='"&username&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,2,3
rs.addnew
rs("topic")=debadstr(trim(request("topic")))
logtext=debadstr(trim(request("edit")))
blogteame=trim(request("blogteam"))
rs("logtext")=logtext
'@share rs("face")=trim(request("face"))
'rs("username")=username
rs("addtime")= now()
rs("upfiles")=request("upfiles")
rs("classid")=clng(trim(request("classid")))
'@share rs("subjectid")=clng(trim(request("subjectid")))
'@share if request("showword")<>"" then
'rs("showword")=clng(trim(request("showword")))
'else
' rs("showword")=0
'end if
rs("showword")=300
set rstmp=conn.execute("select blog_password from [user] where username='"&blogteame&"'")
blog_password=rstmp(0) '判断整个blog是否加密
set rstmp=nothing
if blog_password<>"" then
rs("blog_password")=blog_password
else
rs("blog_password")=""
end if
rs("author")=username
if blogteame=username then
rs("username")=username
else
rs("username")=blogteame
end if
rs("ishide")= "false" '@share trim(request("ishide"))
'rs("ishide")=trim(request("ishide"))
if trim(request("ispassword"))<>"" then
rs("ispassword")=md5(trim(request("ispassword")))
end if
rs("iis")=0
rs("trackback")=0
set rsblogchk=conn.execute("select blogcheck from bloginfo") '判断是否需要审核
if rsblogchk("blogcheck")="true" then
rs("passcheck")="false"
set rsblogchk=nothing
else
if findbadstr(request("logtext")) then '检查敏感字出现次数
rs("passcheck")="false"
else
rs("passcheck")="true"
end if
end if
set rsblogchk=nothing
rs.update
Set rs=Conn.Execute("SELECT max(id) from blog where username='"&username&"'")
tbid=RS(0)
rs.close
set rs=nothing
'增加用户日志数
set rs=conn.execute("select logcount from [user] where username='"&username&"'")
conn.execute("update [user] set logcount="&rs(0)+1&" where username='"&username&"'")
set rs=nothing
'增加系统分类日志数
if clng(trim(request("classid")))<>0 then
conn.execute("update [classname] set classlognum=classlognum+1 where id="&clng(trim(request("classid"))) )
end if
'增加专题日志数
'if clng(trim(request("subjectid")))<>0 then
' conn.execute("update [subject] set subjectlognum=subjectlognum+1 where id="&clng(trim(request("subjectid"))) )
'end if
'增加系统日志数
conn.execute("update [bloginfo] set logcount=logcount+1")
Application(cachename&"index_update")=true
'以下为引用参数
set rs=conn.execute("select siteurl from bloginfo")
tbUrl=rs(0)&"more.asp?name="&username&"&id="&tbid
tbTopic =trim(request("topic"))
tbExcerpt = left(unhtml(logtext),100)
tbBlogname = username
set rs=nothing
function unHtml(content)
ON ERROR RESUME NEXT
unHtml=content
if content <> "" then
unHtml=Server.HTMLEncode(unHtml)
unHtml=replace(unHtml,vbcrlf,"<br>")
unHtml=replace(unHtml,chr(9)," ")
unHtml=replace(unHtml," "," ")
end if
if Err.Number <>0 then
unHtml= "html转换中出错请联系管理员<br>"
Err.Clear
end if
end function
%>
<% if url<>"" then%>
<script language="JavaScript">
document.title="保存信息";
function chgInnerHtml()
{
document.all.showMsg.innerHTML = "<br><br><br><br><br><div align=center>引用已经提交,<a href='user_index.asp'><font color=red>请点击返回</font></a></div>"
//document.location ="user_index.asp"
}//chgInnerHtml
function loadFunc()
{
parent.tbFrame.tbF.url.value = "<%=tbUrl%>";
parent.tbFrame.tbF.topic.value = "<%=tbtopic%>";
parent.tbFrame.tbF.excerpt.value = "<%=tbExcerpt%>";
parent.tbFrame.tbF.blogname.value = "<%=tbBlogname%>";
parent.tbFrame.tbF.action = "<%=Request.Form("url")%>";
parent.tbFrame.tbF.submit();
setTimeout("chgInnerHtml()",3000);
}
</script>
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css">
<body onLoad="loadFunc()">
<span id="showMsg">
<br><br><br><br><br><div align="center">正在提交引用...</div>
</span>
<iframe id=tbFrame name=tbFrame style="width=0;height=0;top=0;left=0" frameborder=0 src=tb.asp?act=post></iframe>
</body>
<%
else
response.Redirect "user_index.asp"
end if
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?