Mega Code Archive
Navigation through a page-list, which is returned by a Database
0 and $allPages==0) {$allPages=$allPages+1;}
$thisPage = round(($limitStart+$limitBy) / $limitBy);
print "
Page ".$thisPage." of ".$allPages."
";
if($allEntries > $limitBy)
{
print "Pages: ";
for($entryNr=1; $entryNr<=$allPages; $entryNr++)
{
$startPage = ($entryNr * $limitBy) - $limitBy;
if($thisPage!=$entryNr){print "".$entryNr." ";}
else{print "".$entryNr." ";}
}
}
$startNext = $thisPage * $limitBy;
if($startNext < ($allPages * $limitBy) and $allEntries > $limitBy)
{print " next ";}
}
?>