<%if Session("weight")<>2 and Session("weight")<>5 and Session("weight")<>3  then 
Response.Redirect "error.asp?cause=5"
 end if
%>

<object runat=server id=conn1 progid="adodb.connection"></object>
<%application.Lock
conn1.Open Application("p_jyzx")
Application.UnLock
%>
<%	
sql="select * from mynote where user_name='"&Request("from_who")&"'"
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	rs1.Open sql,conn1,3,2
	if rs1.RecordCount<>0 then
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from mynote where user_name='"&Request("from_who")&"'"
		'Response.Write sql
		'Response.End 
		rs.Open sql,conn1,2,3
		
		rs("user_name")=Request("from_who")
		rs("mynote")=Request("my_public_note")
		rs("time")=now()
		rs.update
	else	
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.Open "mynote",conn1,3,2
		rs.addnew
		rs("user_name")=Request("from_who")
		rs("mynote")=Request("my_public_note")
		rs("time")=now()
		rs.update
	end if
		dim temp_note
	temp_note="酷爱网VIP会员广播==> "
	sql="select top 20 mynote.*,user.nickname from user,mynote where user.user_name=mynote.user_name order by time desc"
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	'Response.Write sql
	'Response.End 
	rs1.Open sql,conn1,3
	while not rs1.EOF 
		temp_note=temp_note&"<a href=show_user.asp?user_name="&rs1("user_name")&" target=_blank>"
		temp_note=temp_note&rs1("nickname")&"</a>"
		temp_note=temp_note&"说："
		temp_note=temp_note&rs1("mynote")
		temp_note=temp_note&" —"&FormatDateTime(rs1("time"),2)&" ☆ "	
	rs1.MoveNext
	wend 
	application.Lock
	Application("quick_note")=temp_note
	Application.UnLock

%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<LINK href="/css/default.css" rel=stylesheet>
</HEAD>
<BODY>
<table width="360" border="0" >
 
   <tr><td align=center><br>
                          
   <FONT color=#003399 size=2><BR>您的即时贴发送成功，请刷新页面查看即时贴公告栏！
      </td></tr>

   <tr>   
      <td  align=center><BR><BR>
      <a href=javascript:window.close(); >关闭窗口</a></font></td>
      </tr>  
</table>  


</BODY>
</HTML>
