Forum Moderators: coopster
Looking for some help on pagination. I listed to code that im using on my site below, problem is it shows previous - all news pages 200 of them - then next . What i want to get it to do is just show a range of them no matter what page your on. So for ex if your on page 35 of the news articles it shows 30-31-32-33-34-35-36-37-38-39-40 instead of all 200 of them
You can see what i mean by this page in my site <snip>
heres is the pagination code that is currently being used, think i have to change something in the middle of it , any help appreciated.
<?
if($page > 1){
$prev = ($page - 1);
echo "<a href=news.php?page=$prev class='yellow_link'>Previous</a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=news.php?page=$i class='yellow_link'>$i</a> ";
}
}
// Build Next Link
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=news.php?page=$next class='yellow_link'>Next</a>";
}
echo "</center>";
?>
[edited by: eelixduppy at 6:51 am (utc) on Dec. 22, 2009]
[edit reason] no personal URLs, please [/edit]