Re: John - > RE: pagenting logic to cut short
| From: | CPT John W. Holmes | Date: | Tue, 03 Jun 2003 17:49:29 +0000 |
| Subject: | Re: John - > RE: pagenting logic to cut short | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150037@lists.php.net to get a copy of this message | ||
> Thanks, its working fine now, actually a little better than I expected :-)
> Dont understand the logic though, if you find time point me to the correct
> place where i can read up and figure out the logic you used.
The logic isn't too hard. You're on page X. You show links to other pages
from X minus 5 to X plus 5. So if you're on page 15, you show links for
pages 10 - 20. Those adjust dynamically based upon the current value of
$page.
The min() and max() bits are just easy ways to ensure you don't create links
for pages below 1 or above $numofpages.
---John Holmes...