Jump to content

ThLoser

New Members
  • Posts

    2
  • Joined

  • Last visited

ThLoser's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a paging script right now, and i want to only show 5 sites like this 1 2 3 4 5 2 3 4 5 6 And so on. I have 9 pages right now, and when i come to page 6-7 the script removes everything backward but i want it to be 5 6 7 8 9 function pager($link, $page, $pages, $sub='') { $PageLink = '<div class="pagination pagination-mini"><ul>'; if($page != 1) $PageLink .= '<li><a href="'.$link.'&page='.($page-1).'" rel="nofollow">«</a></li>'; if($page+4 >= $pages) $pagex=$pages; else $pagex = (($page != 5) ? $page+4 : $page+1); echo $page-4; for($i=$page-4 ; $i<=$pagex ; $i++) { if($i<=0) $i=1; if($i==$page) $PageLink .= '<li><a href="#" style="font-weight:bold;" rel="nofollow">'.$i.'</a></li>'; else $PageLink .= '<li><a href="'.$link.'&page='.$i.'" rel="nofollow">'.$i.'</a></li>'; } if($page != $pages) $PageLink .= '<li><a href="'.$link.'&'.$sub.'page='.($page+1).'" rel="nofollow">»</a></li>'; $PageLink .= '</div>'; return $PageLink; } I can try to explain better if necessary
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.