<%Option Explicit%>
<!--#include file="post.asp"-->
<!--#include file="ubbcode.asp"-->
<%DoWhat="留言查阅"
	Dim submainid
	submainid=request.querystring("id")
	IsErr=False
if submainid="" or (not isnumeric(submainid)) then
		IsErr=True
		WhatErr="<LI>留言ID参数无效，请从合法链接进入！；</LI>"
else	
    SqlData="select top 1 * from Data where id=" & Cint(submainid) & " and SubMainNumber=0"
    Rs.open SqlData,conn,1,3
		if Rs.eof and Rs.bof then
			IsErr=True
			WhatErr="<LI>你查看的留言不存在或已经被删除；</LI>"
	  else
	  	if Isempty(Request.Querystring("action")) then
		  	Rs("counter")=Rs("counter")+1
		  	Rs.update
			end if
			Dim istop,submain,name,sex,face,email,homeurl,ip,writetime,ly,counter,flower,egg			
			istop=Rs("istop")
			submain=ChkBadWords(Rs("submain"))
			name=Rs("name")
			sex=Rs("sex")
			email=Rs("email")
			homeurl=Rs("homeurl")
			face=Rs("face")
			ly=Rs("ly")
			ip=Rs("ip")
			writetime=Rs("writetime")
			counter=Rs("counter")
			flower=Rs("flower")
			egg=Rs("egg")
			Rs.close
		end if		
end if

Sub DisMainBody()	'主体过程
response.write "<table width=780 border=1 cellspacing=0 cellpadding=3 align=center bordercolor=#FFFFFF>"&_
"<tr><td width=""100%"" colspan=2 align=center><table width=""100%"" cellspacing=0 cellpadding=0><tr><td width=""30%"">"&_
"<a href=""go.asp?id=" & submainid & """><img src=""images/prethread.gif"" border=0></a> <a href=""javascript:location.reload()"" target=_self><img src=""images/refresh.gif"" border=0></a> "&_
"<a href=""go.asp?action=next&id=" & submainid & """><img src=""images/nextthread.gif"" border=0></a><td width=""40%"" align=center>您是这条留言的第 <B>" & counter & "</B> 位阅读者</td><td width=""30%"" align=right>"&_
"<a href=""default.asp""><img src=""images/home.gif"" border=0 alt=""返回首页""></a> <a href=""upfile.asp""><img src=""images/newpage.gif"" border=0 alt=""签写留言""></a> " & IsLogin() & "</td></tr></table>"&_
"<tr><td height=15 bgcolor=#DEE5EF colspan=2><img src=""images/folder_old.gif"" border=0> <B>留言主题：" & submain & "</B></td></tr><tr bordercolor=#DEE5EF><td width=""22%"" height=30 bgcolor=#DEE5EF valign=top>"&_
"<table width=""100%""><tr><td colspan=2 align=right><img src=""images/"
	if sex then response.write "Male.gif"" border=0 alt=""帅哥哟"">" else response.write "Female.gif"" border=0 alt=""美女哦"">"
response.write "</td></tr><tr><td width=""30%"">作 者：</td><td widht=""70%"" style=""filter:shadow(color=#8F8FE0, strength=2)""><B><font color=#800000>" & name & "</font></B></td></tr><tr><td>性 别：</td><td>"
if sex then response.write "男" else response.write "女"
response.write "</td></tr><tr><td width=""100%"" colspan=2 align=center><a href=""edit.asp?action=flower&id=" & submainid & """ title=""同意该观点，送给作者一朵鲜花""><img src=""images/xianhua.gif"" border=0>鲜花(" & flower & ")</a> "&_
"<a href=""edit.asp?action=egg&id=" & submainid & """ title=""不同意该观点，给作者一个鸡蛋""><img src=""images/jidan.gif"" border=0>鸡蛋(" & egg& " )</a></td></tr></table>"&_
"<td width=""78%"" colspan=2 bgcolor=#FFFFFF><TABLE width=""98%"" border=0 cellspacing=0 cellpadding=0 align=center><tr><td width=""12%"">"
		    if email>"" then 
		    	response.write "<a href=""mailto:" & email & """><img src=""images/email.gif"" border=0 alt=""我的电邮""></a>"
		    else
		    	response.write "<img src=""images/email.gif"" border=0 alt=""没有邮箱"">"
		    end if
response.write "</td> <td width=""12%"">"
		    if homeurl>"" then 
		    	response.write "<a href=""" & homeurl & """ target=_blank><img src=""images/homepage.gif"" border=0 alt=""我的主页""></a>"
		    else
		    	response.write "<img src=""images/homepage.gif"" border=0 alt=""没有主页"">"
		    end if
response.write "</td> <td width=""12%""><a href=""post.asp?id=" & submainid & "&quotid=" & submainid & "&name=" & name & "&writetime=" & writetime & """><img src=""images/quot.gif"" border=0 alt=""引用内容""></td>"&_
		    	"<td width=""12%""><a href=""post.asp?id=" & submainid & "&replyid=" & submainid & "&contentmain=" & submain & "&name=" & name & """><img src=""images/reply.gif"" border=0 alt=""回复留言""></td>"&_
		    	"<td width=""52%"" align=right><B>楼	主</B></td></tr><tr><td colspan=5><HR color=#DEE5EF></td></tr>"&_
		  		"<tr><td colspan=5><img src=""face/face" & face & ".gif"" border=0> <B>" & submain & "</B> <br> <br> " & UBBCode(ly) & "</td></tr></TABLE></td></tr><tr><td bgcolor=#FFFFFF>"
	if session("admin") then
  	response.write "<a href=""iplook.asp?ip=" & ip & """ target=_blank><img src=""images/ip.gif"" alt=""点击查看用户来源及管理，IP：" & ip & """ border=0></a> " & writetime
  else
  	response.write "<img src=""images/ip.gif"" border=0 alt=""IP：*" & mid(ip,2,len(ip)-1) & "*""> " & writetime
  end if
	if istop=1 then 
		response.write "</td><td align=right><a href=""edit.asp?action=isbottom&id=" & submainid & """><img src=""images/notop.gif"" border=0></a>" 
	else
		response.write "</td><td align=right><a href=""edit.asp?action=istop&id=" & submainid & """><img src=""images/istop.gif"" border=0></a>"
	end if
response.write " <a href=""edit.asp?action=edit&id=" & submainid & """><img src=""images/edit.gif"" border=0></a> <a href=""edit.asp?action=del&id=" & submainid & """><img src=""images/del.gif"" border=0 onclick=""{if(confirm('确定删除此主题?')){return (true);}return (false);}""></a></td></tr>"
	SqlData="select * from Data where SubMainNumber=" & Cint(submainid) & " order by id"
	Rs.open SqlData,conn,1,1
if Not Rs.eof and Not Rs.bof then
		dim resubmain,i
		i=0
		do while not Rs.eof
		i=i+1
		resubmain=Rs("submain")
		name=Rs("name")
		sex=Rs("sex")
		email=Rs("email")
		homeurl=Rs("homeurl")
		face=Rs("face")
		ly=Rs("ly")
		ip=Rs("ip")
		writetime=Rs("writetime")
		flower=Rs("flower")
		egg=Rs("egg")
		if resubmain="" then resubmain="回复：" & submaiin else resubmain=ChkBadWords(resubmain)
response.write "<tr bordercolor=#DEE5EF><td width=""22%"" height=30 bgcolor=#DEE5EF valign=top><table width=""100%""><tr><td colspan=2 align=right>"&_
"<img src=""images/"
	if sex then response.write "Male.gif"" border=0 alt=""帅哥哟"">" else response.write "Female.gif"" border=0 alt=""美女哦"">"
response.write "</td></tr><tr><td width=""30%"">作 者：</td><td widht=""70%"" style=""filter:shadow(color=#8F8FE0, strength=2)""><B><font color=#800000>" & name & "</font></B></td></tr><tr><td>性 别：</td><td>"
	if sex then response.write "男" else response.write "女"
response.write "</td></tr><tr><td width=""100%"" colspan=2 align=center><a href=""edit.asp?action=flower&id=" & Rs("id") & """ title=""同意该观点，送给作者一朵鲜花""><img src=""images/xianhua.gif"" border=0>鲜花(" & flower & ")</a>"&_
"<a href=""edit.asp?action=egg&id="&Rs("id")&""" title=""不同意该观点，给作者一个鸡蛋""><img src=""images/jidan.gif"" border=0>鸡蛋("&egg&")</a></td></tr></table></td><td width=""78%"" colspan=2 bgcolor=#FFFFFF>"&_
"<TABLE width=""98%"" border=0 cellspacing=0 cellpadding=0 align=center><tr><td width=""12%"">"
				if email>"" then 
		    	response.write "<a href=""mailto:" & email & """><img src=""images/email.gif"" border=0 alt=""我的电邮""></a>"
		    else
		    	response.write "<img src=""images/email.gif"" border=0 alt=""没有邮箱"">"
		    end if
response.write "</td><td width=""12%"">"
			  if homeurl>"" then 
		    	response.write "<a href=""" & homeurl & """ target=_blank><img src=""images/homepage.gif"" border=0 alt=""我的主页""></a>"
		    else
		    	response.write "<img src=""images/homepage.gif"" border=0 alt=""没有主页"">"
		    end if
response.write "</td> <td width=""12%""><a href=""post.asp?id=" & submainid & "&quotid=" & Rs("id") & "&name=" & name & "&writetime=" & writetime & """><img src=""images/quot.gif"" border=0 alt=""引用内容""></td>"&_
		    	"<td width=""12%""><a href=""post.asp?id=" & submainid & "&replyid=" & Rs("id") & "&contentmain=" & resubmain & "&name=" & name & """><img src=""images/reply.gif"" border=0 alt=""回复留言""></td>"&_
		    	"<td width=""52%"" align=right><B>第 <font color=#C00000>" & i & "</font> 楼</B></td></tr><tr><td colspan=5><HR color=#DEE5EF></td></tr>"&_
		  		"<tr><td colspan=5><img src=""face/face" & face & ".gif"" border=0> <B>" & resubmain & "</B> <br> <br> " & UBBCode(ly) & "</td></tr></TABLE></td></tr><tr><td bgcolor=#FFFFFF>"
	if session("admin") then
  	response.write "<a href=""iplook.asp?ip=" & Rs("ip") & """ target=_blank><img src=""images/ip.gif"" alt=""点击查看用户来源及管理，IP：" & ip & """ border=0></a> " & writetime
  else
  	response.write "<img src=""images/ip.gif"" border=0 alt=""IP：*" & mid(ip,2,len(ip)-1) & "*""> " & writetime
  end if
response.write "&nbsp;</td><td align=right><a href=""edit.asp?action=edit&id=" & Rs("id") & """><img src=""images/edit.gif"" border=0></a> <a href=""edit.asp?action=del&id=" & Rs("id") & """><img src=""images/del.gif"" border=0 onclick=""{if(confirm('确定删除此回复?')){return (true);}return (false);}""></a></td></tr>"
Rs.movenext
	loop
end if
	Rs.close
	set Rs=nothing
	conn.close
	set conn=nothing
response.write "</table>"
SavePostSubMain="回复：" & submain
call post()		'调用发帖过程
End Sub

call HeadHtml()		'网页头过程
If IsErr Then call FounderErr() Else call DisMainBody() 		'调用主体过程或信息过程
call FootHtml()	'网页尾过程
%>