Welcome Guest, Not a member yet? Register   Sign In
Pagination - Pages over 999
#1

[eluser]cbmeeks[/eluser]
Last night I was adding better pagination to my search site.

Things are working great. However, I want to put some stats on the page...something like "Viewing page 20-30 of 23,342 pages"

Works great. Until I get to pages above 999. Even though my page number in the URL shows "start=1200" the pagination shows page 990.

Every other page works below 1000.

I've looked in the Pagination.php but can't seem to find any limits.

Any suggestions?

Thanks
#2

[eluser]Colin Williams[/eluser]
Ha! Users typically don't go beyond the third page of results, so I'm not sure it's much to even worry about! Interesting situation though.
#3

[eluser]cbmeeks[/eluser]
Yeah. Exactly. In fact, while my site currently shows you thousands of pages of results, people almost never go past the first 2-3 pages.

These are things that I hope to take advantage of in my effort to save the world by searching. LOL

Seriously, I've often wondered how many people go to page 6,789 in a Google search of Apple.
#4

[eluser]internut[/eluser]
My CI project is going well and I'm getting closer to having a section which uses pagination done. So I added in over 1,000 test records to see how things went and pagination broke.

The records displaying to screen and all are correct and perfect, but the links that pagination library is sending out gets all messed up.

I Have:

Code:
$this->load->library('pagination');
$config['base_url'] = site_url() . "/admin/users/page/";
$config['total_rows'] = $data[user_count];
$config['per_page'] = $this->config->item('per_page');
$config['uri_segment'] = 4;
$config['num_links'] = 8;
$this->pagination->initialize($config);

There are 1093 records set in $data[user_count]

First Page of pagination gives links:

1 2 3 4 5 6 7 8 9 > Last ›

Which almost looks ok. Thought there should be 8 links?

Anyway I click on link #8

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 > Last ›

I click on #16 and get:

‹ First < 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > Last ›

Click on Last & get:

‹ First < 102 103 104 105 106 107 108 109 110

Which almost looks right (tho 9 links instead of 8)

Click on #102 & get:

‹ First < 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 >

Any thoughts? This did not seem to be a problem while testing with 20 to 30 records.

Maybe I'll go go 999 and see if thats where it gets crazy.
#5

[eluser]Rey Philip Regis[/eluser]
Wow! 999 records using pagination? I dont think users would browse them all hahaha....Anyways, I haven't tried that one yet.....
#6

[eluser]EEssam[/eluser]
[quote author="Colin Williams" date="1216170959"]Ha! Users typically don't go beyond the third page of results, so I'm not sure it's much to even worry about! Interesting situation though.[/quote]What if the user clicked "Last Page" link, to find older results?

Very common.
#7

[eluser]internut[/eluser]
No matter the record count you should always be able to get to the end, or move backwards from the end.

Say you did a sort on a "record created" field. Be nice to see click the last page and see the oldest records and move backwards from there. Not often used maybe but the feature should be there.

The way its working with that many records I've just learned to live with. It does produce a long
# of links:

IE:

‹ First < 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > Last ›

but I have room for it.
#8

[eluser]felyx[/eluser]
And if I have an admin page and I have a couple thousands of users or posts or whatever I want to manage, 10 listed per page then I just shouldnt care data beyond the 990th page? That is just an example how bad is that thinking. Pagination must work no matter how many data you have or how many pages you want to be shown.




Theme © iAndrew 2016 - Forum software by © MyBB