'=================================================
'函数名:autopage
'作 用:长文章自动分页
'参 数:id,content,urlact
'=================================================
Function AutoPage(content,paramater,pagevar)
contentStr=split(content,pagevar)
pagesize=ubound(contentStr)
if pagesize>0 then
If Int(Request("page"))="" or Int(Request("page"))=0 Then
pageNum=1
Else
pageNum=Request("page")
End if
if pageNum-1<=pagesize then
AutoPage=AutoPage&contentStr(pageNum-1)
AutoPage=AutoPage&"<div style=""margin-top:10px;text-align:right;padding-right:15px;""><font color=blue>页码:</font><font color=red>"
For i=0 to pagesize
if i=pageNum-1 then
AutoPage=AutoPage&"[<font color=red>"&i+1&"</font>] "
else
if instr(paramater,"?")>0 then
AutoPage=AutoPage&"<a href="""¶mater&"&page="&i+1&""">["&(i+1)&"]</a>"
else
AutoPage=AutoPage&"<a href="""¶mater&"?page="&i+1&""">["&(i+1)&"]</a>"
end if
end if
Next
AutoPage=AutoPage&"</font></div>"
else
AutoPage=AutoPage&"非法操作!页号超出!<a href=javascript:history.back(-1)><u>返回</u></a>"
end if
Else
AutoPage=content
end if
End Function
End Class
%>









