首页 / 前言 / 重点项目 / 开幕式图文·视频直播 / 新闻报道 / 留言 / 往届展会 / 更多专题
<% Next %>
 重点项目展示
<% maxperpage =35 pid = 26 '第九届城市规划展 parentid = 0 isviewpage = 1 filename = "photo.asp?" call photo_page(maxperpage,pid,parentid,isviewpage,filename) %> 处理 SSI 文件时出错
<% 'isviewpage 是否显示分页信息 filename分页文件名 sub photo_page(maxperpage,pid,parentid,isviewpage,filename) dim sql,rs,conn dim totalrecords,totalpages,currentpage,startpos,endpos dim tablename tablename="tuji_info" picpath="/pic/guihuazhan9/" strwhere =" where pid="&pid&" and parentid<>0 " sql="select count(*) as total from ["&tablename&"] "&strwhere Set rs= Server.CreateObject("ADODB.Recordset") %> 处理 SSI 文件时出错
<% 'response.write sql rs.open sql,conn_webjd,1,1 totalrecords=clng(rs("total")) rs.close if totalrecords mod maxperpage = 0 then totalpages = totalrecords \ maxperpage else totalpages = totalrecords \ maxperpage +1 end if currentpage=trim(request("page")) if not isnumeric(currentpage) then currentpage=1 else currentpage=clng(currentpage) if currentpage < 1 then currentpage = 1 elseif currentpage > totalpages then currentpage = totalpages end if end if startpos = clng((currentpage-1) * maxperpage) if startpos<0 then startpos=0 end if endpos = clng(currentpage * maxperpage) if endpos > totalrecords then endpos = totalrecords end if sql = "select * from (select top "&endpos&" * from ["&tablename&"] "&strwhere&" order by info_id desc) a where a.info_id not in (select top "&startpos&" info_id from ["&tablename&"] "&strwhere&" order by info_id desc)" 'response.write sql rs.open sql,conn_webjd,1,1 i = 0 Set PP=New ImgWHInfo Do While Not rs.eof i=i+1 If i=1 then %> <% End If w= PP.imgW(Server.Mappath(picpath&rs("picname"))) h = PP.imgH(Server.Mappath(picpath&rs("picname"))) If w>h Then strwh = "width" Else strwh = "height" End If If rs("ispics")=1 Then sql ="select count(info_id) as total from ["&tablename&"] where pid="&rs("pid")&" and parentid="&rs("info_id") Set rs1=conn_webjd.execute(sql) intpics = rs1("total") Set rs1=Nothing sql ="select top 1 input_date from ["&tablename&"] where pid="&rs("pid")&" and parentid="&rs("info_id")&" order by info_id desc" Set rs1=conn_webjd.execute(sql) strdate = rs1("input_date") strdate = Right(strdate,Len(strdate)-5) strdate = left(strdate,Len(strdate)-3) Set rs1=Nothing strhref="photo_list.asp?pid="&rs("pid")&"&info_id="&rs("info_id")&"" strpics = "(共"&intpics&"张)" Else strhref = "photo_view.asp?pid="&rs("pid")&"&info_id="&rs("info_id")&"" strdate = "" strpics = "" End If %> <% rs.movenext If i=5 Then i=0 %>
" width="116" height="86" border=0>
<%=rs("title")%>
<%=strdate&"  "&strpics%>
<% If Not rs.eof then %>
<% End If End If Loop rs.close Set pp=Nothing set rs=nothing conn_webjd.close set conn_webjd=nothing If i>0 And i<5 Then For j=i+1 To 5 %>
<% End If if isviewpage=1 then %>
<%Call CreatePage(filename,currentpage,totalpages,totalrecords)%> <% end if end sub %>
网站简介 | 广告服务 | 联系方式 | 请您留言 | 法律声明 | 鲁ICP备05028597号 | 设为首页
胶东在线版权所有 Copyright@ JiaoDong.net
<% sub CreatePage(filename,currentpage,totalpages,totalrecords) If Not ( Right(filename,1)="&" Or Right(filename,1)="?" )Then If InStr(filename,"?")>0 Then filename= filename &"&" Else filename= filename &"?" End If End If %>
<% stepnum = 10 response.write("共"&totalrecords&"个记录 页次:"¤tpage&"/"&totalpages&"页") if totalpages=1 then else if currentpage<=1 then response.write(" 首页 前页  ") else prevpage=currentpage-1 response.write(" 首页 前页  ") end if startpage=currentpage - stepnum if startpage < 1 then startpage=1 endpage= currentpage + stepnum - 1 if endpage >totalpages then endpage = totalpages for i=startpage to endpage if i=currentpage then response.write(" ["&i&"]") else response.write(" ["&i&"]") end if next if currentpage>=totalpages then response.write(" 后页 尾页 ") else nextpage=currentpage+1 response.write(" 后页 尾页 ") end if end if %>
<% end sub %>