<%
UserTrue=True
Dim ArticleID,ArticleArr,Title,Wh,BlogInfo,foot,tag,title2,UserName_Re
ArticleID=CblogObj.IsCInt(CblogObj.QueryStringPage("articleid",True))
IF CblogObj.FormRequest("commentsact")="comments" Then
	SET RS=CONN.EXECUTE("select User_Pass,id FROM TB_USER WHERE USER_NAME='"& CblogObj.FormRequest("UserName") &"'")
	IF RS.EOF AND RS.BOF THEN
		UserName_Re="匿名网友"
	ELSE
		IF RS(0)<>CblogObj.FormRequest("PassWord") THEN
			UserName_Re="匿名网友"
		Else
			UserName_Re="<a href="""& CblogObj.Getdir(Rs(1)) &""" target=""_blank"">" & CblogObj.FormRequest("UserName") & "</a>"
		END IF
	END IF
	Rs.Close:Set Rs=Nothing
	IF UserName_Re="匿名网友" Then
		IF Not CommentsName Then
			Response.Write "<script>alert('对不起,您还没有登陆,不允许匿名发布评论!');" 
			Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
			Response.End
		End IF
	End IF
	IF NOT CblogObj.CodeIsTrue() Then
			Response.Write "<script>alert('对不起验证码错误!');" 
			Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
			Response.End
	End IF
	Conn.Execute("Update Article Set Re_Count=Re_Count+1 where Article_ID="&ArticleID&"")
	Dim ReTitle,Message
	ReTitle=CblogObj.HtmlStr(CblogObj.FormRequest("title"))
	Message=Left(CblogObj.FormRequest("message"),3500)
	IF ReTitle="" Or Message="" Then
			Response.Write "<script>alert('对不起请写入内容和标题!');" 
			Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
			Response.End
	End IF
	Conn.Execute ("INSERT INTO [Tb_Reply] ([Reply_User],[Reply_Blog_ID],[Reply_Name],[Reply_Title],[Reply_Info],[Reply_Time]) VALUES ("& UserID &","& ArticleID &",'"& UserName_Re &"','"& ReTitle &"','"& Message &"','"& Now() &"')")
	CblogObj.SaveReXml(UserID)
	'CblogObj.DelCahe ("Hot_Articles")
	Response.Write "<script>alert('发表评论成功!');" 
	Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
	Response.End
End IF
Conn.Execute("Update Tb_User Set User_Count=User_Count+1 Where ID="&UserID&"")
SqlCount=SqlCount+1
Conn.Execute("Update Article Set See_Count=See_Count+1 Where User_ID="&UserID&" And Article_ID="&ArticleID&"")
SqlCount=SqlCount+1
Set Rs=Conn.Execute("Select Article_ID,User_Name,Article_Title,Article_Hid,Blog_Info,Whather,Article_Time,Article_ByClass,Article_Bl,Article_Form,Article_Tag,See_Count,Re_Count,(select Top 1 Article_ID FROM Article Where User_ID="&UserID&" And Article_Hid<>1 AND Article_ID>"&ArticleID&" ORDER BY Article_ID),(select Top 1 Article_ID FROM Article Where User_ID="&UserID&" And Article_Hid<>1 AND Article_ID<"&ArticleID&" ORDER BY Article_ID Desc),Article_Update,Blog_Quote From Article Where User_ID="& UserID &" And Article_Hid<>1 And Article_ID="&ArticleID&"")
SqlCount=SqlCount+1
IF Not Rs.Eof Then
	ArticleArr = Rs.GetRows
	Rs.Close:Set Rs=Nothing
Else
	Rs.Close:Set Rs=Nothing
	Response.Write "<h1>对不起,此日志或相册可能被隐藏或者被作者删除!</div>"
	Response.End
End IF
Title=ArticleArr(2,0)
title2=Title
IF ArticleArr(14,0)<>"" Then
	Title=Title & " [<a href=""Show.asp?/_articleid/"&ArticleArr(14,0)&".html"">上一篇</a>]" & Chr(13)
End IF
IF ArticleArr(13,0)<>"" Then
	Title=Title & " [<a href=""Show.asp?/_articleid/"&ArticleArr(13,0)&".html"">下一篇</a>]" & Chr(13)
End IF
title="<script language=""JavaScript"" src=""../../inc/common.js"" type=""text/javascript""></script>" & Chr(13) & Title
title="<script language=""JavaScript"" src=""../../inc/ubbcode.js"" type=""text/javascript""></script>" & Chr(13) & Title
Wh="[ " & ArticleArr(6,0) & " | 作者:" & ArticleArr(1,0) & " | 出处:" & ArticleArr(9,0) & " | 天气:" & ArticleArr(5,0) & " ] 字体：<a href=""javascript:setFontSize(13)"">大</a> <a href=""javascript:setFontSize(11)"">中</a> <a href=""javascript:setFontSize(9)"">小</a>" & Chr(13)
BlogInfo="<div id=""show"">"&UBBCode(ArticleArr(4,0)) & "<br/><br/>本文引用URL:" & UBBCode(ArticleArr(16,0)) & "<br/><br/>"& ArticleArr(15,0) & "</div>" &Chr(13)
foot="分类:<a href=""default.asp?/_classname/"& Left(ArticleArr(7,0),7) &".html"">" & Mid(ArticleArr(7,0),8) & "</a> | 部落:<a href=""../../ToBuoluo.asp?classname="& ArticleArr(8,0) &""">" & ArticleArr(8,0) & "</a> | 评论:" & ArticleArr(12,0) & " | <a href=""../../TrackBack.asp?ID="&ArticleID&""" target=""_blank"">引用通告</a> | 阅读次数(" & ArticleArr(11,0) & ")" & Chr(13)
tag="Tag:"& CblogObj.TagUbb(ArticleArr(10,0),"default.asp") &Chr(13)

Sub Comments()
	Dim SqlStr,RsCount,ArticleArr2,iii,CheckStr
	SqlStr="Select Reply_Name,Reply_Title,Reply_Info,Reply_Time From Tb_Reply Where Reply_User=" & UserID & " And Reply_Blog_ID=" & ArticleID & " Order By Reply_ID "& ReplyOrder
	Set Rs = Server.CreateObject("Adodb.RecordSet")
	Rs.open SqlStr,Conn, 1, 1
	SqlCount=SqlCount+1
	If Not Rs.Eof Then
		Rs.PageSize = UserPageSize
		MaxP=rs.PageCount
		Rs.AbsolutePage=CblogObj.QueryPage
		RsCount=Rs.RecordCount
		ArticleArr2 = Rs.GetRows(UserPageSize)
		Rs.Close:Set Rs=nothing
		for iii=0 to Ubound(ArticleArr2,2)
			CheckStr=Replace(ArticleArr2(2,iii),Chr(13),"")
			CheckStr=Replace(CheckStr,Chr(10),"")
			CheckStr=Replace(CheckStr,"'","’")
			Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
			Response.Write "<tr><td class=""retitle"">"& ArticleArr2(1,iii) & ArticleArr2(0,iii)&" 于 "& ArticleArr2(3,iii) &" 发表评论  [<a href=""#re"" onclick=""quotes('"&CheckStr&"','"&CblogObj.HtmlStr(ArticleArr2(0,iii))&"','"&ArticleArr2(3,iii)&"')"">引用</a>]</td></tr>"
			Response.Write "<tr><td class=""reinfo"">"&UBBCode(ArticleArr2(2,iii))&"</td></tr></table>"
		Next
		ArticleArr2=Empty
		CblogObj.PageList RsCount,CblogObj.QueryPage,UserPageSize,12,False
	Else
		Rs.Close:Set Rs=nothing
		Response.Write "<h5>没有发表任何评论</h5>" 
	End IF
		Response.Write "<div id=""comments""><form name=""input"" method=""post"" action=""""><a name=""re""></a><input name=""commentsact"" type=""hidden"" value=""comments"" />" & Chr(13)
		Response.Write "<p>用 户: <input name=""username"" type=""text"" value="""&request.Cookies("cixiblog")("User_Name")&""" class=""commentinput"" /> " & Chr(13)
		Response.Write "密 码: <input name=""password"" type=""password"" value="""&request.Cookies("cixiblog")("User_PASS")&""" class=""commentinput"" /><br/>" & Chr(13)
		Response.Write "验 证: <input name=""CodeStr"" type=""text"" size=""18"" maxlength=""50"" class=""commentinput"" />"& CblogObj.Vcode2 &"<br/>" & Chr(13)
		Response.Write "标 题: <input name=""title"" type=""text"" value=""回复:"& Title2 &""" style=""width:80%"" maxlength=""50"" /></p>" & Chr(13)
		Response.Write "<p id=""smilies"" style=""display:none;"">" & CblogObj.Smilies(25) & "</p>" & Chr(13)		
		Response.Write "<p>内 容: <textarea name=""message"" cols=""0"" style=""width:90%"" rows=""5""></textarea></p>" & Chr(13)
		Response.Write "<p align=""center""><input type=""submit"" name=""Submit"" value=""提交"" /></p> " & Chr(13)
		Response.Write "<p id=""ubb""><a href=""javascript:bold()"">[加粗]</a> " & Chr(13)
		Response.Write "<a href=""javascript:underline()"">[下划线]</a> " & Chr(13)
		Response.Write "<a href=""javascript:center()"">[居中] </a>" & Chr(13)
		Response.Write "<a href=""javascript:hyperlink()"">[网址] </a>" & Chr(13)
		Response.Write "<a href=""javascript:image()"">[图片] </a>" & Chr(13)
		Response.Write "<a href=""javascript:code()"">[代码] </a>" & Chr(13)
		Response.Write "<a href=""javascript:showIntro('smilies')"">[UBB表情]</a></p></form></div>" & Chr(13)
End Sub
ArticleArr=Empty
%>