动网论坛一个数字分页的函数

本文介绍了一种使用VBScript编写的数字分页Functionpageline,该函数能够根据当前页数和总页数生成分页链接。通过判断当前页的位置来显示省略号,实现了简洁的分页导航。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

'数字分页
Function pageline(CurrentPage,Pcount)'CurrentPage当前页,Pcount页总数
dim Endpage
Endpage=0
if (CurrentPage > 4) then
response.write ("<a href=?page=1&action=inbox>[1]</a> ...")
end if
if (Pcount>CurrentPage+3) then

Endpage=CurrentPage+3
else
Endpage=Pcount
end if
for i=CurrentPage-3 to Endpage
if (i>=1) then
if (i = CurrentPage) then
response.write ("<font color=#FF0000>["&i&"]</font>")
else
response.write ("<a href=?page="&i&"&action=inbox>["&i&"]</a>")
end if
end if
next
if (CurrentPage+3 < Pcount) then
response.write ("...<a href=?page="&Pcount&"action=inbox>["&Pcount&"]</a>")
end if
if (Endpage = 0) then
response.write ("...")
end if
end function
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值