相册分页
作者:cmscn 日期:2009-09-13
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
评论: 0 | 引用: 0 | 查看次数: 714
发表评论