账号通
    

账号  

密码  

1838

查看

4

回复
主题:[求助]非科讯ASP分页代码,含表格时无法分页的问题 [收藏主题] 转到:  
冰雪 当前离线

112

主题

0

广播

0

粉丝
添加关注
级别:一年级

用户积分:815 分
登录次数:64 次
注册时间:2008/4/6
最后登录:2015/7/25
冰雪 发表于:2008/7/5 23:13:00   | 只看该作者 查看该作者主题 楼主 
科汛智能建站系统

分页代码:


<%
Const maxPagesize=1000    '设置分页字数


Function InsertPageBreak(strText)
 Dim strPagebreak,s,ss
 Dim i,IsCount,c,iCount,strTemp,Temp_String,Temp_Array
 strPagebreak="[hiweb_break]"
 s=strText
 If Len(s)<maxPagesize Then
  InsertPageBreak=s
 End If
 s=Replace(s, strPagebreak, "")
 s=Replace(s, "&nbsp;", "<&nbsp;>")
 s=Replace(s, "&gt;", "<&gt;>")
 s=Replace(s, "&lt;", "<&lt;>")
 s=Replace(s, "&quot;", "<&quot;>")
 s=Replace(s, "&#39;", "<&#39;>")
 If s<>"" and maxPagesize<>0 and InStr(1,s,strPagebreak)=0 then
  IsCount=True
  Temp_String=""
  For i= 1 To Len(s)
   c=Mid(s,i,1)
   If c="<" Then
    IsCount=False
   ElseIf c=">" Then
    IsCount=True
   Else
    If IsCount=True Then
     If Abs(Asc(c))>255 Then
      iCount=iCount+2
     Else
      iCount=iCount+1
     End If
     If iCount>=maxPagesize And i<Len(s) Then
      strTemp=Left(s,i)
      If CheckPagination(strTemp,"table|a|b>|i>|strong|div|span") then
       Temp_String=Temp_String & Trim(CStr(i)) & ","
       iCount=0
      End If
     End If
    End If
   End If 
  Next
  If Len(Temp_String)>1 Then Temp_String=Left(Temp_String,Len(Temp_String)-1)
  Temp_Array=Split(Temp_String,",")
  For i = UBound(Temp_Array) To LBound(Temp_Array) Step -1
   ss = Mid(s,Temp_Array(i)+1)
   If Len(ss) > 380 Then
    s=Left(s,Temp_Array(i)) & strPagebreak & ss
   Else
    s=Left(s,Temp_Array(i)) & ss
   End If
  Next
 End If
 s=Replace(s, "<&nbsp;>", "&nbsp;")
 s=Replace(s, "<&gt;>", "&gt;")
 s=Replace(s, "<&lt;>", "&lt;")
 s=Replace(s, "<&quot;>", "&quot;")
 s=Replace(s, "<&#39;>", "&#39;")
 InsertPageBreak=s
End Function


Function CheckPagination(strTemp,strFind)
 Dim i,n,m_ingBeginNum,m_intEndNum
 Dim m_strBegin,m_strEnd,FindArray
 strTemp=LCase(strTemp)
 strFind=LCase(strFind)
 If strTemp<>"" and strFind<>"" then
  FindArray=split(strFind,"|")
  For i = 0 to Ubound(FindArray)
   m_strBegin="<"&FindArray(i)
   m_strEnd  ="</"&FindArray(i)
   n=0
   do while instr(n+1,strTemp,m_strBegin)<>0
    n=instr(n+1,strTemp,m_strBegin)
    m_ingBeginNum=m_ingBeginNum+1
   Loop
   n=0
   do while instr(n+1,strTemp,m_strEnd)<>0
    n=instr(n+1,strTemp,m_strEnd)
    m_intEndNum=m_intEndNum+1
   Loop
   If m_intEndNum=m_ingBeginNum then
    CheckPagination=True
   Else
    CheckPagination=False
    Exit Function
   End If
  Next
 Else
  CheckPagination=False
 End If
End Function


Function ContentPagination(hiwebstr)
 Dim ContentLen, maxperpage, Paginate
 Dim arrContent, strContent, i
 Dim m_strFileUrl,m_strFileExt,ArticleID
 ArticleID=Request.QueryString("ID")
 strContent = InsertPageBreak(hiwebstr)
 ContentLen = Len(strContent)
 CurrentPage=Request.QueryString("Page")
 If CurrentPage="" Then CurrentPage=0
 If InStr(strContent, "[hiweb_break]") <= 0 Then
  ArticleContent = "<div id=""NewsContentLabel"" class=""NewsContent"">" & strContent & "</div><div id=""Message"" class=""Message""></div>"
 Else
  arrContent = Split(strContent, "[hiweb_break]")
  Paginate = UBound(arrContent) + 1
  If CurrentPage = 0 Then
   CurrentPage = 1
  Else
   CurrentPage = CLng(CurrentPage)
  End If
  If CurrentPage < 1 Then CurrentPage = 1
  If CurrentPage > Paginate Then CurrentPage = Paginate
  strContent = "<div id=""NewsContentLabel"" class=""NewsContent"">"& arrContent(CurrentPage - 1)


  ArticleContent = ArticleContent & strContent
  If UserArticle = True Then
   ArticleContent = ArticleContent & "</p></div><div id=""Message"" class=""Message""></div><p align=""center""><b>"
  Else
   ArticleContent = ArticleContent & "</p></div><p align=""center""><b>"
  End If
  If IsURLRewrite Then
   m_strFileUrl = ArticleID & "_"
  Else
   m_strFileExt = ""
   m_strFileUrl = "?id=" & ArticleID & "&Page="
  End If
  If CurrentPage > 1 Then
   If IsURLRewrite And (CurrentPage-1) = 1 Then
    ArticleContent = ArticleContent & "<a href="""& ArticleID & m_strFileExt & """>上一页</a>&nbsp;&nbsp;"
   Else
    ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & CurrentPage - 1 & m_strFileExt & """>上一页</a>&nbsp;&nbsp;"
   End If
  End If
  For i = 1 To Paginate
   If i = CurrentPage Then
    ArticleContent = ArticleContent & "<font color=""red"">[" & CStr(i) & "]</font>&nbsp;"
   Else
    If IsURLRewrite And i = 1 Then
     ArticleContent = ArticleContent & "<a href="""& ArticleID & m_strFileExt & """>[" & i & "]</a>&nbsp;"
    Else
     ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & i & m_strFileExt & """>[" & i & "]</a>&nbsp;"
    End if
   End If
  Next
  If CurrentPage < Paginate Then
   ArticleContent = ArticleContent & "&nbsp;<a href="""& m_strFileUrl & CurrentPage + 1 & m_strFileExt & """>下一页</a>"
  End If
  ArticleContent = ArticleContent & "</b></p>"
 End If
 Response.Write(ArticleContent)
End Function
%>


 


调用:<!--include file="AAA.asp"-->
在内容显示处 将原来的显示代码替换为: <%=ContentPagination(您以前的内容显示变量)%>。

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
冰雪 当前离线

112

主题

0

广播

0

粉丝
添加关注
级别:一年级

用户积分:815 分
登录次数:64 次
注册时间:2008/4/6
最后登录:2015/7/25
冰雪 发表于:2008/7/6 23:59:00   | 只看该作者 查看该作者主题 沙发 
科汛在线考试系统(NET)
自己顶,相信有人会教我!
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
冰雪 当前离线

112

主题

0

广播

0

粉丝
添加关注
级别:一年级

用户积分:815 分
登录次数:64 次
注册时间:2008/4/6
最后登录:2015/7/25
冰雪 发表于:2008/7/6 9:31:00   | 只看该作者 查看该作者主题 藤椅 
做在线知识付费 选科汛云开店
我的是简单的ASP,科讯通过标签调用,我的系统解析不了。
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
一生有你 当前离线

10439

主题

0

广播

18

粉丝
添加关注
级别:版主

用户积分:72521 分
登录次数:1969 次
注册时间:2006/7/1
最后登录:2021/8/25
一生有你 发表于:2008/7/5 23:31:00   | 只看该作者 查看该作者主题 板凳 
科汛在线商城系统(NET)
把科汛的拿去用好了
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
冰雪 当前离线

112

主题

0

广播

0

粉丝
添加关注
级别:一年级

用户积分:815 分
登录次数:64 次
注册时间:2008/4/6
最后登录:2015/7/25
冰雪 发表于:2008/7/5 23:16:00   | 只看该作者 查看该作者主题 报纸 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.18750秒 powered by KesionCMS 9.0