此方法由何昕絕對提供
具体修改方法如下:
打开include\function.asp 文件
找到
程序代码: [ 复制代码到剪贴板 ]
此方法由何昕絕對提供
具体修改方法如下:
打开include\function.asp 文件
找到
程序代码: [ 复制代码到剪贴板 ]
Function MultiPage(Numbers,Perpage,Curpage,Url_Add) '分页函数
CurPage=Int(Curpage)
Dim URL
URL=Request.ServerVariables("Script_Name")&Url_Add
MultiPage=""
Dim Page,Offset,PageI
If Int(Numbers)>Int(PerPage) Then
Page=10
Offset=2
Dim Pages,FromPage,ToPage
If Numbers Mod Cint(Perpage)=0 Then
Pages=Int(Numbers/Perpage)
Else
Pages=Int(Numbers/Perpage)+1
End If
FromPage=Curpage-Offset
ToPage=Curpage+Page-Offset-1
If Page>Pages Then
FromPage=1
ToPage=Pages
Else
If FromPage<1 Then
Topage=Curpage+1-FromPage
FromPage=1
If (ToPage-FromPage)
FromPage =Curpage-Pages +ToPage
ToPage=Pages
If (ToPage-FromPage)
End If
MultiPage=" "
For PageI=FromPage TO ToPage
If PageI<>CurPage Then
MultiPage=MultiPage&"["&PageI&"] "
Else
MultiPage=MultiPage&"["&PageI&"] "
End If
Next
If Int(Pages)>Int(Page) Then
MultiPage=MultiPage&" ... ["&pages&"] "
Else
MultiPage=MultiPage&" "
End If
End If
End Function
在后面添加:
程序代码: [ 复制代码到剪贴板 ]
Function MultiPage_l(Numbers,Perpage,Curpage,Url_Add) '列表分页函数
CurPage=Int(Curpage)
Dim URL
URL=Request.ServerVariables("Script_Name")&Url_Add
MultiPage_l=""
Dim Page,Offset,PageI
If Int(Numbers)>Int(PerPage) Then
Page=10
Offset=2
Dim Pages,FromPage,ToPage
If Numbers Mod Cint(Perpage)=0 Then
Pages=Int(Numbers/Perpage)
Else
Pages=Int(Numbers/Perpage)+1
End If
FromPage=Curpage-Offset
ToPage=Curpage+Page-Offset-1
If Page>Pages Then
FromPage=1
ToPage=Pages
Else
If FromPage<1 Then
Topage=Curpage+1-FromPage
FromPage=1
If (ToPage-FromPage)
FromPage =Curpage-Pages +ToPage
ToPage=Pages
If (ToPage-FromPage)
End If
MultiPage_l=" "
For PageI=FromPage TO ToPage
If PageI<>CurPage Then
MultiPage_l=MultiPage_l&"["&PageI&"] "
Else
MultiPage_l=MultiPage_l&"["&PageI&"] "
End If
Next
If Int(Pages)>Int(Page) Then
MultiPage_l=MultiPage_l&" ... ["&pages&"] "
Else
MultiPage_l=MultiPage_l&" "
End If
End If
End Function
打开default.asp
找到
Dim Log_Num,MultiPages,PageCount
MultiPages=""&MultiPage(Log_Num,blogPerPage,CurPage,Url_Add)&""
修改为
程序代码: [ 复制代码到剪贴板 ]
Dim Log_Num,MultiPages,PageCount
if viewMode="list" Then
MultiPages=""&MultiPage_l(Log_Num,blogPerPage,CurPage,Url_Add)&""
else
MultiPages=""&MultiPage(Log_Num,blogPerPage,CurPage,Url_Add)&""
end if