
<%
sub top_mingxing()
dim mypid,srs,curcount
dim pid,curpage,act,app,uid,pas,pmyname,lst,content,totalrec
dim prs,PageCount
if dvbbs.userid=0 then
	errmsg=errmsg+"<br>"+"<li>您还没有<a href=login.asp>登录社区</a>，不能使用个人形象合影功能。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！"
	founderr=true
end if
act=checkstr(request("act")) '提交的类型0为申请合影1为同意合影2观看照片
app=checkstr(request("app")) '提交的类型0为申请合影1为同意合影
lst=checkstr(request("lst")) '影集的类别
pas=checkstr(request("pas")) '密码
pid=checkstr(request("pid")) '合影的id
uid=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=userid
	pmyname=membername
	else
	pmyname=getmyname(uid)
end if
stats="形象大赛"
if founderr=true then
	call nav()
        call head_var(2,0,"","")
	call dvbbs_error()
else

call nav()


call head_var(2,0,"","")




	response.write "<table cellpadding=3 cellspacing=1 align=center class=tableborder1><TR height=25><Th align=left id=tabletitlelink colSpan=4 style='font-weight:normal'><b>┫&#9618; 个人形象投票排行榜 &#9618;┣</b>&nbsp;&nbsp;&nbsp;&nbsp;"



response.write "<tr>" & vbCrLf



response.write "	<td align=center valign=top class=tablebody1 width=""95%"">"
response.write "                        <table border=0 cellspacing=1 cellpadding=0 width=140 bgcolor="&forum_body(27)&">"			
response.write "                        <tr height=25 valign=middle>" & vbCrLf
%>
                        
                        <table width="90%" border="0" cellspacing="0" cellpadding="0">
			<tr valign=middle>
                        
                        
                        
			<% 
set srs=server.createobject("ADODB.Recordset")
  sql="select top 100 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"

                        srs.open sql,conn,1,1
                        if srs.eof and srs.bof then
                        
                        
		               response.write "<br>暂时还没有任何用户数据</td>"
                        else
                        
			                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=100% 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=""z_visual_photo2.asp?act=4&lst=1&pid="&mypid&"&uid="&userid&""" title=""欣赏这个形象，给他一朵鲜花，将消耗您"&dvbbs.GroupSetting(47)&"点金钱""><img src="&Forum_info(7)&Forum_BoardPic(6)&" border=0>鲜花</a>&nbsp;&nbsp;(分数：<font color=blue>"&srs("cou")&"</font>)"
                                        if master then
                                        response.write "&nbsp;&nbsp;<a href=""z_visual_photo2.asp?act=5&lst=0&pid="&mypid&"&uid=""&userid&"" title=""删除这副合影"">删除</a>"
                                        end if
                                        %>
                                        
                                        </td>
                                        </tr>
                                        <tr>
                                        <td class=tablebody2 align=center>
                                        <form action="z_visual_photo.asp?act=5&pid=<%=mypid%>&lst=1&uid=<%=userid%>&pas=" name="subsee" method=post>
                                        <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=90%>
			<table width=95% border=0 cellspacing=0 cellpadding=0 align=center>
					<tr height=25 valign=middle>
						<td valign=middle class=tablebody1>&nbsp;&nbsp;页次：<b><%=curPage%></b> / <b><%=pagecount%></b> 页 每页：<b>10</b> 共计：<b><%=totalrec%></b></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>
			<%
srs.close
set srs=nothing
end if







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=conn.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

'获得用户名字
function getmyname(ismyid)
dim mynametmp
dim mrs
mynametmp=""
if ismyid="" then
 mynametmp=""
 'getmyname=""
 'Exit Function
 else
 sql="select Jauname from [Jauser] where Jauid="&ismyid
 set mrs=conn.execute(sql)
        if mrs.eof or mrs.bof then
  mynametmp=""         
  'getmyname=""
  'Exit Function
 else
 mynametmp=mrs("Jauname")
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 Jasex from [Jauser] where Jauid="&ismyid
 set mrs=conn.execute(sql)
        if mrs.eof or mrs.bof then
  mysextmp=""       
  'getmysex=""
  'Exit Function
 else
 mysextmp=mrs("Jasex")
end if
mrs.close
set mrs=nothing 
end if
getmysex=mysextmp
end function
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=80
%>
<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=z_visual_show.asp?width="&visualwidth&"&picpath="&picpath&"&localpic="&localpic&"&visual="&uservisual&" 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
Dvbbs.ActiveOnline()
Dvbbs.Footer()
%>