日期:2014-05-17  浏览次数:20937 次

关于新闻分页问题?
有些新闻内容比较长,我想分不同的几页来显示,简短的就可以一页,长点的可以随意分2页或者3页,求一个比较好的分页方式,或者一种思路。

------解决方案--------------------
通过编辑时手动插入特定字符串作为分页符,然后页面显示时判断分页。
------解决方案--------------------
搜索一些文章分页的代码去参考一下!
------解决方案--------------------
利用数组怎么样呢.判断数组长度,如果大于某一值就把他剩余文章内容放到一个新数组中,然后再对剩下的文章判断,然后把数组显示出来.个人想法!!!
------解决方案--------------------
http://www.gzyd.net/client/aspcms/manager/newsoption.asp?id=22&action=add
admin
admin


新闻表加三字段
productPages //当前页码 下拉框 1 - 10 分十页足够用了吧
productPagesID //第一页ID 通过window.open打开个新页面来选择第一页新闻的ID
productPagesInfo //分页信息显示方式
//1系统自动加 [上一页 下一页]
//2通过编缉新闻内容加入[上一页 下一页]或在内容中某处自行链接


'分页开始 id是当前页新闻的id
if rs( "productPagesInfo ") then

productPages = query_array( "select productID from " & DB_PREFIX & "_t_product where (productTypeID= " & keytype & " and (productID in ( " & getUserProductIDPowerArray() & "))) and (productPagesID = " & iif(rs( "productPagesID ") = 0, id, rs( "productPagesID ")) & " or productID= " & iif(rs( "productPagesID ") = 0, id, rs( "productPagesID ")) & ") order by productPages asc ")

pagesPrevious = " "
pagesNext = " "

for i = lbound(productPages) to ubound(productPages)

if cdbl(id) = cdbl(productPages(i)) then
if i > 0 then
if pagesPrevious = " " then pagesPrevious = cstr(productPages(i - 1))
end if
if i < ubound(productPages) then
if pagesNext = " " then pagesNext = cstr(productPages(i + 1))
end if
end if

productPagesInfo = productPagesInfo & iif(cdbl(id) = cdbl(productPages(i)), " <span class= " "pages_current " "> ", " ") & "[ <a href= " "product.asp?keytype= " & keytype & "&id= " & cstr(productPages(i)) & " " "> " & cstr(i + 1) & " </a> ] " & iif(cdbl(id) = cdbl(productPages(i)), " </span> ", " ") & "&nbsp; "

if is_numeric(pagesPrevious) then
pagesPrevious = "[ <a href= " "product.asp?keytype= " & keytype & "&id= " & pagesPrevious & " " "> " & web_language( "language_Page_Previous ") & " </a> ]&nbsp; "
end if

if is_numeric(pagesNext) then
pagesNext = "[ <a href= " "product.asp?keytype= " & keytype & "&id= " & pagesNext & " " "> " & web_language( "language_Page_Next ") & " </a> ]&nbsp; "
end if
next

if ubound(productPages) > 0 then tpl.setVar "product.page ", pagesPrevious & productPagesInfo & pagesNext

end if
'分页结束



------解决方案--------------------
jianye112(http://hi.baidu.com/lael80)
拜托看明白人家要什么再发您老的长篇文章!
------解决方案--------------------
http://blog.csdn.net/xuStanly/archive/2006/09/10/1204808.aspx
本人始终认为我这个长文章分页类是最完美滴。
------解决方案--------------------