The code below creates a list of pages for the user to select. I need it to not show more than say 10 pages at once. Instead showing a break. Any ideas how?
So instead of: 1,2,3,4,5,6,7,8,9,10
It would be more like: 1,2,3 ... 8,9,10
//start pagenation part two
echo '<div class="pages">';
if ($page == 1) // this is the first page - there is no previous page
echo "<span class=\"nextprev\">Previous</span>";
else // not the first page, link to the previous page
echo "<a href=\"/?cat=$cat&page=" . ($page - 1) . "\">Previous</a>";
for ($i = 1; $i <= $pager->numPages; $i++) {
echo " ";
if ($i == $pager->page)
echo "<span class=\"current\">Page $i</span>";
else
echo "<a href=\"/?cat=$cat&page=$i\">$i</a>";
}
if ($page == $pager->numPages) // this is the last page - there is no next page
echo "<span class=\"nextprev\">Next</span>";
else // not the last page, link to the next page
echo "<a href=\"/?cat=$cat&page=" . ($page + 1) . "\">Next</a>";
echo '</div>';
//end pagenation part two[/quote]