Pagination - Page Index Value

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
DaveN
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Nov 06, 2017 8:59 am

Mon Nov 06, 2017 9:44 am

I have been asked to change the page index value on a page that has pagination. The code is old and was probably written in 2005. I understand the principal of pagination but this code uses a write_pager instruction and I can find absolutely no information on this instruction. I have looked at the code generated by the write_pager instruction but it does not tell me how the index is created. I have searched the web without success. The code currently allows for 100 entries per page and allows for 10 pages in the index. How do I change the value of the page index ? Any help would be appreciated.


$url_string="BirthRecordsSearch.php?place_birth=".rawurlencode($place_birth)."&date_birth=".rawurlencode($date_birth)."&forename=".rawurlencode($forename)."&surname=".rawurlencode($surname)."&father_1st=".rawurlencode($father_1st)."&mother_1st=".rawurlencode($mother_1st)."&area=".rawurlencode($area)."&regist_dist=".rawurlencode($regist_dist);

write_pager($url_string,$count[0],$current_page,100);

Thanks

DaveN

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 525
Joined: Mon Feb 22, 2016 5:52 pm

Mon Nov 06, 2017 11:52 am

Hi Dave,

You've not really given enough information:
I have been asked to change the page index value on a page that has pagination.
Pagination is so that the user can change the current page (the index)?

write_pager() is a user defined function and not part of the PHP core.

Can you clarify what you have been asked to do? and what you are using (CMS? hand coded ...)

DaveN
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Nov 06, 2017 8:59 am

Mon Nov 06, 2017 12:26 pm

Thank you for your reply. My apologies if I have caused any confusion with the term index. I am not surprised that I could not find anything re the write_pager() if it is not part of the PHP core.

The code itself appears to be standard PHP and HTML - all user written.

The bottom line on the page, which I call the index ie the output of the write_pager instruction is as follows:

1 2 3 4 5 6 7 8 9 10

I have been asked to increase the number of pages in the index to something larger than 10 since the output of the search often produces 50 or more pages. I cannot determine how this value of 10 pages is derived.

The entire code is contained in a 12KB PHP file which I can forward (with a recommended method).

Regards

DaveN

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 525
Joined: Mon Feb 22, 2016 5:52 pm

Mon Nov 06, 2017 6:27 pm

"index" can infer different things :?

You'll need to find the function write_pager() and see what's what for starters.

If you just have a 12k file, it shouldn't take too long, if it's more than one file, then it might be worth using an editor that can search in all files.

As this appears to be a commercial interest, couldn't the owners simply pay to get it all up to date?

DaveN
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Nov 06, 2017 8:59 am

Tue Nov 07, 2017 6:49 am

I have looked for the function write_pager() but cannot find it. I now understand that my question is probably meaningless unless I find this function.

You have pointed me in the right direction and I think it is now up to me to try and solve this issue. I thank you for that.

By the way, this is not a commercial application.

Regards

DaveN

DaveN
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Nov 06, 2017 8:59 am

Tue Nov 07, 2017 7:41 am

I made another attempt to find the write_pager function and finally found it ! It was well hidden. My questions are now all answered.

Your suggestions led me in the right direction and I thank you for this.

Regards

DaveN

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 525
Joined: Mon Feb 22, 2016 5:52 pm

Tue Nov 07, 2017 10:34 am

Well done Dave, thanks for letting us know and good luck with sorting it out :)

Post Reply