<!-- #include file="include/config_vouch.asp" -->
<!-- #include file="include/config_review.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/conn.asp" -->
<%
dim types
types=trim(request.querystring("types"))
n_sort="gall"

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

select case action
case "logo"
  tit="精彩LOGO"
case "baner"
  tit="精彩BANNER"
case "film"
  tit="电影音乐"
  if types="view" then tit="浏览视频"
case "flash"
  tit="精彩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 format_login()
call vouch_left("jt12","jt1")
call vouch_skin("图片分类","<table border=0 width='60%' align=center><tr><td>"&nsort_left(n_sort,cid,sid,"?action="&action&"&",1)&"</td></tr></table>","",1)
'----------------------------------left end--------------------------------
call web_center(0)
'-----------------------------------center---------------------------------
response.write ukong

select case action
case "logo"
  call gallery_main(action)
case "baner"
  call gallery_main(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
  if types="view" then
    call gallery_view()
  else
    call gallery_main(action)
  end if
end select

response.write kong
'---------------------------------center end-------------------------------
call web_end(0)

sub gallery_view()

  dim ispic,width,height
  width=web_var(web_num,9):height=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,p_name)
  sql="update gallery set counter=counter+1 where id="&id
  conn.execute(sql)
%>
<table border=0 width='98%' align=center class=tf>
<tr><td height=30 align=center><font class=blue size='4'><b><%response.write code_html(rs("name"),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 url_true(upload_file,ispic)%>>
<param name=quality value=high>
<embed src="<%response.write url_true(upload_file,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
%>
<a href='<%response.write url_true(upload_file,ispic)%>' target=_blank><img src='<%response.write url_true(upload_file,ispic)%>' onload='javascript:if(this.width>550)this.width=550' border=0 alt='点击图片可在新窗口中打开'></a>
<% end select %>
</td></tr>
<tr><td height=5></td></tr>
</table>
<table border=0 width='98%' align=center class=tf>
<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=red><%response.write rs("counter")%></font>　　<%response.write img_small("jt0")%><a href='<%response.write url_true(upload_file,ispic)%>' target=_blank>在新窗口中浏览</a></td></tr>
<tr><td height=10></td></tr>
<tr><td align=center><% call review_type(n_sort,id,"gallery.asp?action=view&c_id="&cid&"&s_id="&sid&"&id="&id,1) %></td></tr>
</table>
<%
end sub

sub gallery_main(gma)
  dim j,k,kn,pic,name,nnum,pic_temp,ntypes: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,pic,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
  
  select case action
  case "logo"
    nummer=30
  case "baner"
    nummer=web_var(web_num,4)
  case else
    nummer=18
  end select
  call format_pagecute()
%>
<table border=0 width='96%'>
<tr><td align=center height=30>
<table border=0 width='98%' cellspacing=0 cellpadding=0>
<tr align=center valign=bottom><td width='35%'>
现有<font class=red><%response.write rssum%></font>个 <font class=red_3><%response.write tit%></font>┋
每页<font class=red><%response.write nummer%></font>个
</td><td width='65%'>
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font> 分页：<%response.write 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%'>
<%
select case action
case "logo"
  kn=5:nummer=nummer*2
  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 align=center>"
    for j=1 to kn
      if rs.eof or nnum>nummer then exit for
      pic=rs("pic"):name=rs("name")
      response.write "<td><table border=0><tr><td align=center><img src='"&url_true(upload_file,pic)&"' border=0 width=88 height=31></td></tr><tr><td align=center><font title='"&name&"'>"&code_html(name,1,10)&"</font></td></tr></table></td>"
      rs.movenext
      nnum=nnum+1
    next
    response.write "</tr>"
  next
case "baner"
  nummer=web_var(web_num,4)
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
    pic=rs("pic"):name=rs("name")
    response.write "<tr><td><table border=0 align=center><tr><td align=center><img src='"&url_true(upload_file,pic)&"' border=0 width=468 height=60></td></tr><tr><td align=center>"&code_html(name,1,0)&"</td></tr></table></td></tr>"
    rs.movenext
  next
case else
  kn=3
  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
      if action="paste" then
        pic=rs("pic")
      else
        pic=rs("spic")
      end if
      name=rs("name")
      pic_temp="<table border=0>" & _
	       "<tr><td align=center><a href='?types=view&action="&action&"&c_id="&rs("c_id")&"&s_id="&rs("s_id")&"&id="&rs("id")&"'><img src='"&url_true(upload_file,pic)&"' border=0 width="&pic_width&" height="&pic_height&"></a></td></tr>" & _
	       "<tr><td align=center class=blue><b>"&code_html(name,1,10)&"</b></td></tr>"
      if action<>"paste" then
	pic_temp=pic_temp&"<tr><td align=center>"&m_unit&"：<font class=red_3>"&rs("emoney")&"</font>&nbsp;&nbsp;人气：<font class=red>"&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 height="&pic_height+50&">"&format_k(pic_temp,1,5,pic_width+10,pic_height+30)&"</td>"
      rs.movenext
      nnum=nnum+1
    next
    response.write "</tr>"
  next
end select
  rs.close:set rs=nothing
%>
</table>
</td></tr></table>
<%
end sub
%>