<%
'*******************************
'関数:マルチページ(数字、perage、curpage、url_add)
'パラメーター:数字、レコードの総数。ページごとのレコード数。呪い、現在のページ。 url_add、「action = list&」などの現在のページのその他のパラメーター
著者:アリクシ
'日付:2007/7/15
'説明:ASPユニバーサルページネーションスタイル機能
'例:Multipage(100,10,2、 "?action = list&")
'*******************************
functionMultipage(数字、perage、curpage、url_add)
curpage = int(curpage)
薄暗い
url = request.servervariables( "script_name")&url_add
Multipage = ""
調光器、オフセット、pagei
ifint(numbers)> int(perpage)then
ページ= 10
オフセット= 2
調光器、frompage、tapage
ifnumbersmodcint(perpage)= 0then
pages = int(numbers/perage)
それ以外
pages = int(numbers/perage)+1
endif
frompage = curpage-offset
トパート= curpage+ページオフセット1
ifpage> pagesthen
frompage = 1
page =ページ
それ以外
iffrapage <1then
Tapeage = curpage+1-frompage
frompage = 1
if(page-frompage)<pageand(page-frompage)<pagesthentopage = page
ElseForiftopage> pagesthen
frompage = curpage-pages+tapage
page =ページ
if(pageand(pageand(tage-frompage)<pagesthenfrompage = pages-page+1
endif
endif
Multipage = "<ahref = '"&url& "page = 1'> <<</a>"
forpagei = frompagetotopage
ifpagei <> curpagethen
Multipage = Multipage& "<ahref = '"&url& "page ="&pagei& "'> ["&pagei& "</a>"
それ以外
Multipage = Multipage& "<b> ["&pagei& "</b>"
endif
次
ifint(pages)> int(page)then
Multipage = Multipage& "... <ahref = '"&url& "page ="& "'> ["&pages& ">> </a>"
それ以外
Multipage = Multipage& "<ahref = '"&url& "page ="& "' >>> </a>"
endif
endif
endFunction%>