'************************************* '追梦阳光 专用页码简化版,取得显示页码 '************************************* function viewpage(p_c,p_n,p_x,p_p,Dreamsun_cls,p_z,showfile) '总记录,显示记录数,显示页数,当前页,传替参数,总数说明,当前页面名称 dim p_k,p_y,p_p2,p_p3,p_m '计算页数相关 if p_c/p_n = int(p_c/p_n) then p_y=int(p_c/p_n) else p_y=int(p_c/p_n)+1 end if if p_p>p_y then p_p=p_y p_p2= int(p_p/p_x) if p_p/p_x>p_p2 then p_p2=p_p2+1 p_k=p_p2*p_x if p_k>p_y then p_k=p_y If Dreamsun_cls<>"" And Left(Dreamsun_cls,1)<>"&" Then Dreamsun_cls="&"&Dreamsun_cls viewpage=viewpage& "<div class=""meneame""><em> " & p_c &"/ "&p_y&"</em> " if p_p2>1 then viewpage=viewpage& "<a href='"&showfile&"?CurPage=1" & Dreamsun_cls&"'>首页</a>" viewpage=viewpage& "<a href='"&showfile&"?CurPage="& p_p2*p_x-p_x & Dreamsun_cls&"'>上翻</a>" end if For p_m =p_p2*p_x-(p_x-1) To p_k if p_m=p_p then viewpage=viewpage& "<strong>"& p_m &"</strong>" else viewpage=viewpage& "<a href='"&showfile&"?CurPage="& p_m & Dreamsun_cls&"'>"& p_m &"</a>" end if Next if p_p2*p_x < p_y then viewpage=viewpage& "<a href='"&showfile&"?CurPage="&p_m & Dreamsun_cls&"'>下翻</a>" viewpage=viewpage& "<a href='"&showfile&"?CurPage="&p_y & Dreamsun_cls&"'>尾页</a>" end if viewpage=viewpage& "<input type=""text"" name=""custompage"" size=""3"" onkeydown=""if(event.keyCode==13) {window.location='"&showfile&"?abc=1"&Dreamsun_cls&"&CurPage='+this.value; return false;}""/></div>"& vbCrLf End Function
|