📄 ms_page.asp
字号:
<%
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
Function AuToShowContentPage(fieldname,requestid,requestcontent,url)
dim ArticleID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i,lngBound
dim BeginPoint,EndPoint,MaxPerPage_Content,ShowContentByPage
ShowContentByPage="Yes" '文章内容是否分页显示
MaxPerPage_Content=2500 '每页显示大约字符数
ArticleID=requestid
strContent=requestcontent
ContentLen=len(strContent)
CurrentPage=trim(request.querystring("showpage"))
If ShowContentByPage="No" or ContentLen<=MaxPerPage_Content Then
str2=strContent
If ShowContentByPage="Yes" Then
str2=str2+""
End If
Else
If CurrentPage="" Then
CurrentPage=1
Else
CurrentPage=Cint(CurrentPage)
End If
pages=ContentLen\MaxPerPage_Content
If MaxPerPage_Content*pages<ContentLen Then
pages=pages+1
End If
lngBound=MaxPerPage_Content '最大误差范围
If CurrentPage<1 Then CurrentPage=1
If CurrentPage>pages Then CurrentPage=pages
dim lngTemp
dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3
dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2
dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2
dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2
dim lngTemp5,lngTemp5_1,lngTemp5_2
dim lngTemp6,lngTemp6_1,lngTemp6_2
If CurrentPage=1 Then
BeginPoint=1
Else
BeginPoint=MaxPerPage_Content*(CurrentPage-1)+1
lngTemp1_1_1=instr(BeginPoint,strContent,"</table>",1)
lngTemp1_1_2=instr(BeginPoint,strContent,"</TABLE>",1)
lngTemp1_1_3=instr(BeginPoint,strContent,"</Table>",1)
If lngTemp1_1_1>0 Then
lngTemp1_1=lngTemp1_1_1
ElseIf lngTemp1_1_2>0 Then
lngTemp1_1=lngTemp1_1_2
ElseIf lngTemp1_1_3>0 Then
lngTemp1_1=lngTemp1_1_3
Else
lngTemp1_1=0
End If
lngTemp1_2_1=instr(BeginPoint,strContent,"<table",1)
lngTemp1_2_2=instr(BeginPoint,strContent,"<TABLE",1)
lngTemp1_2_3=instr(BeginPoint,strContent,"<Table",1)
If lngTemp1_2_1>0 Then
lngTemp1_2=lngTemp1_2_1
ElseIf lngTemp1_2_2>0 Then
lngTemp1_2=lngTemp1_2_2
ElseIf lngTemp1_2_3>0 Then
lngTemp1_2=lngTemp1_2_3
Else
lngTemp1_2=0
End If
If lngTemp1_1=0 and lngTemp1_2=0 Then
lngTemp1=BeginPoint
Else
If lngTemp1_1>lngTemp1_2 Then
lngtemp1=lngTemp1_2
Else
lngTemp1=lngTemp1_1+8
End If
End If
lngTemp2_1_1=instr(BeginPoint,strContent,"</p>",1)
lngTemp2_1_2=instr(BeginPoint,strContent,"</P>",1)
If lngTemp2_1_1>0 Then
lngTemp2_1=lngTemp2_1_1
ElseIf lngTemp2_1_2>0 Then
lngTemp2_1=lngTemp2_1_2
Else
lngTemp2_1=0
End If
lngTemp2_2_1=instr(BeginPoint,strContent,"<p",1)
lngTemp2_2_2=instr(BeginPoint,strContent,"<P",1)
If lngTemp2_2_1>0 Then
lngTemp2_2=lngTemp2_2_1
ElseIf lngTemp2_2_2>0 Then
lngTemp2_2=lngTemp2_2_2
Else
lngTemp2_2=0
End If
If lngTemp2_1=0 and lngTemp2_2=0 Then
lngTemp2=BeginPoint
Else
If lngTemp2_1>lngTemp2_2 Then
lngtemp2=lngTemp2_2
Else
lngTemp2=lngTemp2_1+4
End If
End If
lngTemp3_1_1=instr(BeginPoint,strContent,"</ur>",1)
lngTemp3_1_2=instr(BeginPoint,strContent,"</UR>",1)
If lngTemp3_1_1>0 Then
lngTemp3_1=lngTemp3_1_1
ElseIf lngTemp3_1_2>0 Then
lngTemp3_1=lngTemp3_1_2
Else
lngTemp3_1=0
End If
lngTemp3_2_1=instr(BeginPoint,strContent,"<ur",1)
lngTemp3_2_2=instr(BeginPoint,strContent,"<UR",1)
If lngTemp3_2_1>0 Then
lngTemp3_2=lngTemp3_2_1
ElseIf lngTemp3_2_2>0 Then
lngTemp3_2=lngTemp3_2_2
Else
lngTemp3_2=0
End If
If lngTemp3_1=0 and lngTemp3_2=0 Then
lngTemp3=BeginPoint
Else
If lngTemp3_1>lngTemp3_2 Then
lngtemp3=lngTemp3_2
Else
lngTemp3=lngTemp3_1+5
End If
End If
If lngTemp1<lngTemp2 Then
lngTemp=lngTemp2
Else
lngTemp=lngTemp1
End If
If lngTemp<lngTemp3 Then
lngTemp=lngTemp3
End If
If lngTemp>BeginPoint and lngTemp<=BeginPoint+lngBound Then
BeginPoint=lngTemp
Else
lngTemp4_1_1=instr(BeginPoint,strContent,"</li>",1)
lngTemp4_1_2=instr(BeginPoint,strContent,"</LI>",1)
If lngTemp4_1_1>0 Then
lngTemp4_1=lngTemp4_1_1
ElseIf lngTemp4_1_2>0 Then
lngTemp4_1=lngTemp4_1_2
Else
lngTemp4_1=0
End If
lngTemp4_2_1=instr(BeginPoint,strContent,"<li",1)
lngTemp4_2_1=instr(BeginPoint,strContent,"<LI",1)
If lngTemp4_2_1>0 Then
lngTemp4_2=lngTemp4_2_1
ElseIf lngTemp4_2_2>0 Then
lngTemp4_2=lngTemp4_2_2
Else
lngTemp4_2=0
End If
If lngTemp4_1=0 and lngTemp4_2=0 Then
lngTemp4=BeginPoint
Else
If lngTemp4_1>lngTemp4_2 Then
lngtemp4=lngTemp4_2
Else
lngTemp4=lngTemp4_1+5
End If
End If
If lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound Then
BeginPoint=lngTemp4
Else
lngTemp5_1=instr(BeginPoint,strContent,"<img",1)
lngTemp5_2=instr(BeginPoint,strContent,"<IMG",1)
If lngTemp5_1>0 Then
lngTemp5=lngTemp5_1
ElseIf lngTemp5_2>0 Then
lngTemp5=lngTemp5_2
Else
lngTemp5=BeginPoint
End If
If lngTemp5>BeginPoint and lngTemp5<BeginPoint+lngBound Then
BeginPoint=lngTemp5
Else
lngTemp6_1=instr(BeginPoint,strContent,"<br>",1)
lngTemp6_2=instr(BeginPoint,strContent,"<BR>",1)
If lngTemp6_1>0 Then
lngTemp6=lngTemp6_1
ElseIf lngTemp6_2>0 Then
lngTemp6=lngTemp6_2
Else
lngTemp6=0
End If
If lngTemp6>BeginPoint and lngTemp6<BeginPoint+lngBound Then
BeginPoint=lngTemp6+4
End If
End If
End If
End If
End If
If CurrentPage=pages Then
EndPoint=ContentLen
Else
EndPoint=MaxPerPage_Content*CurrentPage
If EndPoint>=ContentLen Then
EndPoint=ContentLen
Else
lngTemp1_1_1=instr(EndPoint,strContent,"</table>",1)
lngTemp1_1_2=instr(EndPoint,strContent,"</TABLE>",1)
lngTemp1_1_3=instr(EndPoint,strContent,"</Table>",1)
If lngTemp1_1_1>0 Then
lngTemp1_1=lngTemp1_1_1
ElseIf lngTemp1_1_2>0 Then
lngTemp1_1=lngTemp1_1_2
ElseIf lngTemp1_1_3>0 Then
lngTemp1_1=lngTemp1_1_3
Else
lngTemp1_1=0
End If
lngTemp1_2_1=instr(EndPoint,strContent,"<table",1)
lngTemp1_2_2=instr(EndPoint,strContent,"<TABLE",1)
lngTemp1_2_3=instr(EndPoint,strContent,"<Table",1)
If lngTemp1_2_1>0 Then
lngTemp1_2=lngTemp1_2_1
ElseIf lngTemp1_2_2>0 Then
lngTemp1_2=lngTemp1_2_2
ElseIf lngTemp1_2_3>0 Then
lngTemp1_2=lngTemp1_2_3
Else
lngTemp1_2=0
End If
If lngTemp1_1=0 and lngTemp1_2=0 Then
lngTemp1=EndPoint
Else
If lngTemp1_1>lngTemp1_2 Then
lngtemp1=lngTemp1_2-1
Else
lngTemp1=lngTemp1_1+7
End If
End If
lngTemp2_1_1=instr(EndPoint,strContent,"</p>",1)
lngTemp2_1_2=instr(EndPoint,strContent,"</P>",1)
If lngTemp2_1_1>0 Then
lngTemp2_1=lngTemp2_1_1
ElseIf lngTemp2_1_2>0 Then
lngTemp2_1=lngTemp2_1_2
Else
lngTemp2_1=0
End If
lngTemp2_2_1=instr(EndPoint,strContent,"<p",1)
lngTemp2_2_2=instr(EndPoint,strContent,"<P",1)
If lngTemp2_2_1>0 Then
lngTemp2_2=lngTemp2_2_1
ElseIf lngTemp2_2_2>0 Then
lngTemp2_2=lngTemp2_2_2
Else
lngTemp2_2=0
End If
If lngTemp2_1=0 and lngTemp2_2=0 Then
lngTemp2=EndPoint
Else
If lngTemp2_1>lngTemp2_2 Then
lngTemp2=lngTemp2_2-1
Else
lngTemp2=lngTemp2_1+3
End If
End If
lngTemp3_1_1=instr(EndPoint,strContent,"</ur>",1)
lngTemp3_1_2=instr(EndPoint,strContent,"</UR>",1)
If lngTemp3_1_1>0 Then
lngTemp3_1=lngTemp3_1_1
ElseIf lngTemp3_1_2>0 Then
lngTemp3_1=lngTemp3_1_2
Else
lngTemp3_1=0
End If
lngTemp3_2_1=instr(EndPoint,strContent,"<ur",1)
lngTemp3_2_2=instr(EndPoint,strContent,"<UR",1)
If lngTemp3_2_1>0 Then
lngTemp3_2=lngTemp3_2_1
ElseIf lngTemp3_2_2>0 Then
lngTemp3_2=lngTemp3_2_2
Else
lngTemp3_2=0
End If
If lngTemp3_1=0 and lngTemp3_2=0 Then
lngTemp3=EndPoint
Else
If lngTemp3_1>lngTemp3_2 Then
lngtemp3=lngTemp3_2-1
Else
lngTemp3=lngTemp3_1+4
End If
End If
If lngTemp1<lngTemp2 Then
lngTemp=lngTemp2
Else
lngTemp=lngTemp1
End If
If lngTemp<lngTemp3 Then
lngTemp=lngTemp3
End If
If lngTemp>EndPoint and lngTemp<=EndPoint+lngBound Then
EndPoint=lngTemp
Else
lngTemp4_1_1=instr(EndPoint,strContent,"</li>",1)
lngTemp4_1_2=instr(EndPoint,strContent,"</LI>",1)
If lngTemp4_1_1>0 Then
lngTemp4_1=lngTemp4_1_1
ElseIf lngTemp4_1_2>0 Then
lngTemp4_1=lngTemp4_1_2
Else
lngTemp4_1=0
End If
lngTemp4_2_1=instr(EndPoint,strContent,"<li",1)
lngTemp4_2_1=instr(EndPoint,strContent,"<LI",1)
If lngTemp4_2_1>0 Then
lngTemp4_2=lngTemp4_2_1
ElseIf lngTemp4_2_2>0 Then
lngTemp4_2=lngTemp4_2_2
Else
lngTemp4_2=0
End If
If lngTemp4_1=0 and lngTemp4_2=0 Then
lngTemp4=EndPoint
Else
If lngTemp4_1>lngTemp4_2 Then
lngtemp4=lngTemp4_2-1
Else
lngTemp4=lngTemp4_1+4
End If
End If
If lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound Then
EndPoint=lngTemp4
Else
lngTemp5_1=instr(EndPoint,strContent,"<img",1)
lngTemp5_2=instr(EndPoint,strContent,"<IMG",1)
If lngTemp5_1>0 Then
lngTemp5=lngTemp5_1-1
ElseIf lngTemp5_2>0 Then
lngTemp5=lngTemp5_2-1
Else
lngTemp5=EndPoint
End If
If lngTemp5>EndPoint and lngTemp5<EndPoint+lngBound Then
EndPoint=lngTemp5
Else
lngTemp6_1=instr(EndPoint,strContent,"<br>",1)
lngTemp6_2=instr(EndPoint,strContent,"<BR>",1)
If lngTemp6_1>0 Then
lngTemp6=lngTemp6_1+3
ElseIf lngTemp6_2>0 Then
lngTemp6=lngTemp6_2+3
Else
lngTemp6=EndPoint
End If
If lngTemp6>EndPoint and lngTemp6<EndPoint+lngBound Then
EndPoint=lngTemp6
End If
End If
End If
End If
End If
End If
str2= mid(strContent,BeginPoint,EndPoint-BeginPoint)
str2=str2+ "</p><p align='center'>"
If CurrentPage>1 Then
str2=str2+ "<a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&CurrentPage-1&"'>上一页</a> "
End If
For i=1 To pages
If i=CurrentPage Then
str2=str2+ "<span class='key_font'>["&cstr(i)&"]</span> "
Else
str2=str2+ "<a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&i&"'>["&i&"]</a> "
End If
Next
If CurrentPage<pages Then
str2=str2+ " <a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&CurrentPage+1&"'>下一页</a>"
End If
str2=str2+ "</p>"
End If
AuToShowContentPage=str2
End function
Function FingerShowContentPage(fieldname,requestid,requestcontent,url)
dim ArticleID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i
dim arrContent
ArticleID=requestid
strContent=requestcontent
ContentLen=len(strContent)
CurrentPage=trim(request.querystring("showpage"))
If Instr(strContent,"[NextPage]")<=0 Then
str2=strContent
Else
arrContent=split(strContent,"[NextPage]")
pages=Ubound(arrContent)+1
If CurrentPage="" Then
CurrentPage=1
Else
CurrentPage=Cint(CurrentPage)
End If
If CurrentPage<1 Then CurrentPage=1
If CurrentPage>pages Then CurrentPage=pages
str2=arrContent(CurrentPage-1)
str2=str2+"</p><p align='center'>"
If CurrentPage>1 Then
str2=str2+"<a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&CurrentPage-1&"'>上一页</a> "
End If
For i=1 To pages
If i=CurrentPage Then
str2=str2+"<span class='key_font'>["&cstr(i)&"]</span> "
Else
str2=str2+"<a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&i&"'>["&i&"]</a> "
End If
Next
If CurrentPage<pages Then
str2=str2+" <a href='"&url&"?"&fieldname&"="&ArticleID&"&showpage="&CurrentPage+1&"'>下一页</a>"
End If
str2=str2+"</p>"
End If
FingerShowContentPage=str2
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -