In message <[EMAIL PROTECTED]>, Bob
Sawyer <[EMAIL PROTECTED]> writes
>I'm dealing with a situation where I can potentially have over 3000
>results to display from a database. I'm successfully paginating the
>results, 10 at a time, but don't want to display 300+ page links at the
>bottom.
>
>How can I group the pages to show, for example, the first 10 pages,
>followed by a "next 10" link?
>
>i.e., Page: 1 2 3 4 5 6 7 8 9 10 > >> Next 10
>
>  // don't show the current page as a link


Not quite what you asked for, but simpler for visitors, I believe, is 
[last 5 pages] [this page] [next 5 pages]

so if we are on page 15,
10 11 12 13 14 [15] 16 17 18 19 20

>  for ($i = 1; $i <= $num_pages; $i++) {

  for ($i = $current_page-5; $i <= $current_page+5; $i++) {
>    $next_start = $start + $display_num;
>    if ($i != $current_page) {
(and not less than 1 and not greater than num_pages)

I would also add a [first page] and [last page] where they are not
visible in the above

-- 
Pete Clark

Free advertising for your website, business, or organisation at:
http://www.hotcosta.com/resources.php




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to