懂你所需,做你所想
当前位置:首页 > 新闻资讯 > 网站建设 > ASP:超长字符的智能分页

ASP:超长字符的智能分页

发表日期:2010-2-9 11:51:34文章编辑:合肥搜联广告设计浏览次数:

    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 这里loop多次,每4000分一页,算出页码并加入库。
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"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"<P")-1)
else if Instrrev(N_Body,"  ") > 0 and (Len(N_Body) - Instrrev(N_Body,"  "))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"  ")-1)
Else If Instrrev(N_Body,"。") > 0 and (Len(N_Body) - Instrrev(N_Body,"。"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"。"))
Else If Instrrev(N_Body,";") > 0 and (Len(N_Body) - Instrrev(N_Body,";"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,";"))
else if Instrrev(N_Body,",") > 0 and (Len(N_Body) - Instrrev(N_Body,","))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,","))
else if Instrrev(N_Body,".") > 0 and (Len(N_Body) - Instrrev(N_Body,"."))< 400 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

这里一个function,你可以自己处理,反正结果有两个,一个是body,一个是b_pages,就是页码。


B_Pages = B_Pages + 1

Loop


%>

<html>

<head>
<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>新建网页 1</title>
<link rel="stylesheet" type="text/css" href="../CSS/default.css">
</head>

<body>

<div align="center">
<center>

<table border=1 width="300" height="128" bordercolor="#000000" cellspacing="0" cellpadding="0" style="border-collapse: collapse"><tr>
<td bgcolor="#DEDBD6" height="31">
录入成功</td></tr><tr><td height="96">
<p align="center">此文章共分<%=B_Pages-1%>页
</td></tr></table>


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

</body>

相关新闻

使用asp代码突破163相册的

  ...

日期:2010-2-8 10:17:49 浏览次数:45

两种比较典型的ASP木马防范方

随着ASP 技术的发展,网络上基于ASP技术开发的网站越来越...

日期:2010-2-8 10:18:52 浏览次数:34

解决Jmail发送邮件标题出现

今天在做JMAIL发邮件的时候,接收到的邮件标题全是乱码,经在BAID...

日期:2010-2-8 10:19:37 浏览次数:47

ASP无组件上传图片代码

现在做网站我想不上传图片是不可能的了。但上传图片一也是最危险的一漏洞。...

日期:2010-2-9 9:39:05 浏览次数:41

ASP 中select cas

select case 是当一个值有多种判断情况时...

日期:2010-2-9 9:40:07 浏览次数:58

ASP链接SQL代码

<% ’on error resume&nb...

日期:2010-2-9 9:40:59 浏览次数:42