Digg.com style pagination function
Tuesday, June 5th, 2007I introduce nice Digg.com style pagination function. This pagination function is very flexible and easy to implement in all kind of scripts. All you have to do is to set current page parameter, total pages parameter and pagination format. I will give you an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <? //include paginate funtion include('paginate.php'); //get total pages number $total = $db['result']['total_pages']; //get curent page $page = $_GET['p']; //formate pagination layout $format_pg = array ( 'start_tag' => '<ul>', 'close_tag' => '</ul>', 'a_open' => '<li>', 'a_close' => '</li>', 'a_curent' => ' style="color:red"', 'url_q' => '?p=%d', 'lang_next' => 'NEXT', 'lang_previous' => 'PREVIOUS', 'a_space' => '...', ); //finaly print pagination echo paginate($page, $total, $format_pg); ?> |
Paginate function is free. To download paginate function hit following link:


























