1 (edited by Kriminal 2005-06-25 20:15)

Topic: Paginate modification

Hi!

I want to change the way that number of pages are shown, removig the "..." and showing all the page numbers.
For example, if a post have 8 pages, they are shown like this: Pages: 1 2 3 ... 8
I'd like to show all of them: Pages: 1 2 3 4 5 6 7 8

I think it can be possible changing this part; but I couldn't be succesfull

if ($cur_page <= ($num_pages-3))
{
    if ($cur_page != ($num_pages-3))
        $pages[] = '…';

    $pages[] = '<a href="'.$link_to.'&p='.$num_pages.'">'.$num_pages.'</a>';
}

Somebody can help me?
Thanks so much !

2

Re: Paginate modification

And what if you have 50/100/200 pages?

3 (edited by scottywz 2005-06-26 00:24)

Re: Paginate modification

Just change

if ($cur_page <= ($num_pages-3))
{
    if ($cur_page != ($num_pages-3))
        $pages[] = '…';

to

if ($cur_page <= ($num_pages-*))
{
    if ($cur_page != ($num_pages-*))
        $pages[] = '…';

where * is 8 or 65536 or something or whatever you want the maximum number of pages before the ... to be.

Re: Paginate modification

Paul: you're right, but my forum is very small and I think we couldn't reach 20 pages of posts
scottywz: it works, but i've to add 4 more changes. Following the example you posted, it was easy. Thanks so much !!