asp 文章分页类
<%
Class Cls_Page
'**************************************************
'函数名:ShowPage
'作 用:显示分页
'参 数:如下
'strFileName : ?后面的文件,如xxx.asp?page=
'xTotalNum : 总数
'xPageCount : 总页数
'xMaxPerPage : 每页显示数量
'xCurrentPage : 当前页数
'xPageName : 当前页面名
'xUnitName : 分类单位名称,如"篇,条,幅"
'xShowStyle : 显示分页的样式
'返回值:分页
'**************************************************
Public Function ShowPage
(strFileName,xTotalNum,xPageCount,xMaxPerPage,xCurrentPage,xPageName,xUnitNa
me,xShowStyle)
strUrl = ClsMain.JoinChar(strFileName)
Dim i,PageStr
If xTotalNum > 0 Then
If xPageCount >= 1 Then
Select Case xShowStyle
Case "1" '分页样式1:列出所有
页码的页号,页码较少时可以使用
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
For i=1 To xPageCount
If i = xCurrentPage
Then
PageStr =
PageStr & " [" & i &
"]"
Else
PageStr =
PageStr & " [
class=""GoToPage"">" & i & "
End If
Next
PageStr = PageStr &
"
、上一页、下一页、末页,均为符号和转到页的输入框
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
If xCurrentPage > 1 Then
PageStr = PageStr &
"
class=""FirstPage"">|‹
PageStr = PageStr &
"
页"" class=""PrevPage"">«
Else
PageStr = PageStr &
" |‹"
PageStr = PageStr &
" «"
End If
If xCurrentPage < xPageCount
Then
PageStr = PageStr &
"
页"" class=""NextPage"">»
PageStr = PageStr &
"
class=""LastPage"">›|
Else
PageStr = PageStr &
" »"
PageStr = PageStr &
" ›|"&vbcrlf
End If
PageStr = PageStr & "
maxlength=""4"" title=""定页"" size='4' onmouseover=""javascript:this.focus
();this.select()"" onKeyDown=""javascript: if(window.event.keyCode == 13)
window.location.href='" & strUrl & "page='+this.value"">"&vbcrlf
PageStr = PageStr & "
(document.getElementById('page')) window.location.href='" & strUrl &
"Page='+document.getElementById('page').value"">"&vbcrlf
PageStr = PageStr &
"
、上十页、下十页、尾页以及中间一段页码
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
p = (xCurrentPage - 1) 10
If xCurrentPage = 1 Then
PageStr = PageStr &
" |‹"
Else
PageStr = PageStr &
"
class=""FirstPage"">|‹
End If
If p * 10 > 0 Then
PageStr = PageStr &
"
页"" class=""PrevPage"">«
End If
For i=(p * 10 + 1) To (p *
10 + 10)
If i = xCurrentPage
Then
PageStr =
PageStr & " [" & i &
"]"
Else
PageStr =
PageStr & "
i & "页"" class=""GoToPage"">" & i & "
End If
If i = xPageCount
Then Exit For
Next
If i < xPageCount Then
PageStr = PageStr & "
下十页"" class=""NextPage"">»
If xCurrentPage = xPageCount
Then
PageStr = PageStr &
" ›|"
Else
PageStr = PageStr &
"
class=""LastPage"">›|
End If
PageStr = PageStr &
"
和尾页的页码、中间显示一部分页码
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
If xCurrentPage > 4 Then
PageStr = PageStr & " [
class=""FirstPage"">1
If xCurrentPage < PageCount
- 3 Then PageTo = xCurrentPage + 3 Else PageTo = xPageCount
For i=xCurrentPage - 3 To
PageTo
If i >= 1 Then
If i =
xCurrentPage Then
PageStr = PageStr & " [" &
i & "]"
Else
PageStr = PageStr & " [
class=""GoToPage"">" & i & "
End If
End If
Next
If xCurrentPage < xPageCount
- 3 Then PageStr = PageStr & " ...
& xPageCount & """ class=""LastPage"">" & xPageCount & "
PageStr = PageStr &
"
、上一页、下一页、末页,均为汉字和转到页的选择列表
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
If xCurrentPage > 1 Then
PageStr = PageStr &
"
title=""首页"" class=""FirstPage"">首页
PageStr = PageStr &
"
xCurrentPage - 1 & """ title=""上一页"" class=""FirstPage"">上一页
Else
PageStr = PageStr &
" 首页"
PageStr = PageStr &
" 上一页"
End If
If xCurrentPage < xPageCount
Then
PageStr = PageStr &
"
xCurrentPage + 1 & """ title=""下一页"" class=""NextPage"">下一页
PageStr = PageStr &
"
xPageCount & """ title=""末页"" class=""LastPage"">末页
Else
PageStr = PageStr &
" 下一页"
PageStr = PageStr &
" 末页"
End If
PageStr = PageStr &
"
value=""" & xMaxPerPage & """ onKeyPress=""if (event.keyCode==13)
window.location.href='" & strUrl & "MaxPerPage='+this.value;""> " &
xUnitName & "/页"&vbcrlf
PageStr = PageStr & "
转到:"&vbcrlf
PageStr = PageStr &
"
、上一页、下一页、末页,数字页和转向文本框
PageStr = PageStr & "
id=""ShowPage"">" class=""TotalPage"">全部"&xPageName&":" & xTotalNum &"" & xUnitName & "
PageStr = PageStr & "
PageStr = PageStr &
" 页次:" & xCurrentPage & "/" & xPageCount &
""
PageStr = PageStr &
" "&xMaxPerPage&xUnitName&"/页"
p = (xCurrentPage - 1) 10
If xCurrentPage = 1 Then
PageStr = PageStr &
" |‹"
Else
PageStr = PageStr &
"
class=""FirstPage"">|‹
End If
If p * 10 > 0 Then
PageStr = PageStr &
"
页"" class=""PrevPage"">«
End If
For i=(p * 10 + 1) To (p *
10 + 10)
If i = xCurrentPage
Then
PageStr =
PageStr & " [" & i &
"]"
Else
PageStr =
PageStr & " [
i & "页"" class=""GoToPage"">" & i & "
End If
If i = xPageCount
Then Exit For
Next
If i < xPageCount Then
PageStr = PageStr & "
下十页"" class=""NextPage"">»
If xCurrentPage = xPageCount
Then
PageStr = PageStr &
" ›|"&vbcrlf
Else
PageStr = PageStr &
" [
class=""LastPage"">›|
End If
PageStr = PageStr & "
转到:
""" maxlength=""4"" title=""定页"" onmouseover=""javascript:this.focus
();this.select()"" onKeyDown=""javascript: if(window.event.keyCode == 13)
window.location.href='" & strUrl & "Page='+this.value"">页"&vbcrlf
PageStr = PageStr &
"
End Select
End If
Else
PageStr = " "&vbcrlf
End If
ShowPage = PageStr
End Function
End Class
%>
迷你世界越南服 安卓版v1.7.15
迷你世界越南服是一款精美的3D沙盒游戏,拥有极高的创作自由度
糖饼外传内置菜单 安卓版v1.0.87
糖饼外传内置菜单是一款非常好玩的模拟经营类手游,玩家在游戏中
我的世界化学交换空岛整合包 最新版v1.0
我的世界化学交换空岛整合包是一款像素风格的沙盒生存游戏,游戏
创造厨房免广告版 v1.0.10
创造厨房无广告版是一款像素风模拟经营类手游,玩家们将在这里化
SimCity BuildIt无限金币版 安卓修改版v1.60.1.133743
SimCity BuildIt无限金币版是经过破解的版本,在