<!-- #include file="include/con_vouch.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<%
'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: cms@joekoe.com , service@joekoe.com
' Web: http://www.joekoe.com , http://www.topv.com
' Copyright (C) 2004 Joekoe.com All Rights Reserved.
'****************************************************

dim nummer,nums,rssum,page,viewpage,thepages,pageurl,sql_add,num_col,pnum,w_num,vvt,vvs,nid,nname,nemoney,tr_ture,sqladd,vhead
pageurl="?types="&types&"&"
num_col=3
pnum=100\col_num
w_num=10
tr_ture=true
nummer=num_col*col_num
nums=nummer
sql_add=""

select case types
case "flash"
  vvt=2
  vvs=0
  n_sort="flash"
  tit="精彩Flash"
%>
<!-- #include file="style/data_sort_flash.asp" -->
<%
case "film"
  vvt=0
  vvs=0
  n_sort="film"
  tit="精彩视频"
%>
<!-- #include file="style/data_sort_film.asp" -->
<%
case else
  vvt=1
  vvs=0
  n_sort="gall"
  types="paste"
  tit="精彩贴图"
%>
<!-- #include file="style/data_sort_gall.asp" -->
<%
end select

call cid_sid()
call web_head(0,0,0,0,0)
call vouch_load(0,0,0)
'----------------------------左边 开始----------------------------
call vouch_left_sort(tit,vvs)
call vouch_left()
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0>&nbsp;<%response.write img_skin(web_img_m)&tit%> 搜索</td></tr>
<tr class=bg_td><td align=center>
<%  
call vouch_search(tit,0,types)
%>
</td></tr>
</table>
<%
response.write ukong

if cid>0 then
  sql_add=sql_add&" and c_id="&cid
  pageurl=pageurl&"c_id="&cid&"&"
  if sid>0 then
    sql_add=sql_add&" and s_id="&sid
    pageurl=pageurl&"s_id="&sid&"&"
  end if
end if
keyword=code_search(request.querystring("keyword"))
if action="search" and keyword<>"" then
  sea_type=trim(request.querystring("sea_type"))
  sea_term=trim(request.querystring("sea_term"))
  if sea_type<>"username" then sea_type="name"
  if sea_term<>"only" then sea_term="all"
  sql_tmp=sql_key(keyword,sea_type,2,sea_term)
  if sql_tmp<>"" then
    sqladd=sqladd&" and "&sql_tmp
    sql_tmp=""
    pageurl=pageurl&"action=search&sea_type="&sea_type&"&keyword="&server.urlencode(keyword)&"&"
    vhead="&nbsp;&nbsp;搜索结果"
  end if
end if
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0>&nbsp;<%response.write img_skin(web_img_m)&tit&vhead%></td></tr>
<%
sql="select count(id) from gallery where hidden=1 and types='"&types&"'"&sql_add&sqladd
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
call format_pagecute()
sql="select top "&nummer*viewpage&" id,name,spic,emoney,power,counter from gallery where hidden=1 and types='"&types&"'"&sql_add&sqladd&" order by id desc"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
for i=1 to nums
  nid=rs("id")
  nname=rs("name")
  nemoney=rs("emoney")
  if (i-1) mod col_num=0 then
%>
<tr class=bg_td><td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr align=center>
<%
    tr_ture=false
  end if
%>
  <td width='<%response.write pnum%>%'>
    <table border=0 cellspacing=0 cellpadding=2>
    <tr><td align=center><%response.write pic_fk(rs("spic"),1,"gallery_view.asp?types="&types&"&id="&nid)%></td></tr>
    <tr><td align=center><b><a href='gallery_view.asp?types=<%response.write types%>&id=<%response.write nid%>' alt='<%response.write joekoe_cms.code_html(nname,1,0)%>'><%response.write joekoe_cms.code_html(nname,1,w_num)%></a></b></td></tr>
<%if vvt>0 then%>
    <tr><td align=center><%response.write joekoe_cms.web_unit%>：<font class=red2><%response.write nemoney%></font>  人气：<font class=red><%response.write rs("counter")%></font></td></tr>
<% if vvt>1 then %>
    <tr><td align=center><%response.write format_emoney_power(nemoney,rs("power"),0)%></td></tr>
<%
  end if
end if
%>
    </table>
  </td>
<%
  if i mod col_num=0 then
    tr_ture=true
%>
  </tr>
  </table>
</td></tr>
<%
  end if
  rs.movenext
next
rs.close
if not tr_ture then
%>
  </tr>
  </table>
</td></tr>
<%
end if
%>
<tr class=bg_tds><td height=30>
现有 <font class=red><%response.write rssum%></font> 个<%response.write tit%>，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
&nbsp;分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr>
</table>
<%
response.write ukong
'----------------------------中间 结束----------------------------
call vouch_end()
call web_end(0,0)

'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: cms@joekoe.com , service@joekoe.com
' Web: http://www.joekoe.com , http://www.topv.com
' Copyright (C) 2004 Joekoe.com All Rights Reserved.
'****************************************************
%>