Although the guide is in Danish, I believe you can easily understand and use the abstract class from this site: http://www.jensgram.dk/web/e-artikler/1265 (near the bottom).
All you need to do is implement the renderItem()
method and you're off:
class PaginatedGuestbook extends Paginator {
protected function renderItem(&$row) {
$o = "\Post from " . $row['name'] . "<br />\n"
. "Header: <b>" . $row['header'] . "</b><br />\n"
. "Text: " . $row['body'] . "<br />\n";
// You can do whatever you want with the $row array
return $o;
}
}
$gb = new PaginatedGuestbook(
'guestbook_table', // Table(s)
'tstamp, name, header, body', // Fields to populate in renderItem's $row
'hidden=0 AND deleted=0', // Condition
'tstamp DESC', // Ordering
5 // Items per page
);
print $gb->renderItems();
print "<br />\n\n";
print $gb->renderNavigation('paginated.php');
Furthermore, you can customize links etc.