Tying off some loose ends here with some drupal sites, I just keep adding more stuff and never get the project rolling over the line.
I know in in principle how the whole pager routine work for books in general – very general until I sat down early on this evening to finish it all off heres what I came up with after 30 minutes of goggling. I do like the structure of the books data set.
//This is numbers per page
$num_per_page = 5;
//actual query
$query = "SELECT n.nid, n.created FROM {node} n WHERE n.type = 'halloffame' AND n.status = 1 ORDER BY n.created DESC";
//the count query should be similar to the query above
$count_query = "SELECT COUNT(*) AS row_count FROM {node} n WHERE n.type = 'halloffame' AND n.status = 1 ORDER BY n.created DESC";
//pager_query function
$result = pager_query($query, $num_per_page, 0, $count_query, $user_load->uid);
//dont forget
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
$output .= theme('pager', NULL, 5, 0);
print $output;
?>