<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%Response.Buffer = true
stats="控制面板首页"
call nav()
if not founduser then
  	errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
	call head_var("","")
	call dvbbs_error()
else
	call head_var(membername & "的帐号","mycount.asp")
	call main()
	call activeonline()
end if
call footer()
sub main
	dim userclass,Faceinfo
	set rs=server.createobject("adodb.recordset")
	sql="select * from [Ms_User] where userid="&userid
	rs.open sql,conn,1,1
	userclass=rs("userclass")
%>
<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>
<%
response.write "<table cellpadding=3 cellspacing=1 align=center class=tableborder1>"&_
               "<tr align=center><td width=28% valign=top class=tablebody1>"&_
               "<table align=center style=""width:100%"" height=100% cellpadding=3 cellspacing=1 class=tableborder1>"&_
               "<tr><th height=25>用户头像</th></tr>"&_
               "<tr align=center><td class=tablebody1>"&_
               "<img src="""&ihtmlencode(rs("Userface"))&""" width="&Cint(Split(rs("Faceinfo"),"|||")(0))&" height="&Cint(Split(rs("Faceinfo"),"|||")(1))&" align=absmiddle >"&_
               "</td></tr>"&_
                "<tr><th height=25>基本信息</th></tr>"&_
               "<tr><td align=left class=tablebody1 valign=top>" 
if rs("Uservip")>1 then
response.write "用户属性： <font color=red><b>VIP会员</b></font><br>"
else
response.write "用户属性： <b>普通会员</b><br>"
end if
response.write "用户等级： "& rs("userclass") &"<br>"

response.write "用户财富： "&rs("userwealth")&"<br>"&_
               "用户经验： "&rs("userEP")&"<br>"&_
               "用户魅力： "&rs("userCP")&"<br>"&_
			   "用户体力： "&rs("UserPower")&"<br>"&_
               "文章总数： "&rs("UserArt")&"<br>"&_
			   "日记总数： "&rs("Userdiary")&"<br>"&_
			   "相册总数： "&rs("Userpics")&"<br>"&_
               "注册时间： "&rs("JoinDate")&"<br>"&_
               "登陆次数： "&rs("UserLogins")&"<br>"
        rs.close
        set rs=nothing
response.write"<br><a href=userdiary.asp>我的日记</a> | <a href=userphoto.asp>我的相册</a> | <a href=friendlist.asp>我的朋友</a> "
response.write"</td></tr></table><br>"
call friend()

response.write "</td>"&_
              "<td valign=top class=tablebody1>"&_
              "<table cellpadding=3 cellspacing=1 style=""width:100%"" height=29 align=center  class=tableborder1>"&_
              "<tr>"&_
              "<th height=25 align=left>-=> 交友中心短信息"&_
              "</td></tr><tr><td class=tablebody1>"
if newincept() >0 then
        response.write"目前您有<font color=red><b> ["&newincept()&"] </b></font>条的短消息。"
        else
        response.write"目前您没有新的短消息,"
        end if
response.write"<a href=usersms.asp?action=inbox><font color=red>收件箱</font></a>中共有 <b>["&cint(incept())&"]</b> 条信息，<a href='usersms.asp?action=issend'><font color=red>发件箱</font></a>中共有 <b>["&allsend()&"]</b> 条信息对方未查阅。<br>"&_
              "</td></tr></table><br>"&_
              "<table cellpadding=3 cellspacing=1 style=""width:100%"" align=center class=tableborder1>"&_
              "<tr>"&_
              "<th colspan=5 height=25 align=left>-=> 最新收到的短讯</th></tr>"&_
            "<tr>"&_
                "<td align=center valign=middle width=30 class=tabletitle2><b>状态</b></td>"&_
                "<td align=center valign=middle width=100 class=tabletitle2><b>发件人</b></td>"&_
                "<td align=center valign=middle width=*  class=tabletitle2><b>主题</b></td>"&_
                "<td align=center valign=middle width=120 class=tabletitle2><b>日期</b></td>"&_
                "<td align=center valign=middle width=60 class=tabletitle2><b>大小</b></td>"&_
            "</tr>"

	set rs=server.createobject("adodb.recordset")
	sql="select top 5 * from Ms_message where incept='"&trim(membername)&"' and issend=1 and delR=0 order by flag,sendtime desc"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then

response.write"<tr><td class=tablebody1 align=center valign=middle colspan=6>您的收件箱中没有任何内容。</td></tr>"
        else
		dim tablebody
do while not rs.eof
response.write "<tr>"
if rs("flag")=0 then
tablebody="tablebody2"
else
tablebody="tablebody1"
end if
response.write"<td align=center valign=middle class="&tablebody&">"

if rs("flag")=0 then
response.write"<img src=images/m_news.gif>"
else
response.write"<img src=images/m_olds.gif>"
end if
response.write"</td>"&_
              "<td align=center valign=middle class="&tablebody&">"
if rs("flag")=0 then
response.write"<b>"
end if
response.write"<a href=dispuser.asp?Username="&ihtmlencode(rs("sender"))&" target=_blank>"&ihtmlencode(rs("sender"))&"</a></td>"&_
              "<td align=left class="&tablebody&"><a href=usersms.asp?action=read&id="&rs("id")&"&sender="&rs("sender")&" >"
if rs("flag")=0 then
response.write"<b>"
end if
response.write""&ihtmlencode(rs("title"))&"</a></td>"&_
               "<td class="&tablebody&">"
if rs("flag")=0 then
response.write"<b>"
end if
response.write""&rs("sendtime")&"</font></td>"&_
               "<td class="&tablebody&">"
if rs("flag")=0 then
response.write"<b>"
end if
response.write""&len(rs("content"))&"Byte</td></tr>"

	rs.movenext
	loop
	end if
	rs.close
	set rs=nothing
    response.write"</td></tr></table><br>"
	
	dim FTypename
'---------------------
response.write"<table cellpadding=3 cellspacing=1 style=""width:100%"" align=center class=tableborder1>"&_
						"<tr>"&_
						"<th colspan=5 height=25 align=left>-=> 最新上传相册</th></tr>"&_
						"<tr>"&_
						 "<td align=center valign=middle width=30 class=tabletitle2><b>属性</b></td>"&_
						 "<td align=center valign=middle width=80 class=tabletitle2><b>大小</b></td>"&_
						 "<td align=center valign=middle width=* class=tabletitle2><b>文件</b></td>"&_
						 "<td align=center valign=middle width=120 class=tabletitle2><b>日期</b></td>"&_
						"<td align=center valign=middle width=60 class=tabletitle2><b>类型</b></td>"&_
						"</tr>"
'---------------------
set rs=conn.execute("select top 5 * from [Ms_Upphoto] where Username='"&trim(membername)&"' order by FID desc ")
if rs.eof and rs.bof then
		response.write"<tr><td class=tablebody1 align=center valign=middle colspan=5>您的相册中没有任何内容。</td></tr>"
else
		do while not rs.eof
Select Case rs("FTypes")
	Case 1
		FTypename="本人风采"
	case 2
		FTypename="我的爱人"
	Case 3
		FTypename="我的亲人"
	Case 4
		FTypename="我的朋友"
	Case 5
		FTypename="我的宠物"	
	case else
		FTypename="其它照片"
End Select
'---------------------
response.write		"<tr>"&_
							"<td align=center valign=middle  class=tablebody1><img src='images/files/"&rs("FileTypes")&".gif' border=0></td>"&_
							"<td align=left valign=middle  class=tablebody1>"&rs("FileSize")&" Byte</td>"&_
							 "<td align=left valign=middle  class=tablebody1><a href=""showpic.asp?Fid="&rs("Fid")&""" target=_blank Title=点击查看图片>"&rs("Filename")&"</a></td>"&_
							"<td align=left valign=middle  class=tablebody1>"&rs("AddTime")&"</td>"&_
							"<td align=center valign=middle  class=tablebody1><b>"&FTypename&"</b></td>"&_
							"</tr>"
'---------------------
rs.movenext
loop
end if
rs.close
set rs=nothing
response.write		"</table><br>"

response.write"<table cellpadding=3 cellspacing=1 style=""width:100%"" align=center class=tableborder1>"&_
						"<tr>"&_
						"<th colspan=5 height=25 align=left>-=> 我的日记</th></tr>"&_
						"<tr>"&_
						 "<td align=center valign=middle width=30 class=tabletitle2><b>状态</b></td>"&_
						 "<td align=center valign=middle width=30 class=tabletitle2><b>心情</b></td>"&_
						 "<td align=center valign=middle width=* class=tabletitle2><b>日记标题</b></td>"&_
						 "<td align=center valign=middle width=120 class=tabletitle2><b>日期</b></td>"&_
						"<td align=center valign=middle width=60 class=tabletitle2><b>人气</b></td></tr>"
'---------------------
set rs=conn.execute("select top 5  Did,Title,Topic,Ispublic,Hits,AddTime from [Ms_diary] where Username='"&trim(membername)&"' order by DID desc ")
if rs.eof and rs.bof then
		response.write"<tr><td class=tablebody1 align=center valign=middle colspan=5>您的日记库中没有任何内容。</td></tr>"
else
		do while not rs.eof
response.write		"<tr>"&_
							"<td align=center valign=middle  class=tablebody1>"
							if rs("Ispublic")=1 then
							response.Write("私人")
							else
							response.Write("公开")
							end if
response.write					"<td align=center valign=middle  class=tablebody1><img src="&rs("Topic")&" border=0></td>"&_
							 "<td align=left valign=middle  class=tablebody1><a href=""diaryview.asp"" >"&rs("Title")&"</a></td>"&_
							"<td align=left valign=middle  class=tablebody1>"&rs("AddTime")&"</td>"&_
							"<td align=center valign=middle  class=tablebody1><b>"&rs("hits")&"</b></td>"&_
							"</tr>"
rs.movenext
loop
end if
rs.close
set rs=nothing
response.write		"</table><br></td></tr></table>"
end sub

sub friend()
dim frs,srs,OnlineTime
response.write"<table align=center style=""width:100%"" height=100% cellspacing=1 cellpadding=6 class=tableborder1>"&_
						"<tr><th height=25>好友在线</th></tr>"&_
						"<tr align=center><td class=tablebody1 align=left>"

set frs=conn.execute("select friend from Ms_Friend where Myhack=0 and username='"&trim(membername)&"' order by Fid desc")
if frs.eof and frs.bof then
		response.write"快添加您的好友吧！"
else
		do while not frs.eof
	if Supermaster or master then
	set Srs=conn.execute("select startime from Ms_online where username='"&frs(0)&"' ")
	else
	set Srs=conn.execute("select startime from Ms_online where username='"&frs(0)&"' and userhidden=2")
	end if
	if Srs.eof and Srs.bof then
	OnlineTime="[离线]"
	else
	OnlineTime="[<font color=red>在线：" & datediff("n",Srs(0),Now()) & "Mins</font>]"
	end if
	Srs.close
	set Srs=nothing
	response.write"<a href=""javascript:openScript('messanger.asp?action=new&touser="&htmlencode(frs(0))&"',500,400)"" ><img src=images/m_issend_1.gif alt='给好友发送短讯' border=0 align=""absmiddle""></a>"
		response.write"&nbsp;<a href=dispuser.asp?Username="&htmlencode(frs(0))&" >"
		response.write	  frs(0)&"</a> "&OnlineTime&" <br>"

		frs.movenext
		loop
end if
frs.close
set frs=nothing
response.write"</td></tr>"&_
						"<tr><td height=25 class=tablebody2>＊点击图标给好友发送短讯！</td></tr>"&_
						"</table>"
end sub

REM 统计已发出新短信
function allsend()
        rs=conn.execute("Select Count(id) From Ms_Message Where flag=0 and issend=1 And sender='"& trim(membername) &"'")
        allsend=rs(0)
	set rs=nothing
	if isnull(allsend) then allsend=0
end function
REM 统计收件箱中的短信
function incept()
        incept=0
        rs=conn.execute("Select Count(id) From Ms_Message Where issend=1 and delR=0 And incept='"& trim(membername) &"'")
        incept=rs(0)
	set rs=nothing
	if isnull(incept) then incept=0
end function
%>