<!-- #include file="../inc/checkadmin.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/Nohtml.asp" -->
<%
if request.form("su_name")="" then
response.write "<Script language=JavaScript>alert('亲爱的，是不是忘记输入《 昵称 》了？');history.back();</Script>"
response.end 
end if
if request.form("su_content")="" then
response.write "<Script language=JavaScript>alert('亲爱的，是不是忘记输入《 评论内容 》了？');history.back();</Script>"
response.end 
end if

id=request.QueryString("id")

su_name=request.form("su_name")
su_url=request.form("su_url")
su_mail=request.form("su_mail")
su_content=request.form("su_content")

su_recontent=request.form("su_recontent")
su_huifutz=request.form("su_huifutz")
su_view=request.form("su_view")
su_touxiang=request.form("su_touxiang")

set rs=server.createobject("adodb.recordset")
sql="select * from web_shuoshuo_comment where su_id="&id&""
rs.open sql,conn,1,3
su_sid=rs("su_sid") 
rs("su_name")=""&su_name&""
rs("su_url")=""&su_url&""
rs("su_mail")=""&su_mail&""
rs("su_content")=""&su_content&""
rs("su_recontent")=""&su_recontent&""
rs("su_huifutz")=""&su_huifutz&""
rs("su_touxiang")=""&su_touxiang&""
rs("su_view")=""&su_view&""
rs("su_retime")=now
rs.update
rs.close
set rs=nothing
%>

<% 
set rs=server.createobject("adodb.recordset")
sql="select * from Web_Advanced_Settings"
rs.open(sql),conn,1,1
huifupl=rs("huifupl") '评论通知开关
huifuly=rs("huifuly") '留言通知开关
fjryx=rs("fjryx") '发件人邮箱
fjrmc=rs("fjrmc") '发件人名称
h_title=rs("h_title") '邮件标题
hxdz=rs("hxdz") '指定回信地址
faname=rs("faname") '发送服务器登录名称
fapass=rs("fapass") '发送服务器登录密码
smtpname=rs("smtpname") 'smtp服务器名称
rs.close
set rs=nothing
%>

<% 
set rs=server.createobject("adodb.recordset")
sql="select top 1 web_url,web_name,web_author from Web_Setting"
rs.open(sql),conn,1,1
web_url=rs("web_url")
web_name=rs("web_name")
web_author=rs("web_author")
rs.close
set rs=nothing
%>

<% 
if huifupl=1 and su_huifutz=1 then

set rs=server.createobject("adodb.recordset")
sql="select * from web_shuoshuo where s_id="&su_sid&""
rs.open(sql),conn,1,1
w_id=rs("s_id") 
w1_title=rs("s_content") 
w_title=RemoveHTML(""&w1_title&"",10)
rs.close
set rs=nothing
end if
%>


<% if huifupl=1 and su_huifutz=1 and su_mail<>"" and su_recontent<>"" then

''=========利用Jmail在线发送邮件函数 start=============
Function sendjmail(t1,t2,t3)
't1:接收邮件地址 t2:接收邮件用户名 t3:邮件正文
dim jmail
set jmail=server.createobject("Jmail.message")
jmail.silent=true
jmail.charset="gb2312"
jmail.ContentType = "text/html"

'发件人邮箱
jmail.from=""&fjryx&""
'发件人名称
jmail.fromname=""&fjrmc&""
'收件人邮箱,姓名  
jmail.AddRecipient t1,t2
'邮件的紧急程度，1最快，5最慢
jmail.Priority=2
'发送邮件标题
jmail.subject=""&h_title&"说说评论有了新的回复"
'指定别的回信地址   
JMail.ReplyTo=""&hxdz&""

JMail.HTMLBody = "<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""></head><body>"&t3&"</body></html>"

jmail.mailserverusername=""&faname&""       '邮件发送服务器登录名称
jmail.mailserverpassword=""&fapass&""       '邮件发送服务器登录密码
sendok=jmail.send(""&smtpname&"")         'smtp服务器名称

jmail.Close
set jmail=nothing
End Function
''=========利用Jmail在线发送邮件函数 end=============

''调用上面定义的函数发送邮件的方法
''邮件里面的内容
response.write sendjmail(""&su_mail&"",""&su_name&"","<div style='background-color:#fff; border:1px solid #135685; color:#111; border-radius:8px; font-size:13px; width:100%; margin:0 auto; margin-top:10px; font-family:微软雅黑, Arial; margin-left: 1px;'><div style='background:#135685; width:100%; height:60px; color:white; border-radius:6px 6px 0 0; '><span style='height:60px; line-height:60px; margin-left:30px; font-size:20px;'><a style='text-decoration:none; color:#00bbff;font-weight:600;'  href='"&web_url&"'  target='_blank'>"&web_name&"</a> 说说评论回复：</span></div><div style='width:90%; margin:0 auto'><p>亲爱的 [ <a style='text-decoration:none; color:#0473b2'>"&su_name&"</a> ] ：您好!</p><p>您曾对[ <a style='text-decoration:none; color:#0473b2'  href='"&web_url&"' target='_blank'>"&web_name&"</a> ] 的说说《 <a style='text-decoration:none; color:#0473b2'  href='"&web_url&"/shuos/?"&w_id&".html' target='_blank'>"&w_title&"</a> 》 发表了评论:</p><p style='background-color: #f2f2f2;border-radius:6px;border: 1px solid #DDD;padding: 10px 5px;margin: 15px 0;'>"&su_content&"</p><p>[ <a style='text-decoration:none; color:#0473b2'>"&web_author&"</a> ] 给您的回复如下:</p><p style='background-color: #f2f2f2;border-radius:6px;border: 1px solid #DDD;padding:10px 5px;margin: 15px 0;'>"&su_recontent&"</p><p>您可以点击  <a style='text-decoration:none; color:#0473b2'  href='"&web_url&"/shuos/?"&w_id&".html#Comment-"&id&"' target='_blank'>查看完整內容</a>；</p><p>期待您再次光临 <a style='text-decoration:none; color:#0473b2'  href='"&web_url&"' target='_blank'>"&web_name&"</a>，谢谢您对[ <a style='text-decoration:none; color:#0473b2'  href='"&web_url&"' target='_blank'>"&web_name&"</a> ] 的厚爱！</p><p style='color:#0473b2;'><b>温馨提示</b>：本邮件由系统自动发出，请勿直接回复！ </p></div></div>")

response.write "<script>alert('恭喜，评论回复成功，并已向对方发送邮件通知！');location.href='ShuoCommentList.asp'</script>"

%>

<%end if%>

<%
if su_recontent="" then
response.write "<script>alert('评论信息修改成功！');location.href='ShuoCommentList.asp'</script>"
response.end
end if
%>


<%if (huifupl=0 and su_recontent<>"") or (huifupl=1 and su_huifutz<>1 and su_recontent<>"") then
response.write "<script>alert('恭喜，评论回复成功！');location.href='ShuoCommentList.asp'</script>"
response.end
end if
%>

<%
if huifupl=1 and su_huifutz=1 and su_mail="" then 
response.write "<script>alert('评论回复成功，但因邮件地址为空，导致邮件发送失败！');location.href='ShuoCommentList.asp'</script>"
response.end
end if
%>
<!-- #include file="../inc/close.asp" -->