<!--#include file="inc/Config.asp" -->
<%
UserTrue=True
Sub ResponseXML(intFlag, strMessage)
	Response.contentType="text/xml"
	Response.write "<?xml version=""1.0"" encoding=""gb2312""?>"
	Response.write "<response><error>"&intFlag&"</error>"
	Response.write "<message>"&strMessage&"</message>"
	Response.write "</response>"
	Response.End
End Sub
Dim Url,title,blog_name,excerpt,id
Url=CblogObj.HtmlStr(Request("url"))
title=CblogObj.HtmlStr(Request("title"))
blog_name=CblogObj.HtmlStr(Request("blog_name"))
excerpt=CblogObj.HtmlStr(Request("excerpt"))
id=Request("ID")
IF Url<>"" And LCase(left(Url,7))="http://" Then
	IF TITLE="" Then
		Call ResponseXML(2,"TITLE,参数错误!")
	Else
		IF ID<>"" And Isnumeric(ID) Then
			IF Conn.Execute("Select Count(Article_ID) From Article Where Article_ID="& ID &" And Article_Hid<>1")(0)<1 Then
				Call ResponseXML(5,"没有此日志,或此日志已被日志主人隐藏!")
			Else
				Set Rs=Conn.Execute("Select ID From TrackBack Where ArticleID="& ID &" And Url='"& Url &"'")
				IF Not Rs.eof Then
					Call ResponseXML(4,"不能重复引用")
				Else
					Conn.Execute("INSERT INTO [TrackBack](ArticleID,Url,title,blog_name,excerpt) VALUES("& id &",'"&Url&"','"&title&"','"& blog_name &"','"&excerpt&"')")
				End IF
				Rs.Close:Set Rs=Nothing
			End IF
		Else
			Call ResponseXML(3,"ID参数错误!")
		End IF
	End IF
Else
	Call ResponseXML(1,"URL参数错误")
End IF
Set CblogObj=Nothing
%>
