<% getInfo(1) '================================== ' 引用通告处理页面 ' 更新时间: 2006-6-1 '================================== IF IsInteger(Request.QueryString("tbID")) Then dim tbID,tbURL,tbTitle,tbExcerpt,tbBlog 'Trackback entry mode tbID = CheckStr(Request.QueryString("tbID")) If Request.QueryString("action")="deltb" Then delTrackback If Request.QueryString("url")<>Empty Then tbURL = checkURL(CheckStr(Request.QueryString("url"))) tbTitle = HtmlToText(CheckStr(Request.QueryString("title"))) tbExcerpt = HtmlToText(CheckStr(Request.QueryString("excerpt"))) tbBlog = HtmlToText(CheckStr(Request.QueryString("blog_name"))) doTrackback tbID,tbURL,tbTitle,tbExcerpt,tbBlog ElseIf Request.Form("url")<>Empty Then tbURL = checkURL(CheckStr(Request.Form("url"))) tbTitle = HtmlToText(CheckStr(Request.Form("title"))) tbExcerpt = HtmlToText(CheckStr(Request.Form("excerpt"))) tbBlog = HtmlToText(CheckStr(Request.Form("blog_name"))) doTrackback tbID,tbURL,tbTitle,tbExcerpt,tbBlog End If 'show Trackback List Set tbBlog=Conn.Execute("SELECT tb_Title,tb_URL,tb_Intro,tb_PostTime,log_title,tb_ID FROM blog_Trackback,blog_Content WHERE log_ID = blog_ID and blog_ID="&tbID&" ORDER BY tb_PostTime desc") SQLQueryNums=SQLQueryNums+1 Response.contentType="text/xml" Response.write "" If Not (tbBlog.BOF and tbBlog.EOF) Then %> 0 <![CDATA[<%=tbBlog(4)%>]]> article.asp?id=<%=tbID%>]]> ]]> utf-8 <% do while not tbBlog.eof %> <![CDATA[<%=tbBlog(0)%>]]> ]]> ]]> <%=DateToStr(tbBlog("tb_PostTime"),"w,d m y H:I:S")%> <% tbBlog.MoveNext loop %> <% tbBlog.close set tbBlog = nothing Conn.close set Conn=nothing else %> 1日志没有被引用. <% end if else Response.Redirect("search.asp?searchType=trackback") end if 'Trackback response function Function tbResponseXML(intFlag, strMessage) Response.contentType="text/xml" Response.write ""&intFlag&"" If intFlag=1 Then Response.write ""&strMessage&"" Response.write "" Conn.close set Conn=nothing Response.End End Function function doTrackback(tbID,tbURL,tbTitle,tbExcerpt,tbBlog) if len(tbURL)<1 or len(tbExcerpt)<1 or len(tbBlog)<1 then tbResponseXML 1,"trackback参数不完整" end if tbURL=CutStr(tbURL,252) tbExcerpt=CutStr(tbExcerpt,252) tbBlog=CutStr(tbBlog,100) if tbTitle="" Then tbTitle=tbURL Else tbTitle=CutStr(tbTitle,100) End If 'Check if allow trackback if Conn.Execute("SELECT count(log_ID) FROM blog_Content WHERE (log_IsShow=false or log_IsDraft=true) AND log_ID="&tbID)(0)>0 then tbResponseXML 1,"隐藏日志无法发送引用通告!" end if if StrComp(Request.QueryString("key"),blog_tbKey)=0 Then If Conn.Execute("SELECT count(tb_ID) FROM blog_Trackback WHERE blog_ID="&tbID&" AND tb_URL='"&tbURL&"' AND tb_Title='"&tbTitle&"' AND tb_Intro='"&tbExcerpt&"' AND tb_Site='"&tbBlog&"'")(0)>0 Then tbResponseXML 1,"此引用通告已发送!" end if if filterSpam(tbExcerpt & tbURL,"spam.xml") then tbResponseXML 1,"此引用通告中包含被屏蔽的字符" end if else tbResponseXML 1,"嘿!你小子搞错地址了吧!" end if Conn.Execute("INSERT INTO blog_TrackBack (blog_ID, tb_URL, tb_Title, tb_Intro, tb_Site, tb_PostTime) VALUES ("&tbID&",'"&tbURL&"','"&tbTitle&"','"&tbExcerpt&"','"&tbBlog&"',Now())") Conn.Execute("UPDATE blog_Content SET log_QuoteNums=log_QuoteNums+1 WHERE log_ID="&tbID) Conn.Execute("UPDATE blog_Info Set blog_tbNums=blog_tbNums+1") dim tbKey RANDOMIZE tbKey=int(900000*rnd)+100000 Conn.Execute("UPDATE blog_Info Set blog_tbKey="&tbKey) Smilies(1) Keywords(1) getInfo(2) PostArticle tbID SQLQueryNums=SQLQueryNums+3 tbResponseXML 0,"Trackback 成功!" response.end end function function delTrackback If Not (IsInteger(Request.QueryString("tbID")) AND IsInteger(Request.QueryString("logID"))) Then showmsg "Trackback 错误信息","无效参数
单击返回","ErrorIcon","" exit function end if checkCookies UserRight(1) Dim dele_tb,logID logID=CheckStr(Request.QueryString("logID")) Set dele_tb=Conn.ExeCute("SELECT * FROM blog_TrackBack WHERE blog_ID="&logID&" AND tb_ID="&CheckStr(Request.QueryString("tbID"))) SQLQueryNums=SQLQueryNums+1 IF dele_tb.EOF AND dele_tb.BOF Then showmsg "Trackback 错误信息","引用通告不存在
单击返回","WarningIcon","" Else If stat_Admin Then Conn.ExeCute("UPDATE blog_Content SET log_QuoteNums=log_QuoteNums-1 WHERE log_ID="&dele_tb("blog_ID")) Conn.Execute("DELETE * FROM blog_TrackBack WHERE blog_ID="&logID&" AND tb_ID="&CheckStr(Request.QueryString("tbID"))) Conn.Execute("UPDATE blog_Info Set blog_tbNums=blog_tbNums-1") SQLQueryNums=SQLQueryNums+2 Smilies(1) Keywords(1) PostArticle logID getInfo(2) showmsg "提示信息","引用通告删除成功!
单击返回","MessageIcon","" Else showmsg "Trackback 错误信息","你没有权限删除引用通告~
单击返回","ErrorIcon","" End If End IF response.end end function %>