Diesl Posted May 10, 2011 Share Posted May 10, 2011 PAGINATION FUNCTION This a pagination function that makes the presentation of the total list of available pages much cleaner and user-friendly. Features can be used anywhere in your game ability to customize how many pages are displayed in the spread CSS styled pagination elements First Page and Last Page buttons How to Use The pagination function calls for 5 arguments; $total, $action, $page, $perpage, $spread. $total: the total number of entries to use in your pagination. Ex. If this function was used for your events, you would need to send in the total number of events for the given user. $action: the function requires you to use a $_GET action parameter to send the user back to the correct page. If you are using a different parameter, or not using a parameter at all, the function can be easily modified to accomodate $page: what page the user is currently on $perpage: how many instances you want to display (default 25) $spread: the maximum number of pages you want to show between the first and last button (default 5) The function will print out the page list.The function will return the value of the current page that you are on, so that you can use it in your query. (Example of using the function: Events page) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. The returned value will be whatever page the user is currently on multiplied by the total number of events per page. This will be used as the starting value for the LIMIT in our query. Function Code PHP code: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. CSS code: [CSS] .pagelist { border: 1px solid #444444; padding: 2px 6px; text-decoration: none; font-size:12px; } [/CSS] Quote Link to comment Share on other sites More sharing options...
bineye Posted May 10, 2011 Share Posted May 10, 2011 very nice feature Quote Link to comment Share on other sites More sharing options...
athena26 Posted May 29, 2021 Share Posted May 29, 2021 Were do i add this lol Quote Link to comment Share on other sites More sharing options...
Sim Posted May 30, 2021 Share Posted May 30, 2021 Just adding the function will not have the effects you think you will. Every page that you want pagination added to, will also need code passed to the function. If I remember correctly, there's a global function file? If so, it can be added to that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.