jk_page_view.asp

来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 443 行

ASP
443
字号
<!-- #include file="jk_page_cute.asp" -->
<%
'****************************************************
' 玫瑰情缘 2006v3.0      power by www.meigui8.cn
' email: 556248@qq.com  , 100053555@qq.com
' web: http://www.meigui8.cn
' copyright (c) 2006 meigui8.cn all rights reserved.
'****************************************************
function articlecontent()	
        select case paginationtype
		case 0    '不分页显示
          articlecontent=word                        
		case 1    '自动分页显示
		  articlecontent=autopagination()
		case 2    '手动分页显示
		  articlecontent=manualpagination()
	end select
end function

function manualpagination()   '手动分页显示
	dim articleid,strcontent,currentpage,strfilename,tmp
	dim contentlen,maxperpage,pages,i
	dim arrcontent
        strcontent=word
	contentlen=len(strcontent)
	currentpage=trim(request("page"))
		arrcontent=split(strcontent,"[pagecute]")

		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

		tmp=arrcontent(currentpage-1)

		tmp=tmp&"</p><p align='center'>"
		tmp=tmp& jk_pagecute("",pages,currentpage,"?id="&id&"&",5,"#ff0000")
		tmp=tmp&"</p>"
     manualpagination=tmp
end function

function autopagination() '自动分页显示 
	dim articleid,strcontent,currentpage,strfilename,tmp
	dim contentlen,maxperpage,pages,i,lngbound
	dim beginpoint,endpoint
        strcontent=word
  	contentlen=len(strcontent)
	currentpage=trim(request("page"))
	    if currentpage="" then
			currentpage=1
		else
			currentpage=cint(currentpage)
		end if
		pages=contentlen\maxcharperpage
		if maxcharperpage*pages<contentlen then
			pages=pages+1
		end if
	lngbound=contentlen          '最大误差范围
		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=maxcharperpage*(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=maxcharperpage*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
		tmp=tmp&mid(strcontent,beginpoint,endpoint-beginpoint)
		
		tmp=tmp&"</p><p align='center'>"
		tmp=tmp& jk_pagecute("",pages,currentpage,""&strfilename&"?id="&id&"&",5,"#ff0000")
		tmp=tmp&"</p>"
     autopagination=tmp
end function
'****************************************************
' 玫瑰情缘 2006v3.0      power by www.meigui8.cn
' email: 556248@qq.com  , 100053555@qq.com
' web: http://www.meigui8.cn
' copyright (c) 2006 meigui8.cn all rights reserved.
'****************************************************
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?