'***************************************************** ' Paging navigation bar '***************************************************** sub PageNavBar(sql) dim scriptname,counterstart,pad,counterend,counter,ref,mysql dim nextpage, prevpage dim pageid pageid=request("id") If not isnumeric(pageid) then pageid="" end if dim cathead, more, catsql, rs dim id,name cathead="" catsql="select * from categories where categoryid=" & pageid Set rs=dbc.execute(catsql) name=rs("catdescription") id=rs("categoryid") mysql=sql SetSess "sqlquery",sql pad="" scriptname=request.servervariables("script_name") response.write PageNavTable & PageNavRow response.write PageNavColumn & PageNavFont if (mypage mod 20) = 0 then counterstart = mypage - 19 else counterstart = mypage - (mypage mod 20) + 1 end if counterend = counterstart + 19 if counterend > maxpages then counterend = maxpages if counterstart <> 1 then ref="" & LangFirst & " : " Response.Write ref ref="" & langPrevious & " " Response.Write ref end if prevpage=mypage-1 if prevpage>=1 then ref="" If getconfig("xbuttonpreviouspage")="" then ref=ref & getlang("langpreviouspage") else ref=ref & "" end if ref=ref & " " Response.Write ref end if Response.Write "[" for counter=counterstart to counterend If counter>=20 then pad="" end if if cstr(counter) <> mypage then ref="" & pad & counter & "" else ref="" & pad & counter & "" end if response.write ref if counter <> counterend then response.write " " next Response.Write "] " nextpage=mypage+1 If Nextpage=< maxpages then ref="" If getconfig("xbuttonnextpage")="" then ref=ref & getlang("langnextpage") else ref=ref & "" end if ref=ref & " " Response.Write ref end if response.write "
" & PageNavFontEnd response.write PageNavTableEnd Closerecordset rs end sub '