ASP: Smart paging with super long characters

Source: Internet
Author: User
Paging

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 loops several times, calculates page numbers and joins libraries every 4000 minutes.
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, there are two results, one is the 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>
<TD bgcolor= "#DEDBD6" height= ">"
Entry success </TD></TR><TR><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.