Smart paging with super long characters-HTML support

Source: Internet
Author: User
Tags microsoft frontpage
Page probably in 99 when the game site, on the release of the article feel trouble, but then play ASP not fine. Just going to use it. In the face of long file 10000 words when the Web page is a large long.

Last year, when I was working on a common article and news management system, I wrote a piece of code to separate it. Now stick it out.

To illustrate the following:

My article Entry interface is web-based Hemleditor, similar to the ABC code here. So the actual submission is HTML-formatted text.

The HTML is processed appropriately and is not cut out of the HTML code.

Here another brother once published a principle, but I did not read it carefully, I do not know what is different.


The code is as follows:
--------------------------------------
' Request Form Item
I_forder = Request.Form ("I_folder")
I_topic = Request.Form ("I_topic")
I_title = HTMLEncode (Request.Form ("I_title"))
I_body = Request.Form ("Body")
I_source = Request.Form ("I_source")
I_keyword= HTMLEncode (Request.Form ("I_keyword"))
I_ishot = Request.Form ("Ishot")
If I_ishot = "" Then i_ishot= "N"
I_ispic = Request.Form ("Ispic")
If I_ispic = "" Then I_ispic = "N"
I_pic = Request.Form ("Insertimage")
I_body = replace (i_body, "Contenteditable=true", "Contenteditable=false")

' Check Input
'......

' Get Pages, B = Body
B_len = Len (i_body)
B_pages = 1
' T = Temp
T_loop = True

Do While T_loop ' here Loop multiple times, every 4000 minutes, calculate the page number and join the library.
IF B_len > 4000 Then
N_body = Left (i_body,4000) ' N = New
' If ' <p ' in N_body,else ' > ' in N_body
If InStrRev (n_body, "<p") > 0 and (Len (n_body)-InStrRev (N_body, "<p")) < Then
N_body = Left (N_body,instrrev (N_body, "<p")-1)
else if InStrRev (N_body, "") > 0 and (Len (n_body)-InStrRev (N_body, "")) < Then
N_body = Left (N_body,instrrev (N_body, "")-1)
Else If InStrRev (N_body, ". ") > 0 and (Len (n_body)-InStrRev (N_body). ) < Then
N_body = Left (N_body,instrrev (N_body, ". "))
Else If InStrRev (N_body, ";") > 0 and (Len (n_body)-InStrRev (N_body, ";")) < Then
N_body = Left (N_body,instrrev (N_body, ";"))
else if InStrRev (N_body, ",") > 0 and (Len (n_body)-InStrRev (N_body, ",")) < Then
N_body = Left (N_body,instrrev (N_body, ","))
else if InStrRev (N_body, ".") > 0 and (Len (n_body)-InStrRev (N_body, ".")) < Then
N_body = Left (N_body,instrrev (N_body, "."))
End If
End If
End If
End If
End If
End If

N_len = Len (n_body)
I_body = Mid (i_body,n_len+1)
B_len = Len (i_body)

Else
N_body = I_body
T_loop = False
End If


' Add to database '
Exec_prc_content_ins i_forder,i_topic,i_title,i_source,n_body,i_ispic,i_pic,i_ishot,i_keyword,b_pages

' Here a function, you can handle it, anyway, the result has two, one is body, one is b_pages, is the page number.


B_pages = b_pages + 1

Loop


%>


<meta name= "generator" content= "Microsoft FrontPage 5.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> New Page 1</title>
<link rel= "stylesheet" type= text/css "href=". /css/default.css ">

<body>

<div align= "center" >
<center>

<table border=1 width= "height=" 128 "bordercolor=" #000000 "cellspacing=" 0 "cellpadding=" 0 "style=" Border-collapse:collapse "><tr>
&LT;TD bgcolor= "#DEDBD6" height= ">"
Entry success &LT;/TD&GT;&LT;/TR&GT;&LT;TR&GT;&LT;TD height= ">"
<p align= "Center" > This article is divided into <%=B_Pages-1%> pages
</td></tr></table>


</center>
</div>
<script>
Top.main_top.location.reload ();
</script>

</body>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.