<!--#include file="Inc.asp"-->
<%
Dim UserName
If Not BBS94KK.FoundUser Then BBS94KK.GoToErr(10)

UserName=request.querystring("name")
If Trim(UserName)="" Then UserName=BBS94KK.MyName
If Not BBS94KK.Fun.CheckName(UserName) then BBS94KK.GoToErr(1)
If Lcase(UserName)=lCase(BBS94KK.MyName) Then
	BBS94KK.Position=BBS94KK.Position&" → <a href='UserInfo.asp'>用户控制面版<a>"
	BBS94KK.Head "查看本人资料" 
	Response.Write BBS94KK.ReadSkins("用户控制面版")
Else
	If SESSION(CacheName& "MyGradeInfo")(21)="0" Then BBS94KK.GoToErr(74)
	BBS94KK.Head "查看用户资料"
End If
ShowUserInfo()
ShowUserBBS()
BBS94KK.Footer()
Set BBS94KK=Nothing

Sub ShowUserInfo()
	Dim Caption,Content
	Dim Rs,Grade,UserPic,UserSex,RegIP,LastIP
	SET Rs=BBS94KK.Execute("Select Name,Sex,Birthday,Mail,Home,IsQQpic,QQ,Pic,Pich,Picw,RegIp,LastIp,EssayNum,GoodNum,Mark,GradeID,Coin,GameCoin,BankSave,RegTime,LastTime,IsShow,IsDel,IsVip,LoginNum,Honor,Sign,Faction From[KK_user]where Name='"&UserName&"' And Isdel=0")
	If Rs.eof then BBS94KK.GoToErr(79)
	If Rs("IsQQpic")="1" Then
		UserPic="<img src='http://qqshow-user.tencent.com/"&Rs("QQ")&"/10/'>"
	Else
		UserPic="<img src="&BBS94KK.Fun.GetSqlStr(Rs("pic"))&" width="&Rs("picw")&" height="&Rs("pich")&" >"
	End If
	IF Rs("Sex")=1 Then UserSex="男" Else UserSex="女"
	
	Grade=BBS94KK.GetGradeInfo(Rs("GradeID"))
	Grade=split(Grade,"|")

	IF SESSION(CacheName& "MyGradeInfo")(42)="1" Then
		RegIP=BBS94KK.Fun.GetSqlStr(Rs("RegIp"))
		LastIP=BBS94KK.Fun.GetSqlStr(Rs("LastIp"))
	Else 
		RegIP="保密":LastIP="保密"
	End If
	Caption="用户信息"
	Content="<div>"&_
	"<div style=""float:left;width:180px;text-align:center"">"&UserPIc&"<br /><a href='Sms.asp?Action=write&Name="&UserName&"'><img src='Images/Icon/sms.gif' border='0' /> 发送留言</a></div>"&_
	"<div style=""margin-left:180px"">"&_
	"<div style='float:left;width:50%;'><div style='margin:5px 0px;border:1px solid "&BBS94KK.SkinsPIC(0)&";'><div class=""title"">基本信息</div>"&_
	"<ul><li>昵称："&UserName&"</li><li>性别："&UserSex&"</li><li>生日："&Rs("Birthday")&"</li><li>邮箱：<script>mail('"&BBS94KK.Fun.GetSqlStr(Rs("Mail"))&"')</script></li><li> QQ："&BBS94KK.Fun.GetSqlStr(Rs("QQ"))&"</li><li>网站：<a href="&BBS94KK.Fun.GetSqlStr(Rs("Home"))&">我的网址</a></li><li>注册时间："&Rs("RegTime")&"</li><li>最后访问："&Rs("LastTime")&"</li><li>注册时IP："&RegIP&"</li><li>最后访问IP:"&LastIP&"</li></ul></div></div>"&_
	"<div style=""float:right;width:49%;""><div style='margin:5px 8px 5px 0px; border:1px solid "&BBS94KK.SkinsPIC(0)&";'><div class=""title"">论坛信息</div>"&_
	"<ul><li>论坛等级："&Grade(2)&"</li><li>头街称号："&BBS94KK.Fun.GetSqlStr(Rs("Honor"))&"</li><li>论坛帮派："&BBS94KK.Fun.GetSqlStr(Rs("Faction"))&"</li><li>发帖总数："&Rs("EssayNum")&"</li><li>精华帖数："&Rs("GoodNum")&"</li><li>"&BBS94KK.Info(120)&"："&Rs("Coin")&"</li><li>银行存款："&Rs("BankSave")&"</li><li>"&BBS94KK.Info(122)&"："&Rs("GameCoin")&"</li><li>"&BBS94KK.Info(121)&"："&Rs("Mark")&"</li><li>登陆次数："&Rs("LoginNum")&"次</li></ul></div></div></div></div>"
	Rs.Close
	BBS94KK.ShowTable Caption,Content
End Sub 

Sub ShowUserBBS()
	Dim Rs,I,SysInfo,ReplyInfo,NoShow
	NoShow=BBS94KK.NoShowTopic()
	Set Rs=BBS94KK.Execute("select Top 5 Face,BoardID,Caption,LastTime,TopicID,Name,SqlTableID from [KK_Topic] where Name<>'"&UserName&"' And IsDel=0 and TopicID in (Select ReplyTopicID from [KK_Bbs"&BBS94KK.TB&"] where name='"&UserName&"' And IsDel=0) order by LastTime desc")
	 Do While not Rs.Eof
		If InStr(","&NoShow&",",","&Rs("BoardID")&",")=0 or (lcase(UserName)=lcase(BBS94KK.MyName) or BBS94KK.MyAdmin=9) Then
			ReplyInfo=ReplyInfo& "<div><a target='_blank' href='Show.asp?boardId="&Rs("BoardID")&"&ID="&Rs("TopicID")&"&TB="&Rs("SqlTableID")&"'><img src='pic/face/"&Rs("Face")&".gif' align='absmiddle' border='0'>"&BBS94KK.Fun.StrLeft(Rs("Caption"),50)&"</a></div>"
		End If
		Rs.MoveNext
	 Loop
	Rs.Close
	ReplyInfo="<div style='text-align:left;margin-left:50%;'><div style=""padding:5px;BACKGROUND: "&BBS94KK.SkinsPIC(2)&";"" class='divth'><img src='Images/inn.gif' align='absmiddle'> <b>最近参与的主题</b></div>"&ReplyInfo&"</div>"
	Set Rs=BBS94KK.Execute("select Top 5 Face,BoardID,Caption,AddTime,TopicID,Name,SqlTableID from  [KK_Topic] where name='"&UserName&"' And IsDel=0 order by AddTime desc")
	 Do While not Rs.Eof
		If InStr(","&NoShow&",",","&Rs("BoardID")&",")=0 or (lcase(UserName)=lcase(BBS94KK.MyName) or BBS94KK.MyAdmin=9) Then
			SysInfo=SysInfo& "<div><a target='_blank' href='Show.asp?boardId="&Rs("BoardID")&"&ID="&Rs("TopicID")&"&TB="&Rs("SqlTableID")&"'><img src='pic/face/"&Rs("Face")&".gif' align='absmiddle' border='0'>"&BBS94KK.Fun.StrLeft(Rs("Caption"),50)&"</a></div>"
		End If
		Rs.MoveNext
	 Loop
	Rs.Close
	SysInfo="<div style='float:left;text-align:left;width:50%'><div style=""padding:5px;BACKGROUND: "&BBS94KK.SkinsPIC(2)&";"" ><img src='Images/inn.gif' align='absmiddle'> <b>最近发表的主题</b></div>"&SysInfo&"</div>"
	BBS94KK.ShowTable UserName&" 帖子信息",SysInfo&ReplyInfo&"<div style='clear:both'></div>"
End Sub
%>	