<!-- #include file="include/config_vouch.asp" -->
<!-- #include file="include/config_review.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/conn.asp" -->
<%
dim types,kn
nummer=12
kn=3
types=objv7.code_form(request.querystring("types"))
n_sort="gall"

if action="view" then if not(isnumeric(id)) then action="paste"
tit="网站贴图"

select case action
case "film"
  tit="精彩视频"
  n_sort="film"
  if types="view" then tit="浏览视频"
case "flash"
  tit="精彩FLASH"
  n_sort="flash"
  if types="view" then tit="浏览FLASH"
case else
  action="paste"
  tit="精彩贴图"
  if types="view" then tit="浏览贴图"
end select

call web_head(0,0,0,0,0)
'------------------------------------left----------------------------------
call nsort_left(n_sort,cid,sid,"?action="&action&"&")
'call format_login()
call vouch_left()
'----------------------------------left end--------------------------------
call web_center(0)
'-----------------------------------center---------------------------------
response.write kong&admin_bar(tit,1,"100%")
select case action
case "film"
  if types="view" then
    call gallery_view()
  else
    call gallery_main(action)
  end if
case "flash"
  if types="view" then
    call gallery_view()
  else
    call gallery_main(action)
  end if
case else
  action="paste"
  if types="view" then
    call gallery_view()
  else
    call gallery_main(action)
  end if
end select
response.write admin_bar("",2,"100%")&kong
if types="view" then
call review_type(n_sort,id,"gallery.asp?action=view&c_id="&cid&"&s_id="&sid&"&id="&id,1)
end if
response.write kong
'---------------------------------center end-------------------------------
call web_end(0)

sub gallery_view()
  if not(isnumeric(id)) then call gallery_main(action):exit sub
  dim ispic,width,height,topic
  width=objv7.web_var(web_num,9):height=objv7.web_var(web_num,10)
  sql="select * from gallery where hidden=1 and types='"&action&"' and id="&id
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then rs.close:call gallery_main(action):exit sub
  ispic=rs("pic")
  if len(ispic)<5 then rs.close:call gallery_main(action):exit sub
  
  if action<>"paste" then call emoney_notes(rs("power"),rs("emoney"),n_sort,id,"js",0,1,"gallery.asp?action="&action&"&c_id="&cid&"&s_id="&sid)
  sql="update gallery set counter=counter+1 where id="&id
  conn.execute(sql)
  topic=rs("name")
%>
<table border=0 width='98%' align=center>
<tr><td height=30 align=center><font class=hit size='4'><b><%response.write objv7.code_html(topic,1,0)%></b></font></td></tr>
<tr><td height=5></td></tr>
<tr><td align=center class=bw>
<%
  select case action
  case "flash"
%>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="<%response.write width%>" height="<%response.write height%>">
<param name=movie value="<%response.write objv7.url_true(objv7.web_var(web_upload,1),ispic)%>">
<param name=quality value=high>
<embed src="<%response.write objv7.url_true(objv7.web_var(web_upload,1),ispic)%>" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="<%response.write width%>" height="<%response.write height%>"></embed> 
</object>
<%
  case "film"
    call film_view(ispic,width,height)
  case else
%>
<img src='<%response.write objv7.url_true(objv7.web_var(web_upload,1),ispic)%>' border=0 onload="javascript:if(this.width><%response.write width%>)this.width=<%response.write width%>" align=center>
<% end select %>
</td></tr>
<tr><td height=5></td></tr>
</table>
<table border=0 width='98%' align=center>
<tr><td>文件说明：<%response.write code_jk(rs("remark"))%></td></tr>
<tr><td>上传用户：<%response.write format_user_view(rs("username"),1,"")%>　　上传时间：<%response.write rs("tim")%>　　人气：<font class=time><%response.write rs("counter")%></font></td></tr>
<tr><td><%response.write commend_friend(tit,topic,"gallery.asp?types=view&action="&action&"&c_id="&cid&"&s_id="&sid&"&id="&id)%>　　<%response.write img_small("jt0")%><a href='javascript:;' onclick="javascript:open_view('<%response.write objv7.url_true(objv7.web_var(web_upload,1),ispic)%>',1);">在新窗口中浏览</a></td></tr>
<tr><td height=10></td></tr>
</table>
<%
end sub

sub gallery_main(gma)
  dim j,k,pic,name,nnum,pic_temp,ntypes,ut:nnum=1
  pageurl="?action="&action&"&"
  if cid>0 then
    sqladd=" and c_id="&cid
    pageurl=pageurl&"c_id="&cid&"&"
    if sid>0 then
      sqladd=sqladd&" and s_id="&sid
      pageurl=pageurl&"s_id="&sid&"&"
    end if
  end if

  sql="select id,c_id,s_id,types,spic,name,counter,power,emoney from gallery where hidden=1 and types='"&action&"'"&sqladd&" order by id desc"
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if not(rs.eof and rs.bof) then rssum=rs.recordcount
  
  call format_pagecute()
%>
<table border=0 width='98%' align=center>
<tr><td align=center height=30>
<table border=0 width='100%' cellspacing=0 cellpadding=0 align=center>
<tr align=center valign=bottom><td width='35%'>
现有<font class=time><%response.write rssum%></font>个 <font class=time><%response.write tit%></font>┋
每页<font class=time><%response.write nummer%></font>个
</td><td width='65%'>
页次：<font class=time><%response.write viewpage%></font>/<font class=time><%response.write thepages%></font> 分页：<%response.write objv7.jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr>
</table>
</td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td align=center>
<table border=0 width='100%' align=center>
<%
  if nummer mod kn > 0 then
    k=nummer\kn+1
  else
    k=nummer\kn
  end if
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to k
    'if rs.eof then exit for
    response.write "<tr><td height=5></td></tr><tr align=center>"
    for j=1 to kn
      if rs.eof or nnum>nummer then exit for
      pic=rs("spic"):name=rs("name")
      ut="gallery.asp?types=view&action="&action&"&c_id="&rs("c_id")&"&s_id="&rs("s_id")&"&id="&rs("id")
      pic_temp="<table border=0>" & _
	       "<tr><td align=center><a href='javascript:;' onclick=""javascript:open_view('"&ut&"',1);""><script language=javascript>pic_url('"&pic&"',1)</script></a></td></tr>" & _
	       "<tr><td align=center><a href='javascript:;' onclick=""javascript:open_view('"&ut&"',1);"" class=blue><b>"&objv7.code_html(name,1,10)&"</b></a></td></tr>"
      if action<>"paste" then
	pic_temp=pic_temp&"<tr><td align=center>"&m_unit&"：<font class=time>"&rs("emoney")&"</font>&nbsp;&nbsp;人气：<font class=time>"&rs("counter")&"</font></td></tr>" & _
	         "<tr><td align=center>"&power_pic(0,rs("power"),0)&"</td></tr>"
      end if
      pic_temp=pic_temp&"</table>"
      response.write "<td><script language=javascript>pic_fk(1,1)</script>"&pic_temp&"<script language=javascript>pic_fk(2,1)</script></td>"
      rs.movenext
      nnum=nnum+1
    next
    response.write "</tr>"
  next
  rs.close:set rs=nothing
%>
</table>
</td></tr></table>
<%
end sub
%>