View Single Post
Old 10-27-2008, 04:36 PM  
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
I must admit I have no idea what you're talking about, but hey, here's some pagination code I use.

Does the nice 1, 2, 3 .... 98, 99,100 thing.
Good luck (??)

PHP Code:
<?

 $start        =    $_start;
 $pCount    =    $_count;
 $pages        =    ceil($_items/$pCount);
 $curPage    =    $start/$pCount;

?>
<div class="pages">Pages: <? if ($curPage == 0) { ?><img src="/images/arrow_back_off.png" border="0" /><? } else { ?><a href="<?=$_link?><?=($start-$pCount)?>/"><img src="/images/arrow_back.png" border="0" /></a><? } ?> <? if ($pages < 8) { for($i=0;$i<$pages;$i++) { ?><? if ($i==$curPage) { ?><span class="highlight"><?=($curPage+1)?></span><? } else {?><a href="<?=$_link?><?=($i*$pCount)?>/"><?=($i+1)?></a> <? } } } else { if($curPage > 2) { for($i=0;$i<3;$i++) { ?><a href="<?=$_link?><?=($i*$pCount)?>/"><?=($i+1)?></a> <? } ?> ... <? }; for($i=(($curPage > 2)?($curPage):0);$i<((($curPage+8)>=$pages)?$pages:($curPage+8));$i++) { ?><? if ($i==$curPage) { ?><span class="highlight"><?=($curPage+1)?></span> <? } else { ?><a href="<?=$_link?><?=($i*$pCount)?>/"><?=($i+1)?></a> <? } } ?>....<? for($i=($pages-3);$i<$pages;$i++) { ?><a href="<?=$_link?><?=($i*$pCount)?>/"><?=($i+1)?></a> <? } } ?><? if ($curPage >= ($pages-1)) { ?><img src="/images/arrow_forward_off.png" border="0" /><? } else { ?><a href="<?=$_link?><?=($start+$pCount)?>/"><img src="/images/arrow_forward.png" border="0" /></a><? } ?> </div>

Last edited by quantum-x; 10-27-2008 at 04:38 PM..
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote