<!--#include file="conn.asp"-->
<!--#include file="NF_Visual_cnntop.asp"-->
<!--#include file="inc/const.asp" -->
<!--#include file="NF_Visual_const.asp"-->
<!--#include file="inc/chkinput.asp"-->
<!--#include file="inc/md5.asp"-->
<%
dim pid,curpage,act,app,uid,pas,pmyname,lst,content
dim prs,PageCount,curcount
dim getmoney,mymoney
Dvbbs.LoadTemplates("")
ConnectionDatabase()
getmoney=dvbbs.GroupSetting(47)
dim rsm,sqlm
set rsm=server.createobject("adodb.recordset")
set rsm=conn.execute("select userWealth from [dv_user] where UserID="&trim(dvbbs.userid))
if rsm.eof or rsm.bof then
	mymoney=0
else
	mymoney=trim(rsm("userWealth"))
end if
rsm.close
set rsm=nothing 
if dvbbs.userid=0  then
	Dvbbs.AddErrCode "您还没有<a href=login.asp>登录社区</a>，不能使用个人形象合影功能。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！"
end if

act=Dvbbs.CheckStr(request("act")) '提交的类型0为申请合影1为同意合影2观看照片
app=Dvbbs.CheckStr(request("app")) '提交的类型0为申请合影1为同意合影
lst=Dvbbs.CheckStr(request("lst")) '影集的类别
pas=Dvbbs.CheckStr(request("pas")) '密码
pid=Dvbbs.CheckStr(request("pid")) '合影的id
uid=Dvbbs.CheckStr(request("uid")) '用户id
curPage=request("page") '页数

if not isInteger(pid) then pid=""
if not isInteger(lst) then lst=""
if not isInteger(uid) then uid=""
if act="" or not isInteger(act) then act=3
if not isInteger(app) then app=""

if uid<>"" then uid=clng(uid)
if act<>"" then act=clng(act)
if app<>"" then app=clng(app)
if pid<>"" then pid=clng(pid)
if lst<>"" then lst=clng(lst)

if curpage="" or not isInteger(curpage) then
	curpage=1
else
	curpage=clng(curpage)
end if
if uid="" then
	uid=dvbbs.userid
	pmyname=dvbbs.membername
	else
	pmyname=getmyname(uid)
end if
dvbbs.stats="个人形象大赛"
if Dvbbs.ErrCodes<> "" then
	dvbbs.nav()
    dvbbs.head_var 2,0,"",""
	showErr()
else
	select case act
	case 6 '一张照片
		dvbbs.stats="浏览照片"
		dvbbs.nav()
		call photomain()
		call photoone(pid,pas)
	case 5 '推荐删除
		dvbbs.stats="相片管理"
		dvbbs.nav()
		call photomain()
		call photodel(pid,lst)
	case 4 'vote照片投票
		dvbbs.stats="形象投票"
		dvbbs.nav()
		call photomain()
		call photovote()
	case 3 'top20虚拟形象大赛
		dvbbs.stats="形象大赛"
		dvbbs.nav()
		call photomain()
		call phototop()
	case 2 '观看，需要调用合影id，密码
		dvbbs.stats="浏览形象"
		call photomain()
		call photosee(pid,pas)
	case 1 '同意拒绝
		dvbbs.stats="合影操作"
		dvbbs.nav()
		call photomain()
		call photoapp(uid,act,app,pid)
	case 0 '申请完成
		dvbbs.stats="参加大赛"
		dvbbs.nav()
		call photomain()
		if app="3"  then
			call photosubgo(uid,app,lst)
		elseif app="2" then
			call photosubok(uid,act,app,pid)
		else
			call photosub()
		end if
	case else '我的相册
		dvbbs.stats="我的相册"
		dvbbs.nav()
		call photomain()
		call photolist(lst)
	end select
	response.write "                       </td>" & vbCrLf
	response.write "			</tr>" & vbCrLf
	response.write "			</table>"
end if
Dvbbs.ActiveOnline()
Dvbbs.Footer()


sub photomain()
dvbbs.head_var 0,0,"形象大赛","NF_visual_top.asp"

'数码修改-增加脚部皮肤
'数码修改-增加脚部皮肤结束

response.write "<table cellpadding=3 cellspacing=1 align=center class=tableborder1>" & vbCrLf
response.write "<tr>" & vbCrLf
'response.write "	<td align=center valign=top class=tablebody2 width=160>"
'response.write "                        <table border=0 cellspacing=1 cellpadding=0 width=140 class=tablebody2>"			
'response.write "                        <tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=9&uid="&uid&"&lst=>"&pmyname&"的相册</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=9&uid="&uid&"&lst=1>写真集</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=9&uid="&uid&"&lst=0>家庭集</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=9&uid="&uid&"&lst=3>朋友集</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=0&app=3&lst=2 title=点击此处快速写真>我要写真</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=0>发起邀请</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			<tr height=25 valign=middle>" & vbCrLf
'response.write "			<td class=tablebody1>&nbsp;<a href=NF_visual_top.asp?act=3>形象大赛</a></td>" & vbCrLf
'response.write "			</tr>" & vbCrLf
'response.write "			</table>" & vbCrLf
'response.write "			</td>" & vbCrLf
response.write "			<td align=center valign=top class=tablebody1 width=""95%"">"
end sub

sub photoone(vpid,vpas)'我的照片
dim myname
dim mypid,mypas
if lst="" then lst="0"
if uid=""  then 
	uid=dvbbs.userid
        myname="我"
        else
myname=getmyname(uid)
end if
%>
<a name=visualtop>
<table border=0 cellspacing=1 cellpadding=0 width=95%>
<tr height=25 valign=middle>
<th valign=middle>
<%=myname%>推荐给你的照片</th></tr>

 
<%
        set prs=server.createobject("ADODB.Recordset")
		sql="select id,book,date,cou from [Visual_photo3] where pok=1 and id="&vpid
		set prs=conntop.execute(sql)
		if prs.eof and prs.bof then
		response.write "<br>暂时还没有任何用户数据</td>"
        else
        mypid=prs("id")
		%>
		
		<tr><td class=tablebody1 width=45%>
		<table width=100% border=0 cellspacing=1 cellpadding=0>
		<tr><td align=center>
		<%
		call photosee(mypid,vpas)
		%>					
		</td></tr>
		<tr><td class=tablebody2>
		<%
		response.write "&nbsp;&nbsp;<a href=""NF_visual_top.asp?act=4&lst=1&pid="&mypid&"&uid=""&dvbbs.userid&"" title=""欣赏这个形象，投他一票，将消耗您"&dvbbs.GroupSetting(47)&"点金钱""><img src=skins/default/xianhua.gif border=0>投一票</a>&nbsp;&nbsp;(共：<font color=blue>"&prs("cou")&"</font>票)"
		%>
		</td></tr>
		
		</table>
                </td></tr></table></td>
                <%
end if
prs.close
set prs=nothing
end sub

sub photodel(vpid,vlst)'照片管理
dim phtname,myid1,myid2
select case vlst
case "1" '推荐
	phtname=Dvbbs.CheckStr(request("phtname"))
	if phtname="" or getmyid(phtname)="" then
   	   response.write"<br>"+"<li>推荐给对方来看，总要写正确名字吧^_^"
	   exit sub
	end if
	content=phtname&"，您好："&chr(10)
        content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]参加了个人形象大赛，[/b][color=red]叫你去投他一票；[/color]"&chr(10)	
	content=content & "[align=center][b][u][URL=NF_visual_top.asp?act=6&pas="&pas&"&pid="&vpid&"&uid="&uid&"]请点击这里前去观看[/URL][/u][/b][/align]"
        call messto(phtname,"个人形象","请投我一票！",content)
        response.write"<br>"+"<li>已经短信通知对方来看喽^_^"
        call photosee(pid,pas)
case "0" '删除
        if uid="" or uid<>Dvbbs.UserID or getmyname(uid)="" then
	response.write"<br>"+"<li>出现错误，请从新登陆^_^"
	exit sub
	end if
	
        set prs=server.createobject("adodb.recordset")
        sql="select myid from [Visual_photo3] where id="&vpid
        set prs=conntop.execute(sql)
        if prs.eof or prs.bof then
        response.write"<Br>"+"<li>未找到你要管理的照片。"
        prs.close
        set prs=nothing
   	exit sub
	else
	myid1=prs("myid")
	myid2=split(myid1,"|")
	end if
        
        if myid2(0)=cstr(dvbbs.userid) or dvbbs.master then
        conntop.execute("Delete FROM Visual_photo3 WHERE id="&vpid&"")
        response.write"<Br>"+"<li>成功删除照片。"
        else
        response.write"<Br>"+"<li>您不是照片的拥有者，不能删除照片。"
   	exit sub
        end if
	end select
set prs=nothing
end sub

sub photovote()'照片投票
dim mycou,myid1,myid,mylb,toprs,sqltop
set prs=server.createobject("ADODB.Recordset")
set toprs=server.createobject("ADODB.Recordset")
sql="select * from [Visual_photo_vv] where uid="&dvbbs.userid&" and pid="&pid
set prs=conntop.execute(sql)
if not(prs.eof or prs.bof) then
response.write "<br>"+"<li>此相片您已经投票。"
	exit sub
end if	
sql="select myid,cou,lb from [Visual_photo3] where pok=1 and vopen=0 and id="&pid
set prs=conntop.execute(sql)
if prs.eof or prs.bof then
	response.write "<br>"+"<li>暂时不能给此照片投票，或者合影尚未完成。"
	prs.close
        set prs=nothing
	exit sub
	else
	mycou=prs("cou")
	myid=prs("myid")
	myid1=split(myid,"|")
	mylb=prs("lb")
	
	if myid1(0)=cstr(dvbbs.userid) or myid1(1)=cstr(dvbbs.userid) or myid1(2)=cstr(dvbbs.userid) then
			Dvbbs.AddErrCode "您不能给自己的照片或合影投票。"
    end if
	if Dvbbs.ErrCodes<>"" then
		showErr()
		exit sub
    end if
	getmoney=Cint(dvbbs.GroupSetting(47))
	if mymoney<getmoney then
	response.write "<br>"+"<li>您没有足够的钱发表意见。"
	exit sub
	end if
	if lst<>0 then'鲜花
	mycou=mycou+1
	else
	mycou=mycou-1
	end if
	
end if
prs.close
set prs=nothing
conntop.execute("update [Visual_photo3] set cou='"&mycou&"' WHERE id="&pid&"")
conn.execute("update [dv_user] set userWealth=userWealth-"&getmoney&" where userid="&dvbbs.userid)
conntop.execute("insert into Visual_photo_vv(uid,pid) values("&dvbbs.userid&","&pid&")")
response.write "恭喜，投票成功!<br><br>" & vbCrLf
call photosee(pid,"")
end sub

sub phototop()'top20虚拟形象大赛
dim totalrec,mypid,srs
%>
<a name=visualtop>
<table border=0 cellspacing=1 cellpadding=0 width=100%>
<tr height=25 valign=middle>
<th valign=middle id="TableTitleLink">
[<a href=NF_visual_top.asp>社区形象秀TOP20排名</a>]&nbsp;&nbsp;&nbsp;[<a href=NF_visual_top.asp?act=3&lst=1>最新加入</a>]&nbsp;&nbsp;&nbsp;[<a href=NF_visual_topten.asp>得票排列</a>]
</th></tr>
<th valign=middle>
<%
set srs=server.createobject("ADODB.Recordset")
			select case lst
			case "3" 'top20虚拟形象大赛
                      
                        sql="select top 20 id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 and lb=3 order by cou desc"			        
			case "2" 'top20虚拟形象大赛
			
                        sql="select top 20 id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 and lb=2 order by cou desc"			        
			case "1" 'top20虚拟形象大赛
			%>  最新加入  <%
			           sql="select id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 order by id desc"
                        'sql="select top 20 id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 and lb=1 order by cou desc"				
			case "0" 'top20虚拟形象大赛
			             

                        sql="select top 20 id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 and lb=0 order by cou desc"			        
			case else '全部照片列表
			%>  社区形象秀TOP20排名  <%
                        sql="select top 20 id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 and lb=1 order by cou desc"
                        'sql="select id,book,date,cou from [Visual_photo3] where pok=1 and vopen=0 order by id desc"
			end select
			srs.open sql,conntop,1,1
			if srs.eof and srs.bof then
		   response.write "<br>暂时还没有任何用户数据</td>"
			else
			%></th><tr><td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr valign=middle>
			<% 
					totalrec=srs.recordcount
								if totalrec mod 12=0 then
				pagecount=totalrec \ 12
			else
				pagecount=totalrec \ 12+1
			end if
			curcount=0
			dim iic
			iic=0
			if curpage > pagecount then curpage = pagecount
				if curpage < 1 then curpage=1
				srs.PageSize=12
				srs.AbsolutePage=CurPage
			do while not srs.eof and curcount<12
			mypid=srs("id")
			%>
			<td class=tablebody1 width=33%>
			<table width=200 border=0 cellspacing=1 cellpadding=0 ><tr><td align=center>
			<%call photosee(mypid,"")%>					
			</td>
			</tr>
			<tr><td class=tablebody2>
			<%
			response.write "&nbsp;&nbsp;<a href=""NF_visual_top.asp?act=4&lst=1&pid="&mypid&"&uid=""&dvbbs.userid&"" title=""欣赏这个形象，投他一票，将消耗您"&dvbbs.GroupSetting(47)&"点金钱""><img src=skins/default/xianhua.gif border=0>投一票</a>&nbsp;&nbsp;(共：<font color=blue>"&srs("cou")&"</font>票)"
			if dvbbs.master then
			response.write "&nbsp;&nbsp;<a href=""NF_visual_top.asp?act=5&lst=0&pid="&mypid&"&uid=""&dvbbs.userid&"" title=""删除这副合影"">删除</a>"
			end if
			%>
			</td></tr>
			
			<form action="NF_visual_top.asp?act=5&pid=<%=mypid%>&lst=1&uid=<%=dvbbs.userid%>&pas=" name="subsee" method=post>
			<tr><td class=tablebody2>
			<INPUT name=phtname type=text size="8"> &nbsp;<input type=submit name=submit value="推荐给朋友">
			</td></tr>
			</form>
			</table></td>
			<%
			curcount=curcount+1
			iic=iic+1
			if iic mod 3=0 then
			iic=0%>
			<tr valign=middle>
			<%end if
			srs.movenext
			loop
			
			%>
			</tr></table></td>
			<%		
			end if
			%>
			</tr><tr><td width=100%>
			<table width=100% border=0 cellspacing=0 cellpadding=0>
					<tr height=25 valign=middle>
						<td valign=middle class=tablebody1>&nbsp;&nbsp;页次：<b><%=curPage%></b> / <b><%=pagecount%></b> 页 每页：<b>10</b> 共计：<b><%=totalrec%></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=NF_visual_top.asp?act=0&app=3&lst=2><b></font color=red>我要参赛</font></b></a></td>
						<td valign=middle class=tablebody1><div align=right>分页：<%
							call DispPageNum(curpage,pagecount,"?act=3&lst="&lst&"&page=","#VisualTop")
						%>&nbsp;&nbsp;</td>
					</tr>
			</table>
			</td></tr></table></td>
		
			<%
srs.close
set srs=nothing
end sub

sub photosee(pid,pas) '观看，需要调用合影id，密码
dim myid,myv,myc,mybake,myopen,mypass,mylb,mybook,mydate
dim myid_n,myv_n,myc_n,pwidth,myname1,myname2,myname3,mysex1,mysex2,mysex3
dim trs
set trs=server.createobject("ADODB.Recordset")
sql="select * from [Visual_photo3] where pok=1 and id="&pid
set trs=conntop.execute(sql)
if trs.eof or trs.bof then
	response.write"<br>"+"<li>暂时没有您想看的照片，或者合影尚未完成。"
	trs.close
        set trs=nothing
	exit sub
else
        myid=trs("myid")
        myv=trs("myv")
        myc=trs("myc")
        mybake=trs("bake")
        myopen=trs("vopen")
        mypass=trs("pass")
        mylb=trs("lb")
        mybook=trs("book")
        mydate=trs("date")
        if mybake="" or isnull(mybake) then
	pwidth=140
	mybake=""
	else
	pwidth=280
        end if
end if
trs.close        
set trs=nothing 
	myid_n=split(myid,"|")
	myv_n=split(myv,"§")
	myc_n=split(myc,"|")
	dim passok
	if myopen=0 then '相片需要密码
	if myid_n(0)=cstr(dvbbs.userid) or myid_n(1)=cstr(dvbbs.userid) or myid_n(1)=cstr(dvbbs.userid) or dvbbs.master then '照片的主人可以不需要密码
	passok=true
	else
	if pas<>mypass then
		passok=false
		else
		passok=true
	end if
        end if
        end if
        if passok=false then '相册保密需要正确的密码
	response.write"<br>"+"<li>照片保密</a>，暂时不能观看。"
        exit sub
        end if

        myname1=getmyname(myid_n(0))
	myname2=getmyname(myid_n(1))
	myname3=getmyname(myid_n(2))
	mysex1=getmysex(myid_n(0))
	mysex2=getmysex(myid_n(1))
	mysex3=getmysex(myid_n(2))
	call photolook(mylb,pwidth,mybake,myname1,myname2,myname3,mysex1,mysex2,mysex3,myv_n(0),myv_n(1),myv_n(2),myc_n(0),myc_n(1),myc_n(2),mydate)		

end sub

sub photoapp(uid,act,app,pid)'同意拒绝
dim myid1,myapp,myid2,mylb
if app<>"" and pid<>"" and uid<>"" then'同意或者拒绝合影
	if uid="" or uid<>Dvbbs.UserID or getmyname(uid)="" then
	response.write"<br>"+"<li>出现错误，请从新登陆^_^"
	exit sub
	end if
        set prs=server.createobject("adodb.recordset")
        sql="select myid,app,lb from [Visual_photo3] where pok=0 and id="&pid
        set prs=conntop.execute(sql)
        if prs.eof or prs.bof then
        response.write"<Br>"+"<li>此邀请合影已经有人拒绝或者已经完成。"
   	prs.close        
        set prs=nothing 
        exit sub
	else
	myid1=prs("myid")
	myapp=prs("app")
	myid2=split(myid1,"|")
	mylb=prs("lb")
	if myapp=mylb then
	response.write"<Br>"+"<li>您已经同意合影了，不要再点击。"
   	prs.close        
        set prs=nothing 
        exit sub
	end if
        end if
        dim appok
                        select case mylb
                        case 3 '
                        if myid2(1)=cstr(dvbbs.userid) or myid2(2)=cstr(dvbbs.userid) then
                        appok=true
                        end if
			case 2,0 '
			if myid2(1)=cstr(dvbbs.userid) then
                        appok=true
                        end if
			end select
        
        if appok=true then
        
        if app<>1 then'拒绝
        conntop.execute("Delete FROM Visual_photo3 WHERE id="&pid&"")
        content=getmyname(myid2(0))&"，您好："&chr(10)
        content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]拒绝[/b]与您合影[color=red]本次合影取消[/color]"	
        call messto(getmyname(myid2(0)),"虚拟相册","拒绝合影",content)
        else '接受
        conntop.execute("update Visual_photo3 set app=app+1 WHERE id="&pid&"")
	if mylb=myapp+1 then
	content=getmyname(myid2(0))&"，您好："&chr(10)
        content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]同意[/b]与您合影[color=red]本次合影邀请已经全部同意；[/color]"&chr(10)	
	content=content & "[align=center][URL=NF_visual_top.asp?act=0&app=2&uid="&myid2(0)&"&pid="&pid&"][color=blue][b][u]请点击这里完成合影[/u][/b][/color][/URL][/align]"
        call messto(getmyname(myid2(0)),"虚拟相册","请完成合影",content)
        else
        content=getmyname(myid2(0))&"，您好："&chr(10)
        content=content & "您的朋友[color=blue]"&dvbbs.membername&"已经[/color][b]同意[/b]与您合影！"	
        call messto(getmyname(myid2(0)),"虚拟相册","同意合影",content)
        end if
        end if
        
        else	
                response.write"<Br>"+"<li>您不是被邀请的，无权操作。"
   	        exit sub
        end if
        response.write "恭喜，操作成功" & vbCrLf
end if
prs.close
set prs=nothing
end sub

sub photosub()'申请
%>
<br>
<table cellpadding=2 cellspacing=0 align=center width=90%>
<tr align=center>
<th width="100%" height=25 colspan=2>邀请合影</th>
</tr>
<tr>
<td width="100%" class=tablebody1 colspan=2>
<b>帮助：</b><br><br>
<li>正确填写需要合影的对方名字。
<li>三人合影必须选择背景。
<li>双人以及夫妻合影可选择背景，不选择，照片以申请人的背景为准。
</td></tr>

<form action="NF_visual_top.asp?act=0&app=3&lst=1&uid=<%=dvbbs.userid%>" name="subpht" method=post onsubmit='return(logi());'>
    <tr>
    <th valign=middle colspan=2 align=center height=25>请输入邀请合影的网友名字</td></tr>
    <tr>
    <td valign=middle class=tablebody1>请输入邀请对象名字</td>
    <td valign=middle class=tablebody1><INPUT name=phtname type=text size="20"> &nbsp; 以|间隔，如TonyHe|天羽|Test</td></tr>
    <td class=tablebody1 valign=top width=30% ><b>合影选项</b><BR> 请选择合影类型。</td>
    <td valign=middle class=tablebody1>
                <input type=radio name=phtlb value=0 checked>夫妻纪念<br>
                <input type=radio name=phtlb value=2>双人合影<br>
                <input type=radio name=phtlb value=3>三人合影<br>                </td></tr>
    <tr>
    <td valign=top width=30% class=tablebody1><b>是否保密</b><BR> 您可以选择保密，如果选择保密，则合影需要你邀请或者告知对方密码才可以浏览。</td>
    <td valign=middle class=tablebody1>                
                <input type=radio name=phtbm value=2 checked>开放浏览<br>
                <input type=radio name=phtbm value=1>私家珍藏<br>
                </td></tr>
    <tr>
    <td valign=middle class=tablebody1>请输入您的密码</font></td>
    <td valign=middle class=tablebody1>
    <INPUT name=phtpass type=password size="20"> &nbsp; 如果您选择保密私家珍藏，请输入密码</td></tr>
    <tr>
    <td valign=middle class=tablebody1>请输入您的留言</font></td>
    <td valign=middle class=tablebody1><TEXTAREA name=phtContent cols=80 rows=3 wrap=VIRTUAL title=请输入合影理由或者说明></TEXTAREA> &nbsp; </td></tr>
    <tr>
    <tr>
    <td valign=middle class=tablebody1>选择背景图像<br>
    <script language="javascript">
<!--
function showimage()
{
	document.images.useravatars.src = document.subpht.phtbake.options[document.subpht.phtbake.selectedIndex].value;
}

function logi()
{
if(subpht.phtname.value==""){alert("用户名不能为空!");return false;}
if(subpht.phtContent.value==""){alert("必须填写邀请理由或者说明!");return false;}
if(subpht.phtbm.checked){
if(subpht.phtpass.value==""){alert("密码不能为空!");return false;}
}
if(subpht.phtlb.checked){
if(subpht.phtbake.value==""){alert("三人合影必须选择背景!");return false;}
}
}
//-->
    </script>
<select name="phtbake" size="1" onChange="showimage()">
<option value="" selected>不需要背景</option>
<option value="images/img_visual/show/1757.gif">1757</option>
<option value="images/img_visual/show/1758.gif">1758</option>
<option value="images/img_visual/show/1759.gif">1759</option>
<option value="images/img_visual/show/1762.gif">1762</option>
<option value="images/img_visual/show/1783.gif">1783</option>
<option value="images/img_visual/show/1784.gif">1784</option>
<option value="images/img_visual/show/1785.gif">1785</option>
<option value="images/img_visual/show/1787.gif">1787</option>
</select>
</font></td>
    <td valign=middle class=tablebody1>
    <IMG src="" border=0 width=52 height=0><img src="images/img_visual/show/blank.gif" align="absmiddle" name="useravatars" border=0>
    </td></tr>
    <tr>
    <tr>
    <td class=tablebody2 valign=middle colspan=2 align=center><input type=submit name=submit value="发送合影邀请"></td></tr>
</form>
</table>
<%
end sub

sub photosubgo(uid,app,lst)'申请
dim phtname,phtlb,phtbm,phtpass,phtContent,phtbake,phtname_n
dim getid1,getid2,myname1,myname2
if uid="" or getmyname(uid)="" or dvbbs.userid<>uid then
	response.write"<br>"+"<li>出现错误，请从新邀请^_^"
	exit sub
end if
if getmyv(uid)="" then
	response.write"<Br>"+"<li>您还没有设计虚拟形象，怎么好意思赤裸参赛^_^"
   	exit sub
end if
select case lst
case 1 '申请完成
    phtname=Dvbbs.CheckStr(request("phtname")) 
   	phtlb=Dvbbs.CheckStr(request("phtlb")) 
   	phtbm=Dvbbs.CheckStr(request("phtbm")) 
   	phtpass=Dvbbs.CheckStr(request("phtpass")) 
   	phtContent=Dvbbs.CheckStr(request("phtContent")) 
   	phtbake=Dvbbs.CheckStr(request("phtbake"))
   	if isnull(phtlb) or not isInteger(phtlb) then phtlb=""
	if isnull(phtbm) or not isInteger(phtbm) then phtbm=""
	if Dvbbs.ChkPost()=false or phtlb="" or phtbm="" then
		Dvbbs.AddErrCode "数据提交错误，请返回从新提交！"
	end if
	if phtname="" then
		response.write"<br>"+"<li>邀请合影用户名不能为空^_^"
		exit sub
	end if
	if phtbm=1 and phtpass="" then
		response.write"<br>"+"<li>选择保密，则必须填写密码^_^"
		exit sub
	end if
	select case phtlb
	case 3 '
		if phtbake="" then
			response.write"<br>"+"<li>三人合影必须选择背景^_^"
			exit sub
		end if 
		phtname_n=split(phtname,"|")
		getid1=getmyid(phtname_n(0))
		getid2=getmyid(phtname_n(1))
		myname1=phtname_n(0)
		myname2=phtname_n(1)
		if myname1="" or myname2="" or getid1="" or getid2="" then
			response.write"<br>"+"<li>三人合影请正确填写要邀请的名字，名字以|间隔^_^"
			exit sub
		end if
		if getmyv(getid1)="" or getmyv(getid2)="" then
			response.write"<Br>"+"<li>您邀请的朋友还没有设计虚拟形象，怎么好意思赤裸参赛^_^"
			exit sub
		end if
		if getid1=dvbbs.userid or getid2=dvbbs.userid then
			response.write"<Br>"+"<li>和自己合影？分身有术啊^_^"
			exit sub
		end if	
	case 0,2 '
		myname1=phtname
		myname2=""
		if phtlb=0 and not getmyw(phtname,Dvbbs.UserID) then
			response.write"<Br>"+"<li>不是你亲爱的，怎么可以邀请家庭夫妻合影呢^_^"
			exit sub
		end if
		getid1=getmyid(phtname)
		getid2=""
		if getid1="" then
			response.write"<Br>"+"<li>请正确填写要邀请的名字"
			exit sub
		end if	
		if getmyv(getid1)="" then
			response.write"<Br>"+"<li>您邀请的朋友还没有虚拟形象，怎么好意思赤裸参赛^_^"
			exit sub
		end if
		if getid1=dvbbs.userid  then
			response.write"<Br>"+"<li>和自己合影？分身有术啊^_^"
			exit sub
		end if	       
	end select
	if phtContent="" or strLength(phtContent)>50 or strLength(phtContent)<8 then
		response.write"<br>"+"<li>邀请合影的理由不能多于50个字或者不能少于8个字^_^"
		exit sub
	end if
	if Dvbbs.ChkPost()=false then
		response.write"<br>"+"<li>数据提交错误，请返回从新提交！"
	end if
	set prs=server.createobject("ADODB.Recordset")
	sql="select * from [Visual_photo3]"	
	prs.open sql,conntop,1,3
	prs.addnew
	prs("myid")=uid&"|"&getid1&"|"&getid2
	prs("myv")=getmyv(uid)&"§"&getmyv(getid1)&"§"&getmyv(getid2)
	prs("myc")=getmyc(uid)&"|"&getmyc(getid1)&"|"&getmyc(getid2)
	prs("bake")=phtbake
	if phtbm<>1 then
		phtbm=0
		prs("pass")=""
	else
		phtbm=1
		prs("pass")=md5(phtpass)
	end if
	prs("vopen")=phtbm
	prs("lb")=phtlb
	if phtlb=0 then
		prs("app")=-1
	else
		prs("app")=1
    end if
	prs("book")=phtContent
	prs.update
	prs.close
	set prs=nothing
	set prs=conntop.execute("select top 1 id from [Visual_photo3] order by id desc")
	pid=prs(0)
	if phtlb<>3 then
		content=myname1&"，您好："&chr(10)
		content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]邀请[/b]与您合影[color=red]邀请留言是：[/color]"&chr(10)
		content=content & phtContent &chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=1&uid="&getid1&"&pid="&pid&"][color=blue][b][u]点击这里同意合影[/u][/b][/color][/URL][/align]"&chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=0&uid="&getid1&"&pid="&pid&"][color=red][b][u]点击这里拒绝合影[/u][/b][/color][/URL][/align]"
		call messto(myname1,"虚拟相册","邀请合影",content)
	else
		content=myname1&"，您好："&chr(10)
		content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]邀请[/b]与您合影[color=red]邀请留言是：[/color]"&chr(10)
		content=content & phtContent &chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=1&uid="&getid1&"&pid="&pid&"][color=blue][b][u]点击这里同意合影[/u][/b][/color][/URL][/align]"&chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=0&uid="&getid1&"&pid="&pid&"][color=red][b][u]点击这里拒绝合影[/u][/b][/color][/URL][/align]"
		call messto(myname1,"虚拟相册","邀请合影",content)
		content=myname2&"，您好："&chr(10)
		content=content & "您的朋友[color=blue]"&dvbbs.membername&"[/color][b]邀请[/b]与您合影[color=red]邀请留言是：[/color]"&chr(10)
		content=content & phtContent &chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=1&uid="&getid2&"&pid="&pid&"][color=blue][b][u]点击这里同意合影[/u][/b][/color][/URL][/align]"&chr(10)
		content=content & "[align=center][URL=NF_visual_top.asp?act=1&app=0&uid="&getid2&"&pid="&pid&"][color=red][b][u]点击这里拒绝合影[/u][/b][/color][/URL][/align]"
		call messto(myname2,"虚拟相册","邀请合影",content)
	end if	
	response.write "恭喜，您的邀请已经成功发出!" & vbCrLf
case else '我的快照
	dim mrs
	if int(mymoney)<cint(getmoney) then
		'response.write mymoney&"sdfsdf"&getmoney
		response.write"<Br>"+"<li>您不能支付此此写真的"&getmoney&"元费用，快去发贴^_^。"
		exit sub
	end if
	if getmyv(dvbbs.Userid)="" then
		response.write"<Br>"+"<li>您还没有虚拟形象，怎么好意思赤裸参赛？^_^"
		exit sub
	end if
	sql="select photoname from [Visual_photo3] where photoname='"&dvbbs.membername&"'"
	set prs=conntop.execute(sql)
	if not prs.eof and not prs.bof then
		'if mrs("top_photo")=1 then
		response.write"<Br>"+"<li>您已经参加了大赛，快推荐朋友来投票吧！就别老按这里了！^_^"
		exit sub
	end if
	'if DateDiff("s",session("lastpost"),Now())<120 then
	'response.write"<Br>"+"<li>本社区限制连续写真，距离时间为120秒，请稍后再拍。"
	'exit sub
	'end if
	dim mym
	mym=mymoney-getmoney
	conn.execute("update [dv_user] set userWealth="&mym&" WHERE Userid="&dvbbs.userid&"")
	'conn.execute("update [dv_user] set top_photo=1 WHERE Userid="&dvbbs.userid&"")
	set prs=server.createobject("ADODB.Recordset")
	sql="select * from [Visual_photo3]"	
	prs.open sql,conntop,1,3
    prs.addnew
	prs("myid")=dvbbs.userid&"||"
	prs("myv")=getmyv(dvbbs.Userid)&"§§"
	prs("myc")=getmyc(dvbbs.Userid)&"||"
	prs("bake")=""
	prs("pass")=""
	prs("vopen")=0
	prs("lb")=1
	prs("pok")=1
	prs("app")=1
	prs("photoname")=dvbbs.membername
	prs("book")="我于"&now()&"的写真留念哦"
	prs.update
	prs.close
	set prs=nothing
	response.write "恭喜，您已经递交了自己的形象参加大赛!" & vbCrLf
	session("lastpost")=Now()
	set prs=conntop.execute("select top 1 id from [Visual_photo3] order by id desc")
	pid=prs(0)
	call photosee(pid,"")
end select
end sub

sub photosubok(uid,act,app,pid)'申请
dim myid1,myapp,myid2,mylb,mym
        if uid="" or getmyname(uid)="" then
	response.write"<Br>"+"<li>出现错误，请重新登陆。"
	exit sub
        end if
        
        set prs=server.createobject("adodb.recordset")
        sql="select myid,app,lb from [Visual_photo3] where pok=0 and id="&pid
        set prs=conntop.execute(sql)
        if prs.eof or prs.bof then
        response.write"<Br>"+"<li>此邀请合影已经有人拒绝或者已经完成。"
        exit sub
	else
	myid1=prs("myid")
	myapp=prs("app")
	myid2=split(myid1,"|")
	mylb=prs("lb")
	if myapp<>mylb then
	response.write"<Br>"+"<li>此合影邀请还有人未同意，暂时不能完成。"
	exit sub
	end if
        end if
        prs.close
        set prs=nothing
        
        if myid2(0)<>cstr(dvbbs.userid)  then
        response.write"<Br>"+"<li>您不是此次合影的发起人，不能点击完成。"
   	exit sub
	end if
        
        if mymoney<getmoney then
        response.write"<Br>"+"<li>您不能支付此此合影的"&getmoney&"元费用，暂时不能完成^_^。"
 	exit sub
	end if
	mym=mymoney-getmoney
	conntop.execute("update [Visual_photo3] set pok=1 WHERE id="&pid&"")
	conn.execute("update [dv_user] set userWealth="&mym&" WHERE Userid="&uid&"")
	response.write "恭喜，本次合影已经完成!<br><br>" & vbCrLf
	call photosee(pid,"")

end sub

sub photolist(lst)'我的相册列表
dim myname,myid,myid1,mylb
dim totalrec,mypid,mypas
if lst="" then lst="0"
if uid="" then 
	uid=dvbbs.userid
        myname="我"
        else
myname=getmyname(uid)
end if

%>
<a name=visualtop>
<table border=0 cellspacing=1 cellpadding=0 bgcolor=blue width=98%>
<tr height=25 valign=middle>
<th valign=middle>
 
</th></tr>
<tr height=25 valign=middle>
<td valign=middle width=100%> 
<%
                        set prs=server.createobject("ADODB.Recordset")
                        select case lst
                        case "0" 
			%><%=myname%>的家庭秀<%
			sql="select id,myid,book,date,pass,cou,lb from [Visual_photo3] where lb=0 and pok=1  order by cou desc"			        
			case "1" 
			%><%=myname%>的写真秀<%
			sql="select id,myid,book,date,pass,cou,lb from [Visual_photo3] where lb=1 and pok=1  order by cou desc"
			case else '
			%><%=myname%>的合影秀<%
			sql="select id,myid,book,date,pass,cou,lb from [Visual_photo3] where (lb=2 or lb=3) and pok=1  order by cou desc"
			end select
                        prs.open sql,conntop,1,1
                        if prs.eof and prs.bof then
		               response.write "<br>暂时还没有任何用户数据</td>"
                        else
                        %></td></tr><tr><td width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr valign=middle>
			<% 
			                totalrec=prs.recordcount
                                        
					curcount=0
					dim iic
					iic=0
					if curpage > pagecount then curpage = pagecount
						if curpage < 1 then curpage=1
						prs.PageSize=10
						prs.AbsolutePage=CurPage
					do while not prs.eof and curcount<10
				        mylb=prs("lb")
					myid=prs("myid")
					myid1=split(myid,"|")
					mypas=prs("pass")
					dim showok
					
					if myid1(0)=cstr(uid) or myid1(1)=cstr(uid) or myid1(2)=cstr(uid) then
                                        	showok=true
                                        	else
                                        	showok=false
                                        end if
                                        if showok=true then
			                %>
					<td class=tablebody1 width=45%>
					<table width=100% border=0 cellspacing=1 cellpadding=0><tr><td align=center>
					<%
					
			                mypid=prs("id")
					call photosee(mypid,"")
					%>					
                                        </td></tr>
                                        <tr><td class=tablebody2>
                                        <%
                                        response.write "&nbsp;&nbsp;<a href=""NF_visual_top.asp?act=4&lst=1&pid="&mypid&"&uid=""&dvbbs.userid&"" title=""欣赏这个形象，投他一票，将消耗您"&dvbbs.GroupSetting(47)&"点金钱""><img src=skins/default/xianhua.gif border=0>投一票</a>&nbsp;&nbsp;(共：<font color=blue>"&prs("cou")&"</font>票)"
                                        response.write "&nbsp;&nbsp;<a href=""NF_visual_top.asp?act=5&lst=0&pid="&mypid&"&uid=""&dvbbs.userid&"" title=""删除这副合影"">删除</a>"
                                        %>
                                        </td></tr>
                                        
                                        <tr><td class=tablebody2>
                                        <form action="NF_visual_top.asp?act=5&pid=<%=mypid%>&lst=1&uid=<%=dvbbs.userid%>&pas=<%=mypas%>" name="subsee" method=post>
                                        <INPUT name=phtname type=text size="20"> &nbsp;<input type=submit name=submit value="推荐给朋友">
                                        </form>
                                        </td></tr>
                                        </table></td>
                                      
                                        <%
                                        curcount=curcount+1
                                        iic=iic+1
                                        else
					totalrec=totalrec-1
				        end if
					
					
                                        
                                        if iic mod 2=0 then
                                        iic=0%>
                                        <tr valign=middle>
                                        <%end if
					prs.movenext
					loop
					if totalrec mod 10=0 then
						pagecount=totalrec \ 10
					else
						pagecount=totalrec \ 10+1
					end if
			%>
			</tr></table></td>
			
			<%		
			end if
			%>
			</tr><tr><td width=100%>
			<table width=100% border=0 cellspacing=0 cellpadding=0>
					<tr height=25 valign=middle>
						<td valign=middle class=tablebody1>&nbsp;&nbsp;页次：<b><%=curPage%></b> / <b><%=pagecount%></b> 页 每页：<b>10</b> 共计：<b><%=totalrec%></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=NF_visual_top.asp?act=0&app=3&lst=2><b></font color=red>我要参赛</font></b></a></td>
						<td valign=middle class=tablebody1><div align=right>分页：<%
							call DispPageNum(curpage,pagecount,"?act=3&lst="&lst&"&page=","#VisualTop")
						%>&nbsp;&nbsp;</td>
					</tr>
			</table>
			</td></tr></table></td>
			
			
			<%
prs.close
set prs=nothing
end sub


sub photolook(lb,pwidth,mybake,myname1,myname2,myname3,mysex1,mysex2,mysex3,myv1,myv2,myv3,myc1,myc2,myc3,mydate)'显示照片
dim myfqsex1,myfqsex2,mycolor1,mycolor2,mycolor3
dim amyname,amydate
if lb<>0 then
myfqsex1=""
myfqsex2=""
else '夫妻
if mysex1<>0 then
myfqsex1="[夫]"
myfqsex2="[妻]"
else
myfqsex2="[夫]"
myfqsex1="[妻]"
end if	
END IF	
amyname="<table align=left valign=top></tr><td>"
if myname1<>"" then
	if mysex1=1 then
	mycolor1="ffff00" 
	else
	mycolor1="00ff00"
end if
myname1="<table style='filter:glow(color=#05050A,strength=2)'><tr><td align=left><FONT color=#"&mycolor1&">"&myname1&""&myfqsex1&"</font><br></td></tr>"
amyname=amyname&myname1&"</table>"
end if

if myname2<>"" then
	if mysex2=1 then
	mycolor2="ffff00" 
	else
	mycolor2="00ff00"
end if
myname2="<table style='filter:glow(color=#01010c,strength=2)'><tr><td align=left><FONT color=#"&mycolor2&">[R]"&myname2&""&myfqsex2&"</font><br></td></tr>"
amyname=amyname&myname2&"</table>"
else
myname2=""
end if

if myname3<>"" then
	if mysex3=1 then
	mycolor3="ffff00" 
	else
	mycolor3="00ff00"
end if
myname3="<table style='filter:glow(color=#01010c,strength=2)'><tr><td align=left><FONT color=#"&mycolor3&">[L]"&myname3&"</font><br></td></tr>"
amyname=amyname&myname3&"</table>"
else
myname3=""
end if
amyname=amyname&"</td></tr></table>"

mydate="<table style='filter:glow(color=#000000,strength=2)' align=center><tr><td align=left><FONT color=#66FF33>"&mydate&"</font></td></tr></table>"
amydate="<table align=left valign=top></tr><td>"&mydate&"</td></tr></table>"
select case lb
case 3 '三人合影
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>'>
<img src=<%=mybake%> border=0 style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>;z-index:-5;'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/280)%>;right:-5;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-4;'>
<%
call showphoto(myv3,int(pwidth*140/280),mysex3,-int(pwidth*(1-208/280)/2),"",0)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-2;'>
<%
call showphoto(myv1,int(pwidth*140/280),mysex1,0,"",0)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-3;'>
<%
call showphoto(myv2,int(pwidth*140/280),mysex2,int(pwidth*(1-208/280)/2),"",0)
%>
</DIV>
</DIV>
<%



case 2 '朋友
if mybake="" then
pwidth=140     '没有选择背景
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/140)%>;left:10;width:<%=int(pwidth*226/140)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>
<DIV style='padding:0;position:absolute;top:-40;left:-25;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-3;'>
<%
call showphoto(myv2,pwidth,mysex2,int(pwidth*(90/280)/2),"",5)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-4;'>
<%
call showphoto(myv1,pwidth,mysex1,-int(pwidth*(70/280)/2),"",1)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:-40;left:-25;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-2;'>
<%
call showphoto(myv1,pwidth,mysex1,-int(pwidth*(70/280)/2),"",5)
%>
</DIV>
</DIV>
<%         


                     
else
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>'>
<img src=<%=mybake%> border=0 style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>;z-index:-4;'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/280)%>;right:-10;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-3;'>
<%
call showphoto(myv1,int(pwidth*140/280),mysex1,-int(pwidth*(1-220/280)/2),"",0)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-2;'>
<%


call showphoto(myv2,int(pwidth*140/280),mysex2,int(pwidth*(1-220/280)/2),"",0)
%>
</DIV>
</DIV>
<%                                	
end if
case 1 '单人
pwidth=140
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/140)%>;left:10;width:<%=int(pwidth*226/140)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>

<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-3;'>
<%
call showphoto(myv1,pwidth,mysex1,-int(pwidth*(50/280)/2),"",1)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-2;'>
<%
call showphoto(myv1,pwidth,mysex1,-int(pwidth*(50/280)/2),"",0)
%>
</DIV>
</DIV>
<%
case 0 '夫妻
if mybake="" then
pwidth=140     '没有选择背景
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>'>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/140)%>;left:10;width:<%=int(pwidth*226/140)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-3;'>
<%
call showphoto(myv2,int(pwidth*230/280),mysex2,int(pwidth*(10/280)/2),"",5)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-4;'>
<%
call showphoto(myv1,pwidth,mysex1,-int(pwidth*(70/280)/2),"",1)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/140)%>;z-index:-2;'>
<%
call showphoto(myv1,int(pwidth*230/280),mysex1,-int(pwidth*(150/280)/2),"",5)
%>
</DIV>
</DIV>
<%                              
else
%>
<DIV style='padding:0;position:relative;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>'>
<img src=<%=mybake%> border=0 style='padding:0;position:absolute;top:0;left:0;width:<%=pwidth%>;height:<%=int(pwidth*226/280)%>;z-index:-4;'>
<DIV style='padding:0;position:absolute;top:0;left:0;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amyname%>
</DIV>
<DIV style='padding:0;position:absolute;top:<%=int(pwidth*200/280)%>;right:-10;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-1;'>
<%response.write amydate%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-2;'>
<%
call showphoto(myv1,int(pwidth*140/280),mysex1,-int(pwidth*(1-240/280)/2),"",0)
%>
</DIV>
<DIV style='padding:0;position:absolute;top:0;left:<%=int(pwidth*(1-70/140)/2)%>;width:<%=int(pwidth*120/280)%>;height:<%=int(pwidth*226/280)%>;z-index:-3;'>
<%
call showphoto(myv2,int(pwidth*140/280),mysex2,int(pwidth*(1-240/280)/2),"",0)
%>
</DIV>
</DIV>
</a>
<%
end if
end select
end sub

sub showphoto(uservisual,visualwidth,userstex,visualtop,username,inchtc)
 response.write "<table border=0 cellspacing=0 cellpadding=0 width="&visualwidth&">"
 response.write "<tr>"
 response.write "<td align=center><CENTER><IFrame src=NF_visual_show.asp?width="&visualwidth&"&picpath="&picpath&"&localpic="&localpic&"&visual="&uservisual&"&bgcolor=tablebody1 width='"&visualwidth&"' height='"&(visualwidth*226\140)&"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='NO' allowtransparency='true'></iframe></CENTER></td>"
 response.write "</tr>"
 response.write "</table>"
end sub


sub messto(towho,sender,title,content)
    conn.execute("insert into dv_message(incept,sender,title,content,sendtime,flag,issend) values('"&towho&"','"&sender&"','"&title&"','"&content&"',Now(),0,1)")
end sub

'获得用户名字
function getmyname(ismyid)
dim mynametmp
dim mrs
mynametmp=""
if ismyid="" then
 mynametmp=""
 'getmyname=""
 'Exit Function
 else
 
 sql="select UserName from [dv_user] where UserID="&ismyid
 set mrs=conn.execute(sql)
        if mrs.eof or mrs.bof then
  mynametmp=""         
  'getmyname=""
  'Exit Function
 else
 mynametmp=mrs("UserName")
end if
mrs.close
set mrs=nothing 
end if
getmyname=mynametmp
end function

'获得用户性别
function getmysex(ismyid)
dim mysextmp
dim mrs
mysextmp=""
if ismyid="" then
 mysextmp="" 
 'getmysex=""
 'Exit Function
 else
 sql="select usersex from [dv_user] where UserID="&ismyid
 set mrs=conn.execute(sql)
        if mrs.eof or mrs.bof then
  mysextmp=""       
  'getmysex=""
  'Exit Function
 else
 mysextmp=mrs("usersex")
end if
mrs.close
set mrs=nothing 
end if
getmysex=mysextmp
end function

'获得用户ID
function getmyid(ismyname)
dim myidtmp
dim mrs
myidtmp=""
if ismyname="" then
 'getmyid=""
 'Exit Function
 myidtmp=""
else
 sql="select UserID from [dv_user] where UserName='"&ismyname&"'"
 set mrs=conn.execute(sql)
        if mrs.eof or mrs.bof then
         'getmyid=""
  'Exit Function
  myidtmp=""
 else
 myidtmp=mrs("UserID")
end if
mrs.close
set mrs=nothing 
end if
getmyid=myidtmp
end function

'通过ID获得用户虚拟数据
function getmyv(ismyid)
dim myvtmp
dim mrs
myvtmp=""
        if ismyid="" then
  myvtmp=""
  'getmyv=""
  'Exit Function
 else
  sql="select visual from [dv_user] where UserID="&ismyid
  set mrs=conn.execute(sql)
         if mrs.eof or mrs.bof then
   myvtmp=""
          'getmyv=""
   'Exit Function
  else
   myvtmp=mrs("visual")
   if myvtmp="" or isnull(myvtmp) then
   myvtmp=""
   'getmyv=""
   end if
  end if
  mrs.close
  set mrs=nothing 
 end if
getmyv=myvtmp
end function

'通过ID获得用户等级
function getmyc(ismyid)
dim myctmp
dim mrs
myctmp=""
        if ismyid="" then
  'getmyc=""
  myctmp=""
  'Exit Function
 else
  sql="select userclass from [dv_user] where UserID="&ismyid
  set mrs=conn.execute(sql)
         if mrs.eof or mrs.bof then
          'getmyc=""
   'Exit Function
   myctmp=""
  else
   myctmp=mrs("userclass")
  end if
  mrs.close
  set mrs=nothing 
 end if
getmyc=myctmp
end function

function getmyw(vismywife,vismyid)
dim mrs,ismywife
        if vismywife="" or vismyid="" then
  getmyw=false
 else
  sql="select UserID from [dv_user] where UserID="&vismyid&" and wife='"&vismywife&"'"
  set mrs=conn.execute(sql)
         if mrs.eof or mrs.bof then
          getmyw=false
  else
   getmyw=true
  end if
        end if
mrs.close
set mrs=nothing 
end function   
  
%>