<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<!--#include file="inc/upiconfig.asp"-->
<%
 '=========================================================
' File: modifyadd.asp
' Version:3.0
' Date: 2005-11-6
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
stats="联系资料修改"
call nav()
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有登陆，请登陆后进行修改。"
	founderr=true
end if

if founderr then
  	errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
	call head_var("","")
	call Mslove_error()
else
	call head_var(membername & "的帐号","mycount.asp")
	if request("action")="updat" then
		call upreg()
		if founderr then
		call Mslove_error()
		else
			sucmsg="<li>修改联系资料成功！"
			call Mslove_suc()
		end if
	else
		call userinfo()
	end if
end if
call activeonline()
call footer()

sub userinfo()
dim UserEmail,UserIM,homepage,Oicq,Icq,Msn,Aim,Yahoo,Uc
set rs=server.createobject("adodb.recordset")
sql="Select UserIM,UserEmail from [Ms_User] where userid="&userid
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
	founderr=true
	exit sub
else
UserIM=rs("UserIM")
UserEmail=rs("UserEmail")
end if
rs.close
set rs=nothing
if UserIM<>"" then
	UserIM=split(UserIM,"|||")
	if ubound(UserIM)=6 then
	homepage=UserIM(0)
	Oicq=UserIM(1)
	Icq=UserIM(2)
	Msn=UserIM(3)
	Aim=UserIM(4)
	Yahoo=UserIM(5)
	Uc=UserIM(6)
	else
	homepage=""
	Oicq=""
	Icq=""
	Msn=""
	Aim=""
	Yahoo=""
	Uc=""
	end if
else
	homepage=""
	Oicq=""
	Icq=""
	Msn=""
	Aim=""
	Yahoo=""
	Uc=""
end if
%>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>

<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr>
<th width=12% height=25 id=tabletitlelink><a href=mycount.asp>我的帐号</a></th>
<th width=11%  id=tabletitlelink><a href=mymodify.asp>基本资料</a></th>
<th width=11%  id=tabletitlelink><a href=modifypsw.asp>密码修改</a></th>
<th width=11%  id=tabletitlelink><a href=modifyfd.asp>交友资料</a></th>
<th width=11%  id=tabletitlelink><a href=modifyadd.asp>联系资料</a></th>
<th width=11%  id=tabletitlelink><a href=usersms.asp>短信服务</a></th>
<th width=11%  id=tabletitlelink><a href=friendlist.asp>我的好友</a></th>
<th width=11%  id=tabletitlelink><a href=favlist.asp>我的收藏</a></th>
<th width=11%  id=tabletitlelink><a href=userphoto.asp>我的相册</a></th>
</tr>
</table>
<form action="modifyadd.asp?action=updat" method=POST name="theForm">
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr align="left"> 
        <th height="28" colspan="2"  class=tablebody1>填写联系资料信息</th>
      </tr>
      <tr> 
        <td width=41% height="30"  class=tablebody1><b>主页地址：</b></td>
        <td width=60%  class=tablebody1><INPUT maxLength=80 size=50 name=homepage value="<%=homepage%>"> 
      </tr>
	     <TR> 
        <TD width=41% class=tablebody1><B>Email地址：</B><BR>
          请输入有效的邮件地址，这将保证您在交友中的私人资料。</TD>
        <TD width=60% class=tablebody1><input class=2 maxLength=20 size=30 readonly="only" name=UserEmail value="<%=UserEmail%>">
          <span class="STYLE1">请到<a href="<%=Hl_Url&Manage_Url%>User_Passport.asp" target="_blank">通行证</a>修改</span></TD>
      </TR>
      <tr> 
        <td height="30"  class=tablebody1><B>OICQ号码：</B><BR>
          如果您有 OICQ，请输入号码。此项可选</td>
        <td width=60%  class=tablebody1><input class=2 maxLength=20 size=30 name=Oicq value="<%=Oicq%>"></tr>
      <TR> 
        <TD width=41% class=tablebody1><B>ICQ号码：</B><BR>
          如果您有 ICQ，请输入号码。此项可选</TD>
        <TD width=60% class=tablebody1><input class=2 maxLength=20 size=30 name=Icq value="<%=Icq%>"> 
        </TD>
      </TR>
      <TR> 
        <TD width=41%  class=tablebody1><B>MSN号码：</b><BR>
          如果您有 MSN，请输入。此项可选</TD>
        <TD width=60%  class=tablebody1><input class=2 maxLength=70 size=30 name=Msn value="<%=Msn%>"> 
        </TD>
      </TR>
      <TR> 
        <TD width=41%  class=tablebody1><strong>UserAim号码：</strong><br>
          如果您有 UserAim，请输入号码。此项可选</TD>
        <TD width=60%  class=tablebody1><INPUT maxLength=70 size=30 name=Aim value="<%=Aim%>"></TD>
      </TR>
      <TR > 
        <TD width=41%  class=tablebody1><strong>Yahoo号码：</strong><br>
          如果您有 Yahoo，请输入号码。此项可选</TD>
        <TD width=60%  class=tablebody1><INPUT maxLength=70 size=30 name=Yahoo value="<%=Yahoo%>"></TD>
      </TR>
      <TR > 
        <TD  class=tablebody1><strong>UC号码：</strong><br>
          如果您有 UC，请输入号码。此项可选</TD>
        <TD width=60%  class=tablebody1><INPUT maxLength=70 size=30 name=Uc value="<%=Uc%>"></TD>
      </TR>
    <tr align="center"> 
      <td colspan="2" width="100%"  class=tablebody2>
            <input class=2 type=Submit value="更 新" name="Submit"> &nbsp; <input class=2 type="reset" name="Submit2" value="清 除">
      </td>
    </tr>
	<tr align="center"> 
      <td colspan="2" width="100%"  class=tablebody1 align="left"><font color=red>注意：</font><br>　　请您认真填写，未来意中人对您的第一印象也许就从这里产生。您的真诚，也许就会收获你一生的幸福！ 
      </td>
    </tr>
    </table></form>
</body>
</html> 
<%
end sub

sub upreg()
dim UserEmail,UserIM
if IsValidEmail(trim(request("UserEmail")))=false then
	errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
   	founderr=true
else
	if not isnull(SplitEmail) and SplitEmail<>"" and SplitEmail<>"0" then
		Dim SplitUserEmail
		SplitUserEmail=split(SplitEmail,"|")
		For i=0 to ubound(SplitUserEmail)
			if instr(request("UserEmail"),SplitUserEmail(i))>0 then
			errmsg=errmsg+"<br>"+"<li>您填写的Email地址含有系统禁止字符。"
   			founderr=true
			exit for
			end if
		Next
	end if
	UserEmail=checkStr((request("UserEmail")))
end if

	UserIM=checkreal(Request.form("homepage")) &"|||"& checkreal(Request.form("Oicq")) &"|||"& checkreal(Request.form("Icq")) &"|||"& checkreal(Request.form("msn")) &"|||"& checkreal(Request.form("yahoo")) &"|||"& checkreal(Request.form("aim")) &"|||"& checkreal(Request.form("uc"))

if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")
sql="Select UserIM,UserEmail from [Ms_User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
	errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
	founderr=true
	exit sub
else
	rs("UserIM")=UserIM
	rs("UserEmail")=UserEmail
	rs.Update
end if
rs.close
set rs=nothing
end sub

function checkreal(v)
dim w
if not isnull(v) then
	w=replace(v,"|||","§§§")
	checkreal=w
end if
end function
%>   