int(rssum) then nums=nummer-(viewpage*nummer-rssum)%> 公开相片欣赏"" then d_name=rs("photoname") else d_name=rs("nname") end if %>'>'>'> 共有个照片 页次:/"&thepages%> 分页:<%end sub,Bullcn'Blog - 分享、交流、进步。" /> 相册分页 - Bullcn'Blog

相册分页


sub photo_main()

dim nummer,nums,rssum,page,viewpage,thepages,pageurl,word,id,d_name,ispic,data_name,col_num,tr_ture,pnum,num_col
col_num=4
num_col=3
pnum=100\col_num
tr_ture=true
pageurl="?"
nummer=num_col*col_num
nums=nummer
n_sort="photo"
index_url="photo"
data_name="photo"

  dim id,nname,topic,hidden,tim
  sql="select count(id) from photo where hidden=1"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  if int(rssum)<1 then
    call photo_write()
    exit sub
  end if
  call format_pagecute()
  sql="select top "&nummer*viewpage&" id,photopic,nname,topic,word,tim,sampname,hidden,counter,photoname from photo where hidden=1 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)
%>
<tr><td class=td> 公开相片欣赏</td></tr>

<%
  for i=1 to nums
    id=rs("id")
    topic=rs("topic")
    tim=rs("tim")
    if rs("photoname")<>"" then
     d_name=rs("photoname")
    else
     d_name=rs("nname")
    end if        
%>

<% 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("photopic"),1,"photo.asp?action=show&id="&id)%></td></tr>
<tr><td align=center><a href='?action=show&id=<%response.write id%>'><font alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,8)%></font></a></td></tr>
</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 height=26><td> 共有<font class=red><%response.write rssum%></font>个照片 页次:<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font> 分页:<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000") %></td></tr>

<%
end sub

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 分页
相关日志:
评论: 0 | 引用: 0 | 查看次数: 714
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭