<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
if request.QueryString("action")="save" then
  dim errmsg
  errmsg=""

if ChkPost=false then
  errmsg=errmsg+"<li>错误，不允许外部提交数据！"  
end if

dim content,addtime,authorid

content=convert(ReplaceBadChar(request.Form("board")))
addtime=now()
authorid=userid

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from finfo_info where liuyan='"& content &"' and userid="& authorid &""
rs.open sql,conn,1
if not(rs.eof or rs.bof) then
  errmsg=errmsg+"<li><strong><font size=4>请不要重复发布文章信息！</font></strong>"
end if 
rs.close
set rs=nothing

if content="" then errmsg=errmsg+"<br>"+"<li>征友信息内容不能为空！"

if errmsg<>"" then 
 response.Write "错误信息：<br>"
 response.write("　　　"+ errmsg)
 response.Write "<input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from finfo_info where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("liuyan")=content
rst("userid")=authorid
rst("dtime")=addtime
rst("username")=membername
rst.update
rst.close
set rst=nothing
conn.close
set conn=nothing

BackInfo("friendinfo.asp")
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友情缘网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
-->
</style>
<script Language="JavaScript">
<!--
function CheckAll()  
{  
	if (form.board.value.length==0)
	{alert("请填写征友信息内容！");
	form.board.focus();
	return false;   
	}
	if (form.board.value.length>200)
	{alert("征友信息内容不能超过200字！");
	form.board.focus();
	return false;   
	}	
	return true;  
}  
-->
</script>
<SCRIPT language=javascript>
<!--
function NoteHint(F){

	s=self.document.form.board.value;
	len=s.length;

	if(len>200){
	        document.form.note_charleft.value = "公告太长了!";
        	document.form.note_charleft.style.color = "#FF0000";
        	return;
	}

	count=0;
	var ch=0;
	for(i=0;i<len;i++){
		ch=s.charCodeAt(i)&0xffff;
		if(ch<0xff){
			count++;
		}
		else{
			count+=2;
		}
	}
	count=200-count;
	
        var col = "#000000";
	var num1;
        if(count >= 0) {
                num1 = "剩余字符长度：" + count;
                col = "#CC3300";
        } 
        else {
        	num2 = (-1) * count;
                num1 = "约会留言超长" + num2 + "字符";
                col = "#FF0000";
        }
        document.form.note_charleft.value = num1;
        document.form.note_charleft.style.color = col;
}


//-->
</SCRIPT>
</head>

<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="204" height="328" valign="top"><!--#include file="memberleft.asp"--></td>
    <td width="583" valign="top"><table width="565" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><TABLE width="100%" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" style="BORDER-BOTTOM: #9DCCF6 1px solid">
          <TBODY>
            <TR>
              <TD align=center width="1%"><img src="image/tiao_3.gif" width="10" height="31"></TD>
              <TD width="21%" align=center background="image/tiao_4.gif"><table width="106" height="25" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="107" align="center" class="pgd">发布交友信息</td>
                  </tr>
              </table></TD>
              <TD width="44%" height="20" align="center" background="image/tiao_4.gif">&nbsp;		</TD>
              <TD width="32%" align="center" background="image/tiao_4.gif">&nbsp;</TD>
              <TD width="1%" align="center"><img src="image/tiao_2.gif" width="10" height="31"></TD>
            </TR>
          </TBODY>
        </TABLE></td>
      </tr>
      <tr>
        <td height="299" valign="top" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1">
          <tr>
            <td valign="top" align="center"><br>
              <table width="465" height="90" border="0" cellspacing="0" class="STYLE4">
                <form name="form" action="addfinfo.asp?action=save" method="post" onSubmit="return(CheckAll());">
                  <tr>
                    <td height="90"><table height="45" border="0" cellpadding="3" cellspacing="0" class="STYLE4">
                        <tr>
                          <td height="25" width="68">您的网名：</td>
                          <td height="25" width="295"><input type="text" name="name" size="20" value="<%=membername%>" disabled class="put">
                          </td>
                        </tr>
                        <tr>
                          <td height="1" valign="top" width="68">交友信息：</td>
                          <td rowspan="2" height="21" valign="top" width="295"><textarea rows="4" name="board" cols="44" class="put" onbeforepaste="NoteHint('0');" onpaste="NoteHint('1');" onKeyDown="NoteHint('1');" onKeyUp="NoteHint('0');" onChange="NoteHint('1');" ></textarea>
                              <BR>
                              <INPUT style="font-size: 9pt; BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BACKGROUND-COLOR: transparent; BORDER-RIGHT-WIDTH: 0px" readOnly maxLength=25 size=25 value="剩余字符长度：200" name=note_charleft>
                          </td>
                        </tr>
                        <tr>
                          <td height="28" width="68"></td>
                        </tr>
                        <tr align="center">
                          <td height="30" colspan="2" valign="middle"><input type="submit" value="　提交　" name="B1" class="put1">
                              <input type="reset" value="　重写　" name="B2" class="put1">
                          </td>
                        </tr>
                    </table></td>
                  </tr>
                </form>
            </table></td></tr>
          <tr>
            <td height="1" background="images/hline.gif"></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="163" valign="top"><!--#include file="fenlei.asp"--></td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
