Advertisement
Guest User

Untitled

a guest
May 1st, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.     function paginator ($paginator) {
  2.         if ($paginator['paginCountPost'] > $paginator['paginLimitPerPage']) {
  3.             $countPages = 0;
  4.            
  5.             $countPages = ceil($paginator['paginCountPost']/$paginator['paginLimitPerPage']) + 1;
  6.            
  7.             for ($i=0; $i<$paginator['paginCountPost']; $i+=$paginator['paginLimitPerPage']) {
  8.                 $countPages--;
  9.                 if ($paginator['nowPageStart'] == $countPages) {
  10.                     echo '<b>'.$countPages.'</b>&nbsp;&nbsp;';
  11.                 } else {
  12.                     $countPagesUrl = $countPages == 1 ? '' :  'page/' . $countPages;
  13.                     echo '<a href="'.$paginator['paginMaskUrlPage'].'/'.$countPagesUrl.'">'.$countPages.'</a>&nbsp;&nbsp;';
  14.                 }
  15.             }
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement