Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

Matts
  (email not shown publicly)

I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Tuesday July 08, 2003
08:21 AM

Paginating - page links algorithms

[ #13324 ]

I'm displaying a series of pages of results from a search query. Data::Page rocks for doing the nitty gritty details. But what Data::Page doesn't do for you is give you a simple algorithm for links to multiple pages where you don't want to overflow the page with links.

I'm probably not being clear, so an example will help.

You might have 100 pages of results. I don't want to show links for 1..100 at the bottom of my page. I want something more like what google does - shows you a limit around the current page you're on. So if you're on page 33, you get links for pages 30..40 (with 33 highlighted) and the rest you can see by moving through the list.

Has anyone created a simple algorithm for something like that? Am I missing a key module from CPAN?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.