pixelDepth
asked on
Pagination
Hey guys,
I wondered if someone could give me a brief explanation on how to do pagination. Now it's not the standard pagination i'm trying to do. I can do...
1 2 3 4 5 6 7 8 9 10 etc
...But I would like to do this instead...
1 2 3 ... 11 12 13
Then if you click on page 3 it would turn to....
1 2 3 4 ... 11 12 13
etc.
Any help would be great.
Thanks :)
I wondered if someone could give me a brief explanation on how to do pagination. Now it's not the standard pagination i'm trying to do. I can do...
1 2 3 4 5 6 7 8 9 10 etc
...But I would like to do this instead...
1 2 3 ... 11 12 13
Then if you click on page 3 it would turn to....
1 2 3 4 ... 11 12 13
etc.
Any help would be great.
Thanks :)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks Guys
I managed to write my own class in the end to do it :D
I managed to write my own class in the end to do it :D
you want to count from page 1 to current page+1
so its
for ($nr=1; $nr <= $curpage+1; $nr++) {
echo $nr." ";
}
echo ("...");
$nr = $lastpage-3;
while ($nr <= $lastpage) {
echo $nr." ";
}
assuming you have $lastpage with the last page nummber and
$curpage with the current page number